@speechly/browser-ui
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function i(t){t.forEach(n)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e}function c(t){return 0===Object.keys(t).length}const a="undefined"!=typeof window;let d=a?()=>window.performance.now():()=>Date.now(),u=a?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&&u(h)}function g(t){let e;return 0===f.size&&u(h),{promise:new Promise((n=>{f.add(e={c:t,f:n})})),abort(){f.delete(e)}}}let p=!1;const m=new Set;function $(t,e){p&&m.delete(e),e.parentNode!==t&&t.appendChild(e)}function w(t,e,n){p&&m.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function v(t){p?m.add(t):t.parentNode&&t.parentNode.removeChild(t)}function y(t){return document.createElement(t)}function b(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(t){return document.createTextNode(t)}function C(){return x(" ")}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function S(t,e,n){t.classList[n?"add":"remove"](e)}function E(t){const e={};for(const n of t)e[n.name]=n.value;return e}const N=new Set;let T,P=0;function z(t,e,n,o,i,r,s,l=0){const c=16.666/o;let a="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*r(t);a+=100*t+`%{${s(o,1-o)}}\n`}const d=a+`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)}_${l}`,f=t.ownerDocument;N.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=f.head.appendChild(y("style")).sheet),g=f.__svelte_rules||(f.__svelte_rules={});g[u]||(g[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${u} ${o}ms linear ${i}ms 1 both`,P+=1,u}function R(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),P-=i,P||u((()=>{P||(N.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),N.clear())})))}function B(t){T=t}function M(){if(!T)throw new Error("Function called outside component initialization");return T}function D(t){M().$$.on_mount.push(t)}const I=[],F=[],A=[],L=[],H=Promise.resolve();let O=!1;function j(t){A.push(t)}let V=!1;const U=new Set;function q(){if(!V){V=!0;do{for(let t=0;t<I.length;t+=1){const e=I[t];B(e),W(e.$$)}for(B(null),I.length=0;F.length;)F.pop()();for(let t=0;t<A.length;t+=1){const e=A[t];U.has(e)||(U.add(e),e())}A.length=0}while(I.length);for(;L.length;)L.pop()();O=!1,V=!1,U.clear()}}function W(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(j)}}let G;function J(){return G||(G=Promise.resolve(),G.then((()=>{G=null}))),G}function K(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const Q=new Set;let X;function Y(t,e){t&&t.i&&(Q.delete(t),t.i(e))}function Z(t,e,n,o){if(t&&t.o){if(Q.has(t))return;Q.add(t),X.c.push((()=>{Q.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const tt={duration:0};function et(n,o,i){let s,l,c=o(n,i),a=!1,u=0;function f(){s&&R(n,s)}function h(){const{delay:o=0,duration:i=300,easing:r=e,tick:h=t,css:p}=c||tt;p&&(s=z(n,0,1,i,o,r,p,u++)),h(0,1);const m=d()+o,$=m+i;l&&l.abort(),a=!0,j((()=>K(n,!0,"start"))),l=g((t=>{if(a){if(t>=$)return h(1,0),K(n,!0,"end"),f(),a=!1;if(t>=m){const e=r((t-m)/i);h(e,1-e)}}return a}))}let p=!1;return{start(){p||(R(n),r(c)?(c=c(),J().then(h)):h())},invalidate(){p=!1},end(){a&&(f(),a=!1)}}}const nt="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ot(t,e,o,s){const{fragment:l,on_mount:c,on_destroy:a,after_update:d}=t.$$;l&&l.m(e,o),s||j((()=>{const e=c.map(n).filter(r);a?a.push(...e):i(e),t.$$.on_mount=[]})),d.forEach(j)}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 rt(t,e){-1===t.$$.dirty[0]&&(I.push(t),O||(O=!0,H.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function st(e,n,r,s,l,c,a=[-1]){const d=T;B(e);const u=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:n.context||[]),callbacks:o(),dirty:a,skip_bound:!1};let f=!1;if(u.ctx=r?r(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return u.ctx&&l(u.ctx[t],u.ctx[t]=i)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](i),f&&rt(e,t)),n})):[],u.update(),f=!0,i(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){p=!0;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&&Y(e.$$.fragment),ot(e,n.target,n.anchor,n.customElement),function(){p=!1;for(const t of m)t.parentNode.removeChild(t);m.clear()}(),q()}B(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(r);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(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var ct,at,dt,ut,ft,ht=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(ct={exports:{}},ct.exports),ct.exports);function gt(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 pt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function mt(t,{delay:e=0,speed:n,duration:o,easing:i=pt}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(at||(at={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(dt||(dt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(ut||(ut={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(ft||(ft={})),ht.ClientState.Disconnected,dt.Poweron,ut.Click,ft.None,ht.ClientState.Disconnecting,dt.Poweron,ut.Noninteractive,ft.Connecting,ht.ClientState.Connecting,dt.Poweron,ut.Noninteractive,ft.Connecting,ht.ClientState.Connected,dt.Mic,ut.Hold,ft.None,ht.ClientState.Starting,dt.Mic,ut.Hold,ft.Connecting,ht.ClientState.Recording,dt.Mic,ut.Hold,ft.None,ht.ClientState.Stopping,dt.Mic,ut.Noninteractive,ft.Busy,ht.ClientState.Failed,dt.Error,ut.Click,ft.None,ht.ClientState.NoBrowserSupport,dt.Error,ut.Click,ft.None,ht.ClientState.NoAudioConsent,dt.Denied,ut.Click,ft.None,at.Idle,dt.Poweron,ut.Click,ft.None,at.Connecting,dt.Poweron,ut.Noninteractive,ft.Connecting,at.Ready,dt.Mic,ut.Hold,ft.None,at.Recording,dt.Mic,ut.Hold,ft.None,at.Loading,dt.Mic,ut.Noninteractive,ft.Busy,at.Failed,dt.Error,ut.Click,ft.None,at.NoBrowserSupport,dt.Error,ut.Click,ft.None,at.NoAudioConsent,dt.Denied,ut.Click,ft.None;const $t=[0,1];function wt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),l=Math.ceil(r),c=r-s;return(1-c)*t[s]+c*t[l]}function vt(e){let n;return{c(){n=y("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"),k(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&&v(n),e[3](null)}}}function yt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>l?t:Math.max(s,t),l=Date.now()+e};let r,s=0,l=0,c=[0,0];const a=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return D((()=>{let t;const e=2*(c.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!r)return;const e=r.getContext("2d");if(!e)return;let i=(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(r).getPropertyValue("width").slice(0,-2)),f=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=u*i,r),n(1,r.height=f*i,r),Date.now()<l?c[0]=.15*s+.85*c[0]:c[0]=.0625+.75*c[0];let h=1;for(;h<c.length;)c[h]=.25*c[h-1]+.5*c[h]+.0625,h++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",h=0;h<c.length;h++){const t=c[h]*r.height;t*r.height>2*g?a(e,.5*r.width-g+h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),h>0&&(t*r.height>2*g?a(e,.5*r.width-g-h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return d(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){F[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class bt extends class{$destroy(){it(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=y("style")).id="svelte-1fz8oog-style",e.textContent="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}",$(document.head,e)),st(this,t,yt,vt,s,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const{window:xt}=nt;function Ct(t,e,n){const o=t.slice();return o[28]=e[n],o[30]=n,o}function kt(n){let o,s,l,c,a,u,f,h,p,m,b,x,_,S={color:n[4]};u=new bt({props:S}),n[18](u);let E=n[10]&&_t(n),N=n[6],T=[];for(let t=0;t<N.length;t+=1)T[t]=Et(Ct(n,N,t));let P=n[9]&&Nt(n);return{c(){var t;o=y("div"),s=y("div"),l=y("div"),c=C(),a=y("div"),(t=u.$$.fragment)&&t.c(),f=C(),E&&E.c(),p=C();for(let t=0;t<T.length;t+=1)T[t].c();m=C(),P&&P.c(),k(l,"class","TransscriptItemBgDiv"),k(a,"class","TransscriptItemContent"),k(s,"class","TranscriptItem"),k(o,"class","BigTranscript")},m(t,e){w(t,o,e),$(o,s),$(s,l),$(s,c),$(s,a),ot(u,a,null),$(a,f),E&&E.m(a,null),$(o,p);for(let t=0;t<T.length;t+=1)T[t].m(o,null);$(o,m),P&&P.m(o,null),_=!0},p(t,e){const n={};if(16&e&&(n.color=t[4]),u.$set(n),t[10]?E?1024&e&&Y(E,1):(E=_t(t),E.c(),Y(E,1),E.m(a,null)):E&&(E.d(1),E=null),33344&e){let n;for(N=t[6],n=0;n<N.length;n+=1){const i=Ct(t,N,n);T[n]?(T[n].p(i,e),Y(T[n],1)):(T[n]=Et(i),T[n].c(),Y(T[n],1),T[n].m(o,m))}for(;n<T.length;n+=1)T[n].d(1);T.length=N.length}t[9]?P?(P.p(t,e),512&e&&Y(P,1)):(P=Nt(t),P.c(),Y(P,1),P.m(o,null)):P&&(P.d(1),P=null)},i(t){if(!_){Y(u.$$.fragment,t),Y(E),h||j((()=>{h=et(s,n[13],{duration:200}),h.start()}));for(let t=0;t<N.length;t+=1)Y(T[t]);Y(P),j((()=>{x&&x.end(1),b||(b=et(o,n[12],{})),b.start()})),_=!0}},o(s){Z(u.$$.fragment,s),b&&b.invalidate(),x=function(n,o,s){let l,c=o(n,s),a=!0;const u=X;function f(){const{delay:o=0,duration:r=300,easing:s=e,tick:f=t,css:h}=c||tt;h&&(l=z(n,1,0,r,o,s,h));const p=d()+o,m=p+r;j((()=>K(n,!1,"start"))),g((t=>{if(a){if(t>=m)return f(0,1),K(n,!1,"end"),--u.r||i(u.c),!1;if(t>=p){const e=s((t-p)/r);f(1-e,e)}}return a}))}return u.r+=1,r(c)?J().then((()=>{c=c(),f()})):f(),{end(t){t&&c.tick&&c.tick(1,0),a&&(l&&R(n,l),a=!1)}}}(o,n[12],{}),_=!1},d(t){t&&v(o),n[18](null),it(u),E&&E.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(T,t),P&&P.d(),t&&x&&x.end()}}}function _t(e){let n,o;return{c(){n=y("div"),n.textContent="Listening...",k(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||j((()=>{o=et(n,e[13],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function St(t){let e,n;return{c(){e=y("span"),k(e,"style",n=t[30]<t[6].length-1?"width:0.25em;":t[9]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){576&o&&n!==(n=t[30]<t[6].length-1?"width:0.25em;":t[9]?"width:1.2em;":"")&&k(e,"style",n)},d(t){t&&v(e)}}}function Et(e){let n,o,i,r,s,l,c,a,d,u=e[28].word+"",f=e[30]<e[6].length&&St(e);return{c(){n=y("div"),o=y("div"),r=C(),s=y("div"),l=x(u),c=C(),f&&f.c(),k(o,"class","TransscriptItemBgDiv"),k(s,"class","TransscriptItemContent"),k(n,"class",d="TranscriptItem "+e[15](e[28])),S(n,"Entity",null!==e[28].entityType),S(n,"Final",e[28].isFinal)},m(t,e){w(t,n,e),$(n,o),$(n,r),$(n,s),$(s,l),$(s,c),f&&f.m(s,null)},p(t,e){64&e&&u!==(u=t[28].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(l,u),t[30]<t[6].length?f?f.p(t,e):(f=St(t),f.c(),f.m(s,null)):f&&(f.d(1),f=null),64&e&&d!==(d="TranscriptItem "+t[15](t[28]))&&k(n,"class",d),64&e&&S(n,"Entity",null!==t[28].entityType),64&e&&S(n,"Final",t[28].isFinal)},i(t){i||j((()=>{i=et(o,e[13],{}),i.start()})),a||j((()=>{a=et(s,e[13],{}),a.start()}))},o:t,d(t){t&&v(n),f&&f.d()}}}function Nt(e){let n,o,i,r,s,l,c,a;return{c(){n=y("div"),o=y("div"),i=C(),r=y("div"),s=b("svg"),l=b("path"),k(o,"class","TransscriptItemBgDiv"),_(o,"background-color",e[4]),k(l,"stroke","currentColor"),k(l,"stroke-width","3"),k(l,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),k(l,"fill","none"),k(l,"fill-rule","evenodd"),_(s,"width","2rem"),_(s,"height","2rem"),_(s,"position","absolute"),_(s,"transform","translate(-0.5rem, -0.5rem)"),_(s,"stroke","#eee"),k(s,"viewBox","0 0 24 24"),k(s,"xmlns","http://www.w3.org/2000/svg"),_(r,"width","1.0rem"),_(r,"height","1rem"),_(r,"position","relative"),k(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,i),$(n,r),$(r,s),$(s,l)},p(t,e){16&e&&_(o,"background-color",t[4])},i(t){c||j((()=>{c=et(l,e[11],{duration:500}),c.start()})),a||j((()=>{a=et(n,e[13],{duration:200,maxWidth:3}),a.start()}))},o:t,d(t){t&&v(n)}}}function Tt(e){let n,o,r,s,l,c,a=e[7]&&kt(e);return{c(){n=y("main"),a&&a.c(),o=C(),r=y("link"),this.c=t,_(n,"--voffset",e[1]),_(n,"--hoffset",e[2]),_(n,"--fontsize",e[3]),_(n,"--highlight-color",e[4]),_(n,"--text-bg-color",e[5]),S(n,"placementTop","top"===e[0]),k(r,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),k(r,"rel","stylesheet")},m(t,i){var d,u,f,h;w(t,n,i),a&&a.m(n,null),w(t,o,i),$(document.head,r),s=!0,l||(d=xt,u="message",f=e[14],d.addEventListener(u,f,h),c=()=>d.removeEventListener(u,f,h),l=!0)},p(t,[e]){t[7]?a?(a.p(t,e),128&e&&Y(a,1)):(a=kt(t),a.c(),Y(a,1),a.m(n,null)):a&&(X={r:0,c:[],p:X},Z(a,1,1,(()=>{a=null})),X.r||i(X.c),X=X.p),(!s||2&e)&&_(n,"--voffset",t[1]),(!s||4&e)&&_(n,"--hoffset",t[2]),(!s||8&e)&&_(n,"--fontsize",t[3]),(!s||16&e)&&_(n,"--highlight-color",t[4]),(!s||32&e)&&_(n,"--text-bg-color",t[5]),1&e&&S(n,"placementTop","top"===t[0])},i(t){s||(Y(a),s=!0)},o(t){Z(a),s=!1},d(t){t&&v(n),a&&a.d(),t&&v(o),v(r),l=!1,c()}}}function Pt(t,e,n){let o,i,{placement:r}=e,{voffset:s="3rem"}=e,{hoffset:l="2rem"}=e,{fontsize:c="1.5rem"}=e,{highlightcolor:a="#15e8b5"}=e,{textbgcolor:d="#202020"}=e,u=[],f=!1,h=null,g=null,p=ht.ClientState.Disconnected,m=!1,$=!1,w=!1;const v=M(),y=(t,e)=>{v.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))},b=gt(mt),x=gt(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:pt,css:t=>`\n opacity: ${wt($t,t,0,1)};\n max-height: ${10*wt($t,t,0,.6)}rem;\n `}))),C=gt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${wt($t,t,0,1)*o}rem;\n `}))),k=t=>{if(void 0===t)return;i&&f&&i.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?S(u.length>0?2e3:0):u.length>0&&(m||n(17,m=!0),S(2e3));const e=`${t.contextId}/${t.id}`;null!==g?g!==e&&(n(9,w=!1),g=e):g=e,n(6,u=[]),t.words.forEach((t=>{n(6,u[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},u)})),t.entities.forEach((t=>{n(6,u[t.startPosition].word=t.value,u),n(6,u[t.startPosition].entityType=t.type,u),n(6,u[t.startPosition].isFinal=t.isFinal,u),n(6,u[t.startPosition].hide=!1,u);for(let e=t.startPosition+1;e<t.endPosition;e++)u[e]&&n(6,u[e].hide=!0,u)})),n(6,u=u.filter((t=>!t.hide)))};v.onSegmentUpdate=k;const _=t=>{y("debug","big-transcript.ping 1")},S=(t=0)=>{E(),h=window.setTimeout((()=>{h=null,m&&n(17,m=!1)}),t)},E=()=>{null!==h&&(window.clearTimeout(h),h=null)};return D((()=>{const t=t=>k(t.detail);return v.addEventListener("speechsegment",t),v.addEventListener("ping",_),()=>{cancelAnimationFrame(null),v.removeEventListener("speechsegment",t),v.removeEventListener("ping",_)}})),t.$$set=t=>{"placement"in t&&n(0,r=t.placement),"voffset"in t&&n(1,s=t.voffset),"hoffset"in t&&n(2,l=t.hoffset),"fontsize"in t&&n(3,c=t.fontsize),"highlightcolor"in t&&n(4,a=t.highlightcolor),"textbgcolor"in t&&n(5,d=t.textbgcolor)},t.$$.update=()=>{if(64&t.$$.dirty&&n(10,o=0===u.length),196736&t.$$.dirty){const t=p===ht.ClientState.Recording||m;t!==$&&y("visibilitychanged",t),n(7,$=t)}},[r,s,l,c,a,d,u,$,i,w,o,b,x,C,t=>{switch(t.data.type){case"speechsegment":k(t.data.segment);break;case"holdstart":f=!0;break;case"holdend":f=!1;break;case"speechhandled":t.data.success&&n(9,w=!0);break;case"speechstate":n(16,p=t.data.state),p===ht.ClientState.Recording&&(n(9,w=!1),n(6,u=[]),g=null)}},t=>t.entityType||"",p,m,function(t){F[t?"unshift":"push"]((()=>{i=t,n(8,i)}))}]}class zt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:#fff;font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap}.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}.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, #fff8, #fffc, #fff8, #fffc, #fff8);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:E(this.attributes),customElement:!0},Pt,Tt,l,{placement:0,voffset:1,hoffset:2,fontsize:3,highlightcolor:4,textbgcolor:5}),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),q()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","highlightcolor","textbgcolor"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),q()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),q()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),q()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),q()}get highlightcolor(){return this.$$.ctx[4]}set highlightcolor(t){this.$set({highlightcolor:t}),q()}get textbgcolor(){return this.$$.ctx[5]}set textbgcolor(t){this.$set({textbgcolor:t}),q()}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",zt)}(); | ||
!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 i(){return Object.create(null)}function r(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 l(t,e){return t!=t?e==e:t!==e}function a(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 f=u?()=>window.performance.now():()=>Date.now(),h=u?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&h(p)}function m(t){let e;return 0===g.size&&h(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}let $=!1;const b=new Set;function w(t,e){$&&b.delete(e),e.parentNode!==t&&t.appendChild(e)}function y(t,e,n){$&&b.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function v(t){$?b.add(t):t.parentNode&&t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function C(t){return document.createTextNode(t)}function _(){return C(" ")}function S(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function N(t,e,n){t.classList[n?"add":"remove"](e)}function T(t){const e={};for(const n of t)e[n.name]=n.value;return e}const P=new Set;let z,R=0;function D(t,e,n,o,i,r,s,c=0){const l=16.666/o;let a="{\n";for(let t=0;t<=1;t+=l){const o=e+(n-e)*r(t);a+=100*t+`%{${s(o,1-o)}}\n`}const d=a+`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}`,f=t.ownerDocument;P.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=f.head.appendChild(x("style")).sheet),g=f.__svelte_rules||(f.__svelte_rules={});g[u]||(g[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${u} ${o}ms linear ${i}ms 1 both`,R+=1,u}function B(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),R-=i,R||h((()=>{R||(P.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),P.clear())})))}function M(t){z=t}function A(){if(!z)throw new Error("Function called outside component initialization");return z}const I=[],F=[],O=[],j=[],L=Promise.resolve();let H=!1;function V(t){O.push(t)}let q=!1;const U=new Set;function W(){if(!q){q=!0;do{for(let t=0;t<I.length;t+=1){const e=I[t];M(e),G(e.$$)}for(M(null),I.length=0;F.length;)F.pop()();for(let t=0;t<O.length;t+=1){const e=O[t];U.has(e)||(U.add(e),e())}O.length=0}while(I.length);for(;j.length;)j.pop()();H=!1,q=!1,U.clear()}}function G(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(V)}}let J;function K(){return J||(J=Promise.resolve(),J.then((()=>{J=null}))),J}function Q(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const X=new Set;let Y;function Z(t,e){t&&t.i&&(X.delete(t),t.i(e))}function tt(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),Y.c.push((()=>{X.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const et={duration:0};function nt(n,o,i){let r,c,l=o(n,i),a=!1,d=0;function u(){r&&B(n,r)}function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:g}=l||et;g&&(r=D(n,0,1,i,o,s,g,d++)),h(0,1);const p=f()+o,$=p+i;c&&c.abort(),a=!0,V((()=>Q(n,!0,"start"))),c=m((t=>{if(a){if(t>=$)return h(1,0),Q(n,!0,"end"),u(),a=!1;if(t>=p){const e=s((t-p)/i);h(e,1-e)}}return a}))}let g=!1;return{start(){g||(B(n),s(l)?(l=l(),K().then(h)):h())},invalidate(){g=!1},end(){a&&(u(),a=!1)}}}const ot="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function it(t,e,n,i){const{fragment:c,on_mount:l,on_destroy:a,after_update:d}=t.$$;c&&c.m(e,n),i||V((()=>{const e=l.map(o).filter(s);a?a.push(...e):r(e),t.$$.on_mount=[]})),d.forEach(V)}function rt(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 st(t,e){-1===t.$$.dirty[0]&&(I.push(t),H||(H=!0,L.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ct(e,n,o,s,c,l,a=[-1]){const d=z;M(e);const u=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:n.context||[]),callbacks:i(),dirty:a,skip_bound:!1};let f=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=i)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](i),f&&st(e,t)),n})):[],u.update(),f=!0,r(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){$=!0;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&&Z(e.$$.fragment),it(e,n.target,n.anchor,n.customElement),function(){$=!1;for(const t of b)t.parentNode.removeChild(t);b.clear()}(),W()}M(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(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){rt(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var at,dt,ut,ft,ht,gt=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(at={exports:{}},at.exports),at.exports);function pt(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){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:i=mt}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(dt||(dt={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(ut||(ut={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(ft||(ft={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(ht||(ht={})),gt.ClientState.Disconnected,ut.Poweron,ft.Click,ht.None,gt.ClientState.Disconnecting,ut.Poweron,ft.Noninteractive,ht.Connecting,gt.ClientState.Connecting,ut.Poweron,ft.Noninteractive,ht.Connecting,gt.ClientState.Connected,ut.Mic,ft.Hold,ht.None,gt.ClientState.Starting,ut.Mic,ft.Hold,ht.Connecting,gt.ClientState.Recording,ut.Mic,ft.Hold,ht.None,gt.ClientState.Stopping,ut.Mic,ft.Noninteractive,ht.Busy,gt.ClientState.Failed,ut.Error,ft.Click,ht.None,gt.ClientState.NoBrowserSupport,ut.Error,ft.Click,ht.None,gt.ClientState.NoAudioConsent,ut.Denied,ft.Click,ht.None,dt.Idle,ut.Poweron,ft.Click,ht.None,dt.Connecting,ut.Poweron,ft.Noninteractive,ht.Connecting,dt.Ready,ut.Mic,ft.Hold,ht.None,dt.Recording,ut.Mic,ft.Hold,ht.None,dt.Loading,ut.Mic,ft.Noninteractive,ht.Busy,dt.Failed,ut.Error,ft.Click,ht.None,dt.NoBrowserSupport,ut.Error,ft.Click,ht.None,dt.NoAudioConsent,ut.Denied,ft.Click,ht.None;const bt=[0,1];function wt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),l=r-s;return(1-l)*t[s]+l*t[c]}function yt(e){let n;return{c(){n=x("canvas"),E(n,"color",e[0]),E(n,"display","block"),E(n,"width","1.35rem"),E(n,"height","1.5rem"),E(n,"margin","0"),E(n,"padding","0 0.8rem 0 0rem"),E(n,"flex-grow","0"),E(n,"flex-shrink","0"),E(n,"flex-basis","1.35rem"),S(n,"class","svelte-1fz8oog")},m(t,o){y(t,n,o),e[3](n)},p(t,[e]){1&e&&E(n,"color",t[0])},i:t,o:t,d(t){t&&v(n),e[3](null)}}}function vt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,l=[0,0];const a=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return function(t){A().$$.on_mount.push(t)}((()=>{let t;const e=2*(l.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!r)return;const e=r.getContext("2d");if(!e)return;let i=(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(r).getPropertyValue("width").slice(0,-2)),f=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=u*i,r),n(1,r.height=f*i,r),Date.now()<c?l[0]=.15*s+.85*l[0]:l[0]=.0625+.75*l[0];let h=1;for(;h<l.length;)l[h]=.25*l[h-1]+.5*l[h]+.0625,h++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",h=0;h<l.length;h++){const t=l[h]*r.height;t*r.height>2*g?a(e,.5*r.width-g+h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),h>0&&(t*r.height>2*g?a(e,.5*r.width-g-h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return d(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){F[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class xt extends class{$destroy(){rt(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=x("style")).id="svelte-1fz8oog-style",e.textContent="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}",w(document.head,e)),ct(this,t,vt,yt,c,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const kt=[];function Ct(t){return"[object Date]"===Object.prototype.toString.call(t)}function _t(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)=>_t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(Ct(t)&&Ct(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]=_t(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 St(o,i={}){const r=function(e,n=t){let o;const i=[];function r(t){if(c(e,t)&&(e=t,o)){const t=!kt.length;for(let t=0;t<i.length;t+=1){const n=i[t];n[1](),kt.push(n,e)}if(t){for(let t=0;t<kt.length;t+=2)kt[t][0](kt[t+1]);kt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const l=[s,c];return i.push(l),1===i.length&&(o=n(r)||t),s(e),()=>{const t=i.indexOf(l);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}(o);let s,l=o;function a(t,c){if(null==o)return r.set(o=t),Promise.resolve();l=t;let a=s,d=!1,{delay:u=0,duration:h=400,easing:g=e,interpolate:p=_t}=n(n({},i),c);if(0===h)return a&&(a.abort(),a=null),r.set(o=l),Promise.resolve();const $=f()+u;let b;return s=m((e=>{if(e<$)return!0;d||(b=p(o,t),"function"==typeof h&&(h=h(o,t)),d=!0),a&&(a.abort(),a=null);const n=e-$;return n>h?(r.set(o=t),!1):(r.set(o=b(g(n/h))),!0)})),s.promise}return{set:a,update:(t,e)=>a(t(l,o),e),subscribe:r.subscribe}}const{window:Et}=ot;function Nt(t,e,n){const o=t.slice();return o[37]=e[n],o[39]=n,o}function Tt(n){let o,i,c,l,a,d,u,h,g,p,$,b,k,C={color:n[5]};d=new xt({props:C}),n[29](d);let E=n[14]&&Pt(n),N=n[10],T=[];for(let t=0;t<N.length;t+=1)T[t]=Rt(Nt(n,N,t));let P=n[13]&&Dt(n);return{c(){var t;o=x("div"),i=x("div"),c=x("div"),l=_(),a=x("div"),(t=d.$$.fragment)&&t.c(),u=_(),E&&E.c(),g=_();for(let t=0;t<T.length;t+=1)T[t].c();p=_(),P&&P.c(),S(c,"class","TransscriptItemBgDiv"),S(a,"class","TransscriptItemContent"),S(i,"class","TranscriptItem"),S(o,"class","BigTranscript")},m(t,e){y(t,o,e),w(o,i),w(i,c),w(i,l),w(i,a),it(d,a,null),w(a,u),E&&E.m(a,null),w(o,g);for(let t=0;t<T.length;t+=1)T[t].m(o,null);w(o,p),P&&P.m(o,null),k=!0},p(t,e){const n={};if(32&e[0]&&(n.color=t[5]),d.$set(n),t[14]?E?16384&e[0]&&Z(E,1):(E=Pt(t),E.c(),Z(E,1),E.m(a,null)):E&&(E.d(1),E=null),2106368&e[0]){let n;for(N=t[10],n=0;n<N.length;n+=1){const i=Nt(t,N,n);T[n]?(T[n].p(i,e),Z(T[n],1)):(T[n]=Rt(i),T[n].c(),Z(T[n],1),T[n].m(o,p))}for(;n<T.length;n+=1)T[n].d(1);T.length=N.length}t[13]?P?(P.p(t,e),8192&e[0]&&Z(P,1)):(P=Dt(t),P.c(),Z(P,1),P.m(o,null)):P&&(P.d(1),P=null)},i(t){if(!k){Z(d.$$.fragment,t),Z(E),h||V((()=>{h=nt(i,n[19],{duration:200}),h.start()}));for(let t=0;t<N.length;t+=1)Z(T[t]);Z(P),V((()=>{b&&b.end(1),$||($=nt(o,n[18],{})),$.start()})),k=!0}},o(i){tt(d.$$.fragment,i),$&&$.invalidate(),b=function(n,o,i){let c,l=o(n,i),a=!0;const d=Y;function u(){const{delay:o=0,duration:i=300,easing:s=e,tick:u=t,css:h}=l||et;h&&(c=D(n,1,0,i,o,s,h));const g=f()+o,p=g+i;V((()=>Q(n,!1,"start"))),m((t=>{if(a){if(t>=p)return u(0,1),Q(n,!1,"end"),--d.r||r(d.c),!1;if(t>=g){const e=s((t-g)/i);u(1-e,e)}}return a}))}return d.r+=1,s(l)?K().then((()=>{l=l(),u()})):u(),{end(t){t&&l.tick&&l.tick(1,0),a&&(c&&B(n,c),a=!1)}}}(o,n[18],{}),k=!1},d(t){t&&v(o),n[29](null),rt(d),E&&E.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(T,t),P&&P.d(),t&&b&&b.end()}}}function Pt(e){let n,o;return{c(){n=x("div"),n.textContent="Listening...",S(n,"class","listening")},m(t,e){y(t,n,e)},i(t){o||V((()=>{o=nt(n,e[19],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function zt(t){let e,n;return{c(){e=x("span"),S(e,"style",n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){y(t,e,n)},p(t,o){9216&o[0]&&n!==(n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&S(e,"style",n)},d(t){t&&v(e)}}}function Rt(e){let n,o,i,r,s,c,l,a,d,u=e[37].word+"",f=e[39]<e[10].length&&zt(e);return{c(){n=x("div"),o=x("div"),r=_(),s=x("div"),c=C(u),l=_(),f&&f.c(),S(o,"class","TransscriptItemBgDiv"),S(s,"class","TransscriptItemContent"),S(n,"class",d="TranscriptItem "+e[21](e[37])),N(n,"Entity",null!==e[37].entityType),N(n,"Final",e[37].isFinal)},m(t,e){y(t,n,e),w(n,o),w(n,r),w(n,s),w(s,c),w(s,l),f&&f.m(s,null)},p(t,e){1024&e[0]&&u!==(u=t[37].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(c,u),t[39]<t[10].length?f?f.p(t,e):(f=zt(t),f.c(),f.m(s,null)):f&&(f.d(1),f=null),1024&e[0]&&d!==(d="TranscriptItem "+t[21](t[37]))&&S(n,"class",d),1024&e[0]&&N(n,"Entity",null!==t[37].entityType),1024&e[0]&&N(n,"Final",t[37].isFinal)},i(t){i||V((()=>{i=nt(o,e[19],{}),i.start()})),a||V((()=>{a=nt(s,e[19],{}),a.start()}))},o:t,d(t){t&&v(n),f&&f.d()}}}function Dt(e){let n,o,i,r,s,c,l,a;return{c(){n=x("div"),o=x("div"),i=_(),r=x("div"),s=k("svg"),c=k("path"),S(o,"class","TransscriptItemBgDiv"),E(o,"background-color",e[5]),S(c,"stroke","currentColor"),S(c,"stroke-width","3"),S(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),S(c,"fill","none"),S(c,"fill-rule","evenodd"),E(s,"width","2rem"),E(s,"height","2rem"),E(s,"position","absolute"),E(s,"transform","translate(-0.5rem, -0.5rem)"),E(s,"stroke","#eee"),S(s,"viewBox","0 0 24 24"),S(s,"xmlns","http://www.w3.org/2000/svg"),E(r,"width","1.0rem"),E(r,"height","1rem"),E(r,"position","relative"),S(n,"class","TranscriptItem")},m(t,e){y(t,n,e),w(n,o),w(n,i),w(n,r),w(r,s),w(s,c)},p(t,e){32&e[0]&&E(o,"background-color",t[5])},i(t){l||V((()=>{l=nt(c,e[17],{duration:500}),l.start()})),a||V((()=>{a=nt(n,e[19],{duration:200,maxWidth:3}),a.start()}))},o:t,d(t){t&&v(n)}}}function Bt(e){let n,o,i,s,c,l,a=e[11]&&Tt(e);return{c(){n=x("main"),a&&a.c(),o=_(),i=x("link"),this.c=t,E(n,"--voffset",e[1]),E(n,"--hoffset",e[2]),E(n,"--fontsize",e[3]),E(n,"--color",e[4]),E(n,"--highlight-color",e[5]),E(n,"--text-bg-color",e[6]),E(n,"--gradient-stop1",e[7]),E(n,"--gradient-stop2",e[8]),E(n,"--marginbottom",e[9]),E(n,"--transition",e[15].transition),N(n,"placementTop","top"===e[0]),S(i,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),S(i,"rel","stylesheet")},m(t,r){var d,u,f,h;y(t,n,r),a&&a.m(n,null),y(t,o,r),w(document.head,i),s=!0,c||(d=Et,u="message",f=e[20],d.addEventListener(u,f,h),l=()=>d.removeEventListener(u,f,h),c=!0)},p(t,e){t[11]?a?(a.p(t,e),2048&e[0]&&Z(a,1)):(a=Tt(t),a.c(),Z(a,1),a.m(n,null)):a&&(Y={r:0,c:[],p:Y},tt(a,1,1,(()=>{a=null})),Y.r||r(Y.c),Y=Y.p),(!s||2&e[0])&&E(n,"--voffset",t[1]),(!s||4&e[0])&&E(n,"--hoffset",t[2]),(!s||8&e[0])&&E(n,"--fontsize",t[3]),(!s||16&e[0])&&E(n,"--color",t[4]),(!s||32&e[0])&&E(n,"--highlight-color",t[5]),(!s||64&e[0])&&E(n,"--text-bg-color",t[6]),(!s||128&e[0])&&E(n,"--gradient-stop1",t[7]),(!s||256&e[0])&&E(n,"--gradient-stop2",t[8]),(!s||512&e[0])&&E(n,"--marginbottom",t[9]),(!s||32768&e[0])&&E(n,"--transition",t[15].transition),1&e[0]&&N(n,"placementTop","top"===t[0])},i(t){s||(Z(a),s=!0)},o(t){tt(a),s=!1},d(t){t&&v(n),a&&a.d(),t&&v(o),v(i),c=!1,l()}}}function Mt(t,e,n){let o,i,r,{placement:s}=e,{voffset:c="3rem"}=e,{hoffset:l="2rem"}=e,{fontsize:a="1.5rem"}=e,{color:u="#ffffff"}=e,{highlightcolor:f="#15e8b5"}=e,{backgroundcolor:h="#202020"}=e,{gradientstop1:g="#ffffff88"}=e,{gradientstop2:p="#ffffffcc"}=e,{marginbottom:m="0rem"}=e,$=[],b=!1,w=null,y=null,v=gt.ClientState.Disconnected,x=!1,k=!1,C=!1,_=St({transition:0},{duration:200});d(t,_,(t=>n(15,i=t)));const S=A(),E=pt($t),N=pt(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:mt,css:t=>`\n opacity: ${wt(bt,t,0,1)};\n max-height: ${10*wt(bt,t,0,.6)}rem;\n `}))),T=pt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${wt(bt,t,0,1)*o}rem;\n `}))),P=()=>{b=!0},z=()=>{b=!1},R=t=>{t&&n(13,C=!0)},D=t=>{n(27,v=t),v===gt.ClientState.Recording&&(n(13,C=!1),n(10,$=[]),y=null)},B=t=>{if(void 0===t)return;r&&b&&r.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?M($.length>0?2e3:0):$.length>0&&(x||n(28,x=!0),M(2e3));const e=`${t.contextId}/${t.id}`;null!==y?y!==e&&(n(13,C=!1),y=e):y=e,n(10,$=[]),t.words.forEach((t=>{n(10,$[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},$)})),t.entities.forEach((t=>{n(10,$[t.startPosition].word=t.value,$),n(10,$[t.startPosition].entityType=t.type,$),n(10,$[t.startPosition].isFinal=t.isFinal,$),n(10,$[t.startPosition].hide=!1,$);for(let e=t.startPosition+1;e<t.endPosition;e++)$[e]&&n(10,$[e].hide=!0,$)})),n(10,$=$.filter((t=>!t.hide)))},M=(t=0)=>{I(),w=window.setTimeout((()=>{w=null,x&&n(28,x=!1)}),t)},I=()=>{null!==w&&(window.clearTimeout(w),w=null)};return t.$$set=t=>{"placement"in t&&n(0,s=t.placement),"voffset"in t&&n(1,c=t.voffset),"hoffset"in t&&n(2,l=t.hoffset),"fontsize"in t&&n(3,a=t.fontsize),"color"in t&&n(4,u=t.color),"highlightcolor"in t&&n(5,f=t.highlightcolor),"backgroundcolor"in t&&n(6,h=t.backgroundcolor),"gradientstop1"in t&&n(7,g=t.gradientstop1),"gradientstop2"in t&&n(8,p=t.gradientstop2),"marginbottom"in t&&n(9,m=t.marginbottom)},t.$$.update=()=>{if(1024&t.$$.dirty[0]&&n(14,o=0===$.length),402655232&t.$$.dirty[0]){const t=v===gt.ClientState.Recording||x;t!==k&&(e="visibilitychanged",i=t,S.dispatchEvent(new CustomEvent(e,{detail:i,composed:!0}))),n(11,k=t),_.set({transition:k?1:0})}var e,i},[s,c,l,a,u,f,h,g,p,m,$,k,r,C,o,i,_,E,N,T,t=>{switch(t.data.type){case"speechsegment":B(t.data.segment);break;case"holdstart":P();break;case"holdend":z();break;case"speechhandled":R(t.data.success);break;case"speechstate":D(t.data.state)}},t=>t.entityType||"",P,z,R,D,B,v,x,function(t){F[t?"unshift":"push"]((()=>{r=t,n(12,r)}))}]}class At extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.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}.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:T(this.attributes),customElement:!0},Mt,Bt,l,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,holdstart:22,holdend:23,speechhandled:24,speechstate:25,speechsegment:26},[-1,-1]),t&&(t.target&&y(t.target,this,t.anchor),t.props&&(this.$set(t.props),W()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","holdstart","holdend","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),W()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),W()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),W()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),W()}get color(){return this.$$.ctx[4]}set color(t){this.$set({color:t}),W()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),W()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),W()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),W()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),W()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$set({marginbottom:t}),W()}get holdstart(){return this.$$.ctx[22]}get holdend(){return this.$$.ctx[23]}get speechhandled(){return this.$$.ctx[24]}get speechstate(){return this.$$.ctx[25]}get speechsegment(){return this.$$.ctx[26]}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",At)}(); | ||
//# sourceMappingURL=big-transcript.js.map |
@@ -1,2 +0,2 @@ | ||
!function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(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 s(t){return 0===Object.keys(t).length}let a=!1;const l=new Set;function u(t,e){a&&l.delete(e),e.parentNode!==t&&t.appendChild(e)}function d(t,e,n){a&&l.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function f(t){a?l.add(t):t.parentNode&&t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function g(){return t=" ",document.createTextNode(t);var t}function m(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 v(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}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 x(){if(!b)throw new Error("Function called outside component initialization");return b}const C=[],k=[],N=[],S=[],E=Promise.resolve();let M=!1;function _(t){N.push(t)}let z=!1;const B=new Set;function D(){if(!z){z=!0;do{for(let t=0;t<C.length;t+=1){const e=C[t];y(e),L(e.$$)}for(y(null),C.length=0;k.length;)k.pop()();for(let t=0;t<N.length;t+=1){const e=N[t];B.has(e)||(B.add(e),e())}N.length=0}while(C.length);for(;S.length;)S.pop()();M=!1,z=!1,B.clear()}}function L(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(_)}}const P=new Set;function F(t,e){t&&t.i&&(P.delete(t),t.i(e))}function A(t,e,n,o){if(t&&t.o){if(P.has(t))return;P.add(t),undefined.c.push((()=>{P.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const R="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function I(t){t&&t.c()}function H(t,n,r,c){const{fragment:s,on_mount:a,on_destroy:l,after_update:u}=t.$$;s&&s.m(n,r),c||_((()=>{const n=a.map(e).filter(i);l?l.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(_)}function T(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 V(t,e){-1===t.$$.dirty[0]&&(C.push(t),M||(M=!0,E.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function j(e,i,r,c,s,u,d=[-1]){const p=b;y(e);const h=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(p?p.$$.context:i.context||[]),callbacks:n(),dirty:d,skip_bound:!1};let g=!1;if(h.ctx=r?r(e,i.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&s(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),g&&V(e,t)),n})):[],h.update(),g=!0,o(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){a=!0;const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(f)}else h.fragment&&h.fragment.c();i.intro&&F(e.$$.fragment),H(e,i.target,i.anchor,i.customElement),function(){a=!1;for(const t of l)t.parentNode.removeChild(t);l.clear()}(),D()}y(p)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class G{$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function q(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("g"),a=h("path"),l=h("path"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","0%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"d","M46 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(a,"fill","#FFF"),$(l,"d","M46 0C20.595 0 0 20.595 0 46s20.595 46 46 46 46-20.595 46-46S71.405 0 46 0zm0 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(l,"fill","url(#a)"),$(s,"fill","none"),$(s,"fillrule","nonzero"),$(n,"class","buttonFrameEl"),$(n,"viewBox","0 0 92 92"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"position","absolute"),v(n,"width","100%"),v(n,"height","100%"),v(n,"pointer-events","none"),v(n,"user-select","none"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(n,s),u(s,a),u(s,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class U extends G{constructor(t){super(),j(this,t,null,q,c,{})}}var J,K,Q,W,X,Y=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(J={exports:{}},J.exports),J.exports);!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(K||(K={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(Q||(Q={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(W||(W={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(X||(X={}));const Z={[Y.ClientState.Disconnected]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[Y.ClientState.Disconnecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connected]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Starting]:{icon:Q.Mic,behaviour:W.Hold,effect:X.Connecting},[Y.ClientState.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Stopping]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[Y.ClientState.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None},[K.Idle]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[K.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[K.Ready]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Loading]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[K.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None}};function tt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(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"),$(i,"x","20"),$(i,"y","1"),$(i,"width","16"),$(i,"height","37"),$(i,"rx","8"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function et(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(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"),$(o,"fill-rule","nonzero"),$(i,"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"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function nt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(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"),$(i,"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"),$(n,"fill","#000"),$(n,"fill-rule","nonzero"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function ot(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(o,"d","M52 28c0 13.255-10.745 24-24 24S4 41.255 4 28c0-8.921 4.867-16.705 12.091-20.842l1.984 3.474C12.055 14.08 8 20.566 8 28c0 11.046 8.954 20 20 20s20-8.954 20-20c0-7.434-4.056-13.92-10.075-17.368L39.91 7.16C47.133 11.296 52 19.079 52 28z"),$(o,"fill-rule","nonzero"),$(i,"x","24"),$(i,"y","1"),$(i,"width","8"),$(i,"height","23"),$(i,"rx","4"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function it(e){let n,o,i,r,c=e[0]===Q.Mic&&tt(),s=e[0]===Q.Error&&et(),a=e[0]===Q.Denied&&nt(),l=e[0]===Q.Poweron&&ot();return{c(){n=p("div"),c&&c.c(),o=g(),s&&s.c(),i=g(),a&&a.c(),r=g(),l&&l.c(),v(n,"position","absolute"),v(n,"width","60%"),v(n,"height","60%"),v(n,"top","50%"),v(n,"left","50%"),v(n,"transform","translate(-50%, -50%)"),v(n,"pointer-events","none"),v(n,"transition","0.25s"),v(n,"opacity","var(--icon-opacity)")},m(t,e){d(t,n,e),c&&c.m(n,null),u(n,o),s&&s.m(n,null),u(n,i),a&&a.m(n,null),u(n,r),l&&l.m(n,null)},p(t,[e]){t[0]===Q.Mic?c||(c=tt(),c.c(),c.m(n,o)):c&&(c.d(1),c=null),t[0]===Q.Error?s||(s=et(),s.c(),s.m(n,i)):s&&(s.d(1),s=null),t[0]===Q.Denied?a||(a=nt(),a.c(),a.m(n,r)):a&&(a.d(1),a=null),t[0]===Q.Poweron?l||(l=ot(),l.c(),l.m(n,null)):l&&(l.d(1),l=null)},i:t,o:t,d(t){t&&f(n),c&&c.d(),s&&s.d(),a&&a.d(),l&&l.d()}}}function rt(t,e,n){let{icon:o=Q.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class ct extends G{constructor(t){super(),j(this,t,rt,it,r,{icon:0})}}function st(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("filter"),a=h("feGaussianBlur"),l=h("circle"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","10%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"stdDeviation","18"),$(a,"in","SourceGraphic"),$(s,"x","-35%"),$(s,"y","-35%"),$(s,"width","170%"),$(s,"height","170%"),$(s,"filterUnits","objectBoundingBox"),$(s,"id","b"),$(l,"filter","url(#b)"),$(l,"cx","124"),$(l,"cy","124"),$(l,"r","79"),$(l,"fill","url(#a)"),$(l,"fillrule","evenodd"),$(n,"viewBox","0 0 246 246"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"top","-75%"),v(n,"left","-75%"),v(n,"height","250%"),v(n,"width","250%"),v(n,"position","absolute"),v(n,"pointer-events","none"),v(n,"opacity","var(--fx-opacity)"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(o,s),u(s,a),u(n,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class at extends G{constructor(t){super(),j(this,t,null,st,r,{})}}const{window:lt}=R;function ut(e){let n,i,r,c,s,a,l,h,w,b,y,x;return r=new at({}),s=new U({}),l=new ct({props:{icon:e[7].icon}}),{c(){n=p("main"),i=p("div"),I(r.$$.fragment),c=g(),I(s.$$.fragment),a=g(),I(l.$$.fragment),h=g(),w=p("slot"),this.c=t,$(i,"class","ButtonComponents"),v(i,"transform","scale("+e[4][1]+")"),v(n,"width",e[0]),v(n,"height",e[0]),v(n,"--gradient-stop1",e[1]),v(n,"--gradient-stop2",e[2]),v(n,"--fx-rotation",e[3][1]+"deg"),v(n,"--fx-opacity",e[6][1]),v(n,"--icon-opacity",e[5][1])},m(t,o){d(t,n,o),u(n,i),H(r,i,null),u(i,c),H(s,i,null),u(i,a),H(l,i,null),u(n,h),u(n,w),b=!0,y||(x=[m(lt,"mouseup",e[9]),m(lt,"keydown",e[10]),m(lt,"keyup",e[11]),m(n,"mousedown",e[8]),m(n,"touchstart",e[8]),m(n,"dragstart",e[8]),m(n,"mouseup",e[9]),m(n,"touchend",e[9],{passive:!0}),m(n,"dragend",e[9])],y=!0)},p(t,[e]){const o={};128&e&&(o.icon=t[7].icon),l.$set(o),(!b||16&e)&&v(i,"transform","scale("+t[4][1]+")"),(!b||1&e)&&v(n,"width",t[0]),(!b||1&e)&&v(n,"height",t[0]),(!b||2&e)&&v(n,"--gradient-stop1",t[1]),(!b||4&e)&&v(n,"--gradient-stop2",t[2]),(!b||8&e)&&v(n,"--fx-rotation",t[3][1]+"deg"),(!b||64&e)&&v(n,"--fx-opacity",t[6][1]),(!b||32&e)&&v(n,"--icon-opacity",t[5][1])},i(t){b||(F(r.$$.fragment,t),F(s.$$.fragment,t),F(l.$$.fragment,t),b=!0)},o(t){A(r.$$.fragment,t),A(s.$$.fragment,t),A(l.$$.fragment,t),b=!1},d(t){t&&f(n),T(r),T(s),T(l),y=!1,o(x)}}}function dt(t,e,n){let o,{icon:i=K.Idle}=e,{capturekey:r=" "}=e,{size:c="6rem"}=e,{gradientstop1:s="#15e8b5"}=e,{gradientstop2:a="#4fa1f9"}=e,{hide:l}=e,u=!1,d=0,f=[0,0],p=[0,0],h=[1,1],g=[0,0],m=Z[i],$=null,v=0,w=0;const b=x(),y=(t,e)=>{b.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};!function(t){x().$$.on_mount.push(t)}((()=>{n(4,p=[1,0]);let t=null;const e=()=>{v=w,w=(new Date).getTime();const i=w-(v||w);m.effect===X.Connecting&&n(5,h[0]=.25*Math.cos(w/2500*Math.PI*2)+.25,h),m.effect===X.Busy&&n(5,h[0]=.25*Math.cos(w/1e3*Math.PI*2)+.25,h),n(4,p=[p[0],N(p[1],o?p[0]:0,.2,i)]),n(5,h=[h[0],N(h[1],h[0],.08,i)]),n(6,g=[g[0],N(g[1],g[0],.08,i)]),n(3,f=[f[0]+2.5,N(f[1],f[0],.05,i)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)}));const C=t=>{t.preventDefault(),t.stopPropagation(),o&&!u&&(n(15,u=!0),d=Date.now(),n(4,p[0]=1.35,p),n(6,g[0]=1,g),S(),m.behaviour===W.Click&&(n(3,f[0]+=720,f),null===$&&($=window.setTimeout((()=>{n(6,g[0]=0,g),$=null}),500))),b.onholdstart&&b.onholdstart(),y("holdstart"))},k=()=>{if(u){n(4,p[0]=1,p),n(6,g[0]=0,g),n(15,u=!1);const t={timeMs:Date.now()-d};S(),null!==$&&window.clearTimeout($),b.onholdend&&b.onholdend(t),y("holdend",t)}},N=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,S=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(12,i=t.icon),"capturekey"in t&&n(13,r=t.capturekey),"size"in t&&n(0,c=t.size),"gradientstop1"in t&&n(1,s=t.gradientstop1),"gradientstop2"in t&&n(2,a=t.gradientstop2),"hide"in t&&n(14,l=t.hide)},t.$$.update=()=>{16384&t.$$.dirty&&(o=void 0===l||"false"===l),36864&t.$$.dirty&&(u||(t=>{if(m!==t)switch(n(7,m=t),t.icon){case Q.Mic:case Q.Denied:case Q.Error:n(5,h[0]=1,h)}})(Z[i]))},[c,s,a,f,p,h,g,m,C,k,t=>{r&&(t.key===r&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):C(t))))},t=>{t.key===r&&k()},i,r,l,u]}class ft extends O{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{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}.ButtonComponents{width:100%;height:100%}</style>",j(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},dt,ut,c,{icon:12,capturekey:13,size:0,gradientstop1:1,gradientstop2:2,hide:14}),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),D()))}static get observedAttributes(){return["icon","capturekey","size","gradientstop1","gradientstop2","hide"]}get icon(){return this.$$.ctx[12]}set icon(t){this.$set({icon:t}),D()}get capturekey(){return this.$$.ctx[13]}set capturekey(t){this.$set({capturekey:t}),D()}get size(){return this.$$.ctx[0]}set size(t){this.$set({size:t}),D()}get gradientstop1(){return this.$$.ctx[1]}set gradientstop1(t){this.$set({gradientstop1:t}),D()}get gradientstop2(){return this.$$.ctx[2]}set gradientstop2(t){this.$set({gradientstop2:t}),D()}get hide(){return this.$$.ctx[14]}set hide(t){this.$set({hide:t}),D()}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",ft)}(); | ||
!function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function i(t){return"function"==typeof t}function r(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 s(t){return 0===Object.keys(t).length}let a=!1;const l=new Set;function u(t,e){a&&l.delete(e),e.parentNode!==t&&t.appendChild(e)}function d(t,e,n){a&&l.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function f(t){a?l.add(t):t.parentNode&&t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function g(){return t=" ",document.createTextNode(t);var t}function m(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 v(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}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 x(){if(!b)throw new Error("Function called outside component initialization");return b}const C=[],k=[],N=[],S=[],E=Promise.resolve();let M=!1;function _(t){N.push(t)}let z=!1;const B=new Set;function D(){if(!z){z=!0;do{for(let t=0;t<C.length;t+=1){const e=C[t];y(e),L(e.$$)}for(y(null),C.length=0;k.length;)k.pop()();for(let t=0;t<N.length;t+=1){const e=N[t];B.has(e)||(B.add(e),e())}N.length=0}while(C.length);for(;S.length;)S.pop()();M=!1,z=!1,B.clear()}}function L(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(_)}}const P=new Set;function F(t,e){t&&t.i&&(P.delete(t),t.i(e))}function A(t,e,n,o){if(t&&t.o){if(P.has(t))return;P.add(t),undefined.c.push((()=>{P.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const R="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function I(t){t&&t.c()}function H(t,n,r,c){const{fragment:s,on_mount:a,on_destroy:l,after_update:u}=t.$$;s&&s.m(n,r),c||_((()=>{const n=a.map(e).filter(i);l?l.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(_)}function T(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 V(t,e){-1===t.$$.dirty[0]&&(C.push(t),M||(M=!0,E.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function j(e,i,r,c,s,u,d=[-1]){const p=b;y(e);const h=e.$$={fragment:null,ctx:null,props:u,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(p?p.$$.context:i.context||[]),callbacks:n(),dirty:d,skip_bound:!1};let g=!1;if(h.ctx=r?r(e,i.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return h.ctx&&s(h.ctx[t],h.ctx[t]=i)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](i),g&&V(e,t)),n})):[],h.update(),g=!0,o(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){a=!0;const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(f)}else h.fragment&&h.fragment.c();i.intro&&F(e.$$.fragment),H(e,i.target,i.anchor,i.customElement),function(){a=!1;for(const t of l)t.parentNode.removeChild(t);l.clear()}(),D()}y(p)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class G{$destroy(){T(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!s(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function q(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("g"),a=h("path"),l=h("path"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","0%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"d","M46 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(a,"fill","#FFF"),$(l,"d","M46 0C20.595 0 0 20.595 0 46s20.595 46 46 46 46-20.595 46-46S71.405 0 46 0zm0 3.119c23.683 0 42.881 19.198 42.881 42.881S69.683 88.881 46 88.881 3.119 69.683 3.119 46 22.317 3.119 46 3.119z"),$(l,"fill","url(#a)"),$(s,"fill","none"),$(s,"fillrule","nonzero"),$(n,"class","buttonFrameEl"),$(n,"viewBox","0 0 92 92"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"position","absolute"),v(n,"width","100%"),v(n,"height","100%"),v(n,"pointer-events","none"),v(n,"user-select","none"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(n,s),u(s,a),u(s,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class U extends G{constructor(t){super(),j(this,t,null,q,r,{})}}var J,K,Q,W,X,Y=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(J={exports:{}},J.exports),J.exports);!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(K||(K={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(Q||(Q={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(W||(W={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(X||(X={}));const Z={[Y.ClientState.Disconnected]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[Y.ClientState.Disconnecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[Y.ClientState.Connected]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Starting]:{icon:Q.Mic,behaviour:W.Hold,effect:X.Connecting},[Y.ClientState.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[Y.ClientState.Stopping]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[Y.ClientState.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[Y.ClientState.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None},[K.Idle]:{icon:Q.Poweron,behaviour:W.Click,effect:X.None},[K.Connecting]:{icon:Q.Poweron,behaviour:W.Noninteractive,effect:X.Connecting},[K.Ready]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Recording]:{icon:Q.Mic,behaviour:W.Hold,effect:X.None},[K.Loading]:{icon:Q.Mic,behaviour:W.Noninteractive,effect:X.Busy},[K.Failed]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoBrowserSupport]:{icon:Q.Error,behaviour:W.Click,effect:X.None},[K.NoAudioConsent]:{icon:Q.Denied,behaviour:W.Click,effect:X.None}};function tt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(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"),$(i,"x","20"),$(i,"y","1"),$(i,"width","16"),$(i,"height","37"),$(i,"rx","8"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function et(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(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"),$(o,"fill-rule","nonzero"),$(i,"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"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function nt(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("path"),$(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"),$(i,"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"),$(n,"fill","#000"),$(n,"fill-rule","nonzero"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function ot(t){let e,n,o,i;return{c(){e=h("svg"),n=h("g"),o=h("path"),i=h("rect"),$(o,"d","M52 28c0 13.255-10.745 24-24 24S4 41.255 4 28c0-8.921 4.867-16.705 12.091-20.842l1.984 3.474C12.055 14.08 8 20.566 8 28c0 11.046 8.954 20 20 20s20-8.954 20-20c0-7.434-4.056-13.92-10.075-17.368L39.91 7.16C47.133 11.296 52 19.079 52 28z"),$(o,"fill-rule","nonzero"),$(i,"x","24"),$(i,"y","1"),$(i,"width","8"),$(i,"height","23"),$(i,"rx","4"),$(n,"fill","#000"),$(n,"fill-rule","evenodd"),$(e,"class","buttonIconEl"),$(e,"viewBox","0 0 56 56"),$(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){d(t,e,r),u(e,n),u(n,o),u(n,i)},d(t){t&&f(e)}}}function it(e){let n,o,i,r,c=e[0]===Q.Mic&&tt(),s=e[0]===Q.Error&&et(),a=e[0]===Q.Denied&&nt(),l=e[0]===Q.Poweron&&ot();return{c(){n=p("div"),c&&c.c(),o=g(),s&&s.c(),i=g(),a&&a.c(),r=g(),l&&l.c(),v(n,"position","absolute"),v(n,"width","60%"),v(n,"height","60%"),v(n,"top","50%"),v(n,"left","50%"),v(n,"transform","translate(-50%, -50%)"),v(n,"pointer-events","none"),v(n,"transition","0.25s"),v(n,"opacity","var(--icon-opacity)")},m(t,e){d(t,n,e),c&&c.m(n,null),u(n,o),s&&s.m(n,null),u(n,i),a&&a.m(n,null),u(n,r),l&&l.m(n,null)},p(t,[e]){t[0]===Q.Mic?c||(c=tt(),c.c(),c.m(n,o)):c&&(c.d(1),c=null),t[0]===Q.Error?s||(s=et(),s.c(),s.m(n,i)):s&&(s.d(1),s=null),t[0]===Q.Denied?a||(a=nt(),a.c(),a.m(n,r)):a&&(a.d(1),a=null),t[0]===Q.Poweron?l||(l=ot(),l.c(),l.m(n,null)):l&&(l.d(1),l=null)},i:t,o:t,d(t){t&&f(n),c&&c.d(),s&&s.d(),a&&a.d(),l&&l.d()}}}function rt(t,e,n){let{icon:o=Q.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class ct extends G{constructor(t){super(),j(this,t,rt,it,r,{icon:0})}}function st(e){let n,o,i,r,c,s,a,l;return{c(){n=h("svg"),o=h("defs"),i=h("linearGradient"),r=h("stop"),c=h("stop"),s=h("filter"),a=h("feGaussianBlur"),l=h("circle"),$(r,"stop-color","var(--gradient-stop1)"),$(r,"offset","0%"),$(c,"stop-color","var(--gradient-stop2)"),$(c,"offset","100%"),$(i,"x1","50%"),$(i,"y1","10%"),$(i,"x2","50%"),$(i,"y2","100%"),$(i,"id","a"),$(a,"stdDeviation","18"),$(a,"in","SourceGraphic"),$(s,"x","-35%"),$(s,"y","-35%"),$(s,"width","170%"),$(s,"height","170%"),$(s,"filterUnits","objectBoundingBox"),$(s,"id","b"),$(l,"filter","url(#b)"),$(l,"cx","124"),$(l,"cy","124"),$(l,"r","79"),$(l,"fill","url(#a)"),$(l,"fillrule","evenodd"),$(n,"viewBox","0 0 246 246"),$(n,"xmlns","http://www.w3.org/2000/svg"),v(n,"top","-75%"),v(n,"left","-75%"),v(n,"height","250%"),v(n,"width","250%"),v(n,"position","absolute"),v(n,"pointer-events","none"),v(n,"opacity","var(--fx-opacity)"),v(n,"transform","rotate(var(--fx-rotation))")},m(t,e){d(t,n,e),u(n,o),u(o,i),u(i,r),u(i,c),u(o,s),u(s,a),u(n,l)},p:t,i:t,o:t,d(t){t&&f(n)}}}class at extends G{constructor(t){super(),j(this,t,null,st,r,{})}}const{window:lt}=R;function ut(e){let n,i,r,c,s,a,l,h,w,b,y,x;return r=new at({}),s=new U({}),l=new ct({props:{icon:e[7].icon}}),{c(){n=p("main"),i=p("div"),I(r.$$.fragment),c=g(),I(s.$$.fragment),a=g(),I(l.$$.fragment),h=g(),w=p("slot"),this.c=t,$(i,"class","ButtonComponents"),v(i,"transform","scale("+e[4][1]+")"),v(n,"width",e[0]),v(n,"height",e[0]),v(n,"--gradient-stop1",e[1]),v(n,"--gradient-stop2",e[2]),v(n,"--fx-rotation",e[3][1]+"deg"),v(n,"--fx-opacity",e[6][1]),v(n,"--icon-opacity",e[5][1])},m(t,o){d(t,n,o),u(n,i),H(r,i,null),u(i,c),H(s,i,null),u(i,a),H(l,i,null),u(n,h),u(n,w),b=!0,y||(x=[m(lt,"mouseup",e[9]),m(lt,"keydown",e[10]),m(lt,"keyup",e[11]),m(n,"mousedown",e[8]),m(n,"touchstart",e[8]),m(n,"dragstart",e[8]),m(n,"mouseup",e[9]),m(n,"touchend",e[9],{passive:!0}),m(n,"dragend",e[9])],y=!0)},p(t,[e]){const o={};128&e&&(o.icon=t[7].icon),l.$set(o),(!b||16&e)&&v(i,"transform","scale("+t[4][1]+")"),(!b||1&e)&&v(n,"width",t[0]),(!b||1&e)&&v(n,"height",t[0]),(!b||2&e)&&v(n,"--gradient-stop1",t[1]),(!b||4&e)&&v(n,"--gradient-stop2",t[2]),(!b||8&e)&&v(n,"--fx-rotation",t[3][1]+"deg"),(!b||64&e)&&v(n,"--fx-opacity",t[6][1]),(!b||32&e)&&v(n,"--icon-opacity",t[5][1])},i(t){b||(F(r.$$.fragment,t),F(s.$$.fragment,t),F(l.$$.fragment,t),b=!0)},o(t){A(r.$$.fragment,t),A(s.$$.fragment,t),A(l.$$.fragment,t),b=!1},d(t){t&&f(n),T(r),T(s),T(l),y=!1,o(x)}}}function dt(t,e,n){let o,{icon:i=K.Idle}=e,{capturekey:r=" "}=e,{size:c="6rem"}=e,{gradientstop1:s="#15e8b5"}=e,{gradientstop2:a="#4fa1f9"}=e,{hide:l}=e,u=!1,d=0,f=[0,0],p=[0,0],h=[1,1],g=[0,0],m=Z[i],$=null,v=0,w=0;const b=x(),y=(t,e)=>{b.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};!function(t){x().$$.on_mount.push(t)}((()=>{n(4,p=[1,0]);let t=null;const e=()=>{v=w,w=(new Date).getTime();const i=w-(v||w);m.effect===X.Connecting&&n(5,h[0]=.25*Math.cos(w/2500*Math.PI*2)+.25,h),m.effect===X.Busy&&n(5,h[0]=.25*Math.cos(w/1e3*Math.PI*2)+.25,h),n(4,p=[p[0],N(p[1],o?p[0]:0,.2,i)]),n(5,h=[h[0],N(h[1],h[0],.08,i)]),n(6,g=[g[0],N(g[1],g[0],.08,i)]),n(3,f=[f[0]+2.5,N(f[1],f[0],.05,i)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)}));const C=t=>{t.preventDefault(),t.stopPropagation(),o&&!u&&(n(15,u=!0),d=Date.now(),n(4,p[0]=1.35,p),n(6,g[0]=1,g),S(),m.behaviour===W.Click&&(n(3,f[0]+=720,f),null===$&&($=window.setTimeout((()=>{n(6,g[0]=0,g),$=null}),500))),b.onholdstart&&b.onholdstart(),y("holdstart"))},k=()=>{if(u){n(4,p[0]=1,p),n(6,g[0]=0,g),n(15,u=!1);const t={timeMs:Date.now()-d};S(),null!==$&&window.clearTimeout($),b.onholdend&&b.onholdend(t),y("holdend",t)}},N=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,S=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(12,i=t.icon),"capturekey"in t&&n(13,r=t.capturekey),"size"in t&&n(0,c=t.size),"gradientstop1"in t&&n(1,s=t.gradientstop1),"gradientstop2"in t&&n(2,a=t.gradientstop2),"hide"in t&&n(14,l=t.hide)},t.$$.update=()=>{16384&t.$$.dirty&&(o=void 0===l||"false"===l),36864&t.$$.dirty&&(u||(t=>{if(m!==t)switch(n(7,m=t),t.icon){case Q.Mic:case Q.Denied:case Q.Error:n(5,h[0]=1,h)}})(Z[i]))},[c,s,a,f,p,h,g,m,C,k,t=>{r&&(t.key===r&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):C(t))))},t=>{t.key===r&&k()},i,r,l,u]}class ft extends O{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{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}.ButtonComponents{width:100%;height:100%}</style>",j(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},dt,ut,c,{icon:12,capturekey:13,size:0,gradientstop1:1,gradientstop2:2,hide:14}),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),D()))}static get observedAttributes(){return["icon","capturekey","size","gradientstop1","gradientstop2","hide"]}get icon(){return this.$$.ctx[12]}set icon(t){this.$set({icon:t}),D()}get capturekey(){return this.$$.ctx[13]}set capturekey(t){this.$set({capturekey:t}),D()}get size(){return this.$$.ctx[0]}set size(t){this.$set({size:t}),D()}get gradientstop1(){return this.$$.ctx[1]}set gradientstop1(t){this.$set({gradientstop1:t}),D()}get gradientstop2(){return this.$$.ctx[2]}set gradientstop2(t){this.$set({gradientstop2:t}),D()}get hide(){return this.$$.ctx[14]}set hide(t){this.$set({hide:t}),D()}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",ft)}(); | ||
//# sourceMappingURL=holdable-button.js.map |
{ | ||
"name": "@speechly/browser-ui", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "**/*" |
@@ -1,2 +0,2 @@ | ||
!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 i(){return Object.create(null)}function r(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 l(t,e){return t!=t?e==e:t!==e}function a(t){return 0===Object.keys(t).length}function u(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 d="undefined"!=typeof window;let f=d?()=>window.performance.now():()=>Date.now(),h=d?t=>requestAnimationFrame(t):t;const g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&h(p)}function m(t){let e;return 0===g.size&&h(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}let y=!1;const $=new Set;function b(t,e){y&&$.delete(e),e.parentNode!==t&&t.appendChild(e)}function w(t,e,n){y&&$.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function v(t){y?$.add(t):t.parentNode&&t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function C(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t){return document.createTextNode(t)}function E(){return k(" ")}function _(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function S(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function N(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:S(t,e,n)}function T(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function P(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function z(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 A=new Set;let D,M=0;function B(t,e,n,o,i,r,s,c=0){const l=16.666/o;let a="{\n";for(let t=0;t<=1;t+=l){const o=e+(n-e)*r(t);a+=100*t+`%{${s(o,1-o)}}\n`}const u=a+`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}`,f=t.ownerDocument;A.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=f.head.appendChild(x("style")).sheet),g=f.__svelte_rules||(f.__svelte_rules={});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 ${i}ms 1 both`,M+=1,d}function I(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),M-=i,M||h((()=>{M||(A.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),A.clear())})))}function F(t){D=t}function L(){if(!D)throw new Error("Function called outside component initialization");return D}function j(t){L().$$.on_mount.push(t)}const O=[],H=[],V=[],U=[],q=Promise.resolve();let W=!1;function G(t){V.push(t)}let J=!1;const K=new Set;function Q(){if(!J){J=!0;do{for(let t=0;t<O.length;t+=1){const e=O[t];F(e),X(e.$$)}for(F(null),O.length=0;H.length;)H.pop()();for(let t=0;t<V.length;t+=1){const e=V[t];K.has(e)||(K.add(e),e())}V.length=0}while(O.length);for(;U.length;)U.pop()();W=!1,J=!1,K.clear()}}function X(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(G)}}let Y;function Z(){return Y||(Y=Promise.resolve(),Y.then((()=>{Y=null}))),Y}function tt(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const et=new Set;let nt;function ot(t,e){t&&t.i&&(et.delete(t),t.i(e))}function it(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)}}const rt={duration:0};function st(n,o,i){let r,c,l=o(n,i),a=!1,u=0;function d(){r&&I(n,r)}function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:g}=l||rt;g&&(r=B(n,0,1,i,o,s,g,u++)),h(0,1);const p=f()+o,y=p+i;c&&c.abort(),a=!0,G((()=>tt(n,!0,"start"))),c=m((t=>{if(a){if(t>=y)return h(1,0),tt(n,!0,"end"),d(),a=!1;if(t>=p){const e=s((t-p)/i);h(e,1-e)}}return a}))}let g=!1;return{start(){g||(I(n),s(l)?(l=l(),Z().then(h)):h())},invalidate(){g=!1},end(){a&&(d(),a=!1)}}}const ct="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function lt(t,e,n,i){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),i||G((()=>{const e=l.map(o).filter(s);a?a.push(...e):r(e),t.$$.on_mount=[]})),u.forEach(G)}function at(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 ut(t,e){-1===t.$$.dirty[0]&&(O.push(t),W||(W=!0,q.then(Q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dt(e,n,o,s,c,l,a=[-1]){const u=D;F(e);const d=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:n.context||[]),callbacks:i(),dirty:a,skip_bound:!1};let f=!1;if(d.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return d.ctx&&c(d.ctx[t],d.ctx[t]=i)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](i),f&&ut(e,t)),n})):[],d.update(),f=!0,r(d.before_update),d.fragment=!!s&&s(d.ctx),n.target){if(n.hydrate){y=!0;const t=function(t){return Array.from(t.childNodes)}(n.target);d.fragment&&d.fragment.l(t),t.forEach(v)}else d.fragment&&d.fragment.c();n.intro&&ot(e.$$.fragment),lt(e,n.target,n.anchor,n.customElement),function(){y=!1;for(const t of $)t.parentNode.removeChild(t);$.clear()}(),Q()}F(u)}let ft;"function"==typeof HTMLElement&&(ft=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(){r(this.$$.on_disconnect)}$destroy(){at(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function ht(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function gt(t){return t*t*t}function pt(t){const e=t-1;return e*e*e+1}const mt=[];function yt(t){return"[object Date]"===Object.prototype.toString.call(t)}function $t(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)=>$t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(yt(t)&&yt(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]=$t(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,i={}){const r=function(e,n=t){let o;const i=[];function r(t){if(c(e,t)&&(e=t,o)){const t=!mt.length;for(let t=0;t<i.length;t+=1){const n=i[t];n[1](),mt.push(n,e)}if(t){for(let t=0;t<mt.length;t+=2)mt[t][0](mt[t+1]);mt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const l=[s,c];return i.push(l),1===i.length&&(o=n(r)||t),s(e),()=>{const t=i.indexOf(l);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}(o);let s,l=o;function a(t,c){if(null==o)return r.set(o=t),Promise.resolve();l=t;let a=s,u=!1,{delay:d=0,duration:h=400,easing:g=e,interpolate:p=$t}=n(n({},i),c);if(0===h)return a&&(a.abort(),a=null),r.set(o=l),Promise.resolve();const y=f()+d;let $;return s=m((e=>{if(e<y)return!0;u||($=p(o,t),"function"==typeof h&&(h=h(o,t)),u=!0),a&&(a.abort(),a=null);const n=e-y;return n>h?(r.set(o=t),!1):(r.set(o=$(g(n/h))),!0)})),s.promise}return{set:a,update:(t,e)=>a(t(l,o),e),subscribe:r.subscribe}}var wt,vt,xt,Ct,kt,Et=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(wt={exports:{}},wt.exports),wt.exports);function _t(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 St(t,{delay:e=0,speed:n,duration:o,easing:i=ht}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(vt||(vt={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(xt||(xt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(Ct||(Ct={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(kt||(kt={})),Et.ClientState.Disconnected,xt.Poweron,Ct.Click,kt.None,Et.ClientState.Disconnecting,xt.Poweron,Ct.Noninteractive,kt.Connecting,Et.ClientState.Connecting,xt.Poweron,Ct.Noninteractive,kt.Connecting,Et.ClientState.Connected,xt.Mic,Ct.Hold,kt.None,Et.ClientState.Starting,xt.Mic,Ct.Hold,kt.Connecting,Et.ClientState.Recording,xt.Mic,Ct.Hold,kt.None,Et.ClientState.Stopping,xt.Mic,Ct.Noninteractive,kt.Busy,Et.ClientState.Failed,xt.Error,Ct.Click,kt.None,Et.ClientState.NoBrowserSupport,xt.Error,Ct.Click,kt.None,Et.ClientState.NoAudioConsent,xt.Denied,Ct.Click,kt.None,vt.Idle,xt.Poweron,Ct.Click,kt.None,vt.Connecting,xt.Poweron,Ct.Noninteractive,kt.Connecting,vt.Ready,xt.Mic,Ct.Hold,kt.None,vt.Recording,xt.Mic,Ct.Hold,kt.None,vt.Loading,xt.Mic,Ct.Noninteractive,kt.Busy,vt.Failed,xt.Error,Ct.Click,kt.None,vt.NoBrowserSupport,xt.Error,Ct.Click,kt.None,vt.NoAudioConsent,xt.Denied,Ct.Click,kt.None;const Nt=[0,1];function Tt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),l=r-s;return(1-l)*t[s]+l*t[c]}function Pt(e){let n;return{c(){n=x("canvas"),P(n,"color",e[0]),P(n,"display","block"),P(n,"width","1.35rem"),P(n,"height","1.5rem"),P(n,"margin","0"),P(n,"padding","0 0.8rem 0 0rem"),P(n,"flex-grow","0"),P(n,"flex-shrink","0"),P(n,"flex-basis","1.35rem"),S(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&P(n,"color",t[0])},i:t,o:t,d(t){t&&v(n),e[3](null)}}}function zt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,l=[0,0];const a=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return j((()=>{let t;const e=2*(l.length-1)+1,o=3*e+1*(e-1),u=()=>{if(t=requestAnimationFrame(u),!r)return;const e=r.getContext("2d");if(!e)return;let i=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),d=Number.parseInt(getComputedStyle(r).getPropertyValue("width").slice(0,-2)),f=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=d*i,r),n(1,r.height=f*i,r),Date.now()<c?l[0]=.15*s+.85*l[0]:l[0]=.0625+.75*l[0];let h=1;for(;h<l.length;)l[h]=.25*l[h-1]+.5*l[h]+.0625,h++;e.clearRect(0,0,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",h=0;h<l.length;h++){const t=l[h]*r.height;t*r.height>2*g?a(e,.5*r.width-g+h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),h>0&&(t*r.height>2*g?a(e,.5*r.width-g-h*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-h*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return u(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){H[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Rt extends class{$destroy(){at(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=x("style")).id="svelte-1fz8oog-style",e.textContent="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}",b(document.head,e)),dt(this,t,zt,Pt,c,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const{window:At}=ct;function Dt(t,e,n){const o=t.slice();return o[28]=e[n],o[30]=n,o}function Mt(n){let o,i,c,l,a,u,d,h,g,p,y,$,C,k={color:n[4]};u=new Rt({props:k}),n[18](u);let _=n[10]&&Bt(n),N=n[6],T=[];for(let t=0;t<N.length;t+=1)T[t]=Ft(Dt(n,N,t));let P=n[9]&&Lt(n);return{c(){var t;o=x("div"),i=x("div"),c=x("div"),l=E(),a=x("div"),(t=u.$$.fragment)&&t.c(),d=E(),_&&_.c(),g=E();for(let t=0;t<T.length;t+=1)T[t].c();p=E(),P&&P.c(),S(c,"class","TransscriptItemBgDiv"),S(a,"class","TransscriptItemContent"),S(i,"class","TranscriptItem"),S(o,"class","BigTranscript")},m(t,e){w(t,o,e),b(o,i),b(i,c),b(i,l),b(i,a),lt(u,a,null),b(a,d),_&&_.m(a,null),b(o,g);for(let t=0;t<T.length;t+=1)T[t].m(o,null);b(o,p),P&&P.m(o,null),C=!0},p(t,e){const n={};if(16&e&&(n.color=t[4]),u.$set(n),t[10]?_?1024&e&&ot(_,1):(_=Bt(t),_.c(),ot(_,1),_.m(a,null)):_&&(_.d(1),_=null),33344&e){let n;for(N=t[6],n=0;n<N.length;n+=1){const i=Dt(t,N,n);T[n]?(T[n].p(i,e),ot(T[n],1)):(T[n]=Ft(i),T[n].c(),ot(T[n],1),T[n].m(o,p))}for(;n<T.length;n+=1)T[n].d(1);T.length=N.length}t[9]?P?(P.p(t,e),512&e&&ot(P,1)):(P=Lt(t),P.c(),ot(P,1),P.m(o,null)):P&&(P.d(1),P=null)},i(t){if(!C){ot(u.$$.fragment,t),ot(_),h||G((()=>{h=st(i,n[13],{duration:200}),h.start()}));for(let t=0;t<N.length;t+=1)ot(T[t]);ot(P),G((()=>{$&&$.end(1),y||(y=st(o,n[12],{})),y.start()})),C=!0}},o(i){it(u.$$.fragment,i),y&&y.invalidate(),$=function(n,o,i){let c,l=o(n,i),a=!0;const u=nt;function d(){const{delay:o=0,duration:i=300,easing:s=e,tick:d=t,css:h}=l||rt;h&&(c=B(n,1,0,i,o,s,h));const g=f()+o,p=g+i;G((()=>tt(n,!1,"start"))),m((t=>{if(a){if(t>=p)return d(0,1),tt(n,!1,"end"),--u.r||r(u.c),!1;if(t>=g){const e=s((t-g)/i);d(1-e,e)}}return a}))}return u.r+=1,s(l)?Z().then((()=>{l=l(),d()})):d(),{end(t){t&&l.tick&&l.tick(1,0),a&&(c&&I(n,c),a=!1)}}}(o,n[12],{}),C=!1},d(t){t&&v(o),n[18](null),at(u),_&&_.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(T,t),P&&P.d(),t&&$&&$.end()}}}function Bt(e){let n,o;return{c(){n=x("div"),n.textContent="Listening...",S(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||G((()=>{o=st(n,e[13],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function It(t){let e,n;return{c(){e=x("span"),S(e,"style",n=t[30]<t[6].length-1?"width:0.25em;":t[9]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){576&o&&n!==(n=t[30]<t[6].length-1?"width:0.25em;":t[9]?"width:1.2em;":"")&&S(e,"style",n)},d(t){t&&v(e)}}}function Ft(e){let n,o,i,r,s,c,l,a,u,d=e[28].word+"",f=e[30]<e[6].length&&It(e);return{c(){n=x("div"),o=x("div"),r=E(),s=x("div"),c=k(d),l=E(),f&&f.c(),S(o,"class","TransscriptItemBgDiv"),S(s,"class","TransscriptItemContent"),S(n,"class",u="TranscriptItem "+e[15](e[28])),z(n,"Entity",null!==e[28].entityType),z(n,"Final",e[28].isFinal)},m(t,e){w(t,n,e),b(n,o),b(n,r),b(n,s),b(s,c),b(s,l),f&&f.m(s,null)},p(t,e){64&e&&d!==(d=t[28].word+"")&&T(c,d),t[30]<t[6].length?f?f.p(t,e):(f=It(t),f.c(),f.m(s,null)):f&&(f.d(1),f=null),64&e&&u!==(u="TranscriptItem "+t[15](t[28]))&&S(n,"class",u),64&e&&z(n,"Entity",null!==t[28].entityType),64&e&&z(n,"Final",t[28].isFinal)},i(t){i||G((()=>{i=st(o,e[13],{}),i.start()})),a||G((()=>{a=st(s,e[13],{}),a.start()}))},o:t,d(t){t&&v(n),f&&f.d()}}}function Lt(e){let n,o,i,r,s,c,l,a;return{c(){n=x("div"),o=x("div"),i=E(),r=x("div"),s=C("svg"),c=C("path"),S(o,"class","TransscriptItemBgDiv"),P(o,"background-color",e[4]),S(c,"stroke","currentColor"),S(c,"stroke-width","3"),S(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),S(c,"fill","none"),S(c,"fill-rule","evenodd"),P(s,"width","2rem"),P(s,"height","2rem"),P(s,"position","absolute"),P(s,"transform","translate(-0.5rem, -0.5rem)"),P(s,"stroke","#eee"),S(s,"viewBox","0 0 24 24"),S(s,"xmlns","http://www.w3.org/2000/svg"),P(r,"width","1.0rem"),P(r,"height","1rem"),P(r,"position","relative"),S(n,"class","TranscriptItem")},m(t,e){w(t,n,e),b(n,o),b(n,i),b(n,r),b(r,s),b(s,c)},p(t,e){16&e&&P(o,"background-color",t[4])},i(t){l||G((()=>{l=st(c,e[11],{duration:500}),l.start()})),a||G((()=>{a=st(n,e[13],{duration:200,maxWidth:3}),a.start()}))},o:t,d(t){t&&v(n)}}}function jt(e){let n,o,i,s,c,l,a=e[7]&&Mt(e);return{c(){n=x("main"),a&&a.c(),o=E(),i=x("link"),this.c=t,P(n,"--voffset",e[1]),P(n,"--hoffset",e[2]),P(n,"--fontsize",e[3]),P(n,"--highlight-color",e[4]),P(n,"--text-bg-color",e[5]),z(n,"placementTop","top"===e[0]),S(i,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),S(i,"rel","stylesheet")},m(t,r){w(t,n,r),a&&a.m(n,null),w(t,o,r),b(document.head,i),s=!0,c||(l=_(At,"message",e[14]),c=!0)},p(t,[e]){t[7]?a?(a.p(t,e),128&e&&ot(a,1)):(a=Mt(t),a.c(),ot(a,1),a.m(n,null)):a&&(nt={r:0,c:[],p:nt},it(a,1,1,(()=>{a=null})),nt.r||r(nt.c),nt=nt.p),(!s||2&e)&&P(n,"--voffset",t[1]),(!s||4&e)&&P(n,"--hoffset",t[2]),(!s||8&e)&&P(n,"--fontsize",t[3]),(!s||16&e)&&P(n,"--highlight-color",t[4]),(!s||32&e)&&P(n,"--text-bg-color",t[5]),1&e&&z(n,"placementTop","top"===t[0])},i(t){s||(ot(a),s=!0)},o(t){it(a),s=!1},d(t){t&&v(n),a&&a.d(),t&&v(o),v(i),c=!1,l()}}}function Ot(t,e,n){let o,i,{placement:r}=e,{voffset:s="3rem"}=e,{hoffset:c="2rem"}=e,{fontsize:l="1.5rem"}=e,{highlightcolor:a="#15e8b5"}=e,{textbgcolor:u="#202020"}=e,d=[],f=!1,h=null,g=null,p=Et.ClientState.Disconnected,m=!1,y=!1,$=!1;const b=L(),w=(t,e)=>{b.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))},v=_t(St),x=_t(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:ht,css:t=>`\n opacity: ${Tt(Nt,t,0,1)};\n max-height: ${10*Tt(Nt,t,0,.6)}rem;\n `}))),C=_t(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Tt(Nt,t,0,1)*o}rem;\n `}))),k=t=>{if(void 0===t)return;i&&f&&i.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?_(d.length>0?2e3:0):d.length>0&&(m||n(17,m=!0),_(2e3));const e=`${t.contextId}/${t.id}`;null!==g?g!==e&&(n(9,$=!1),g=e):g=e,n(6,d=[]),t.words.forEach((t=>{n(6,d[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},d)})),t.entities.forEach((t=>{n(6,d[t.startPosition].word=t.value,d),n(6,d[t.startPosition].entityType=t.type,d),n(6,d[t.startPosition].isFinal=t.isFinal,d),n(6,d[t.startPosition].hide=!1,d);for(let e=t.startPosition+1;e<t.endPosition;e++)d[e]&&n(6,d[e].hide=!0,d)})),n(6,d=d.filter((t=>!t.hide)))};b.onSegmentUpdate=k;const E=t=>{w("debug","big-transcript.ping 1")},_=(t=0)=>{S(),h=window.setTimeout((()=>{h=null,m&&n(17,m=!1)}),t)},S=()=>{null!==h&&(window.clearTimeout(h),h=null)};return j((()=>{const t=t=>k(t.detail);return b.addEventListener("speechsegment",t),b.addEventListener("ping",E),()=>{cancelAnimationFrame(null),b.removeEventListener("speechsegment",t),b.removeEventListener("ping",E)}})),t.$$set=t=>{"placement"in t&&n(0,r=t.placement),"voffset"in t&&n(1,s=t.voffset),"hoffset"in t&&n(2,c=t.hoffset),"fontsize"in t&&n(3,l=t.fontsize),"highlightcolor"in t&&n(4,a=t.highlightcolor),"textbgcolor"in t&&n(5,u=t.textbgcolor)},t.$$.update=()=>{if(64&t.$$.dirty&&n(10,o=0===d.length),196736&t.$$.dirty){const t=p===Et.ClientState.Recording||m;t!==y&&w("visibilitychanged",t),n(7,y=t)}},[r,s,c,l,a,u,d,y,i,$,o,v,x,C,t=>{switch(t.data.type){case"speechsegment":k(t.data.segment);break;case"holdstart":f=!0;break;case"holdend":f=!1;break;case"speechhandled":t.data.success&&n(9,$=!0);break;case"speechstate":n(16,p=t.data.state),p===Et.ClientState.Recording&&(n(9,$=!1),n(6,d=[]),g=null)}},t=>t.entityType||"",p,m,function(t){H[t?"unshift":"push"]((()=>{i=t,n(8,i)}))}]}class Ht extends ft{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:#fff;font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap}.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}.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, #fff8, #fffc, #fff8, #fffc, #fff8);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},Ot,jt,l,{placement:0,voffset:1,hoffset:2,fontsize:3,highlightcolor:4,textbgcolor:5}),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","highlightcolor","textbgcolor"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),Q()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),Q()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),Q()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),Q()}get highlightcolor(){return this.$$.ctx[4]}set highlightcolor(t){this.$set({highlightcolor:t}),Q()}get textbgcolor(){return this.$$.ctx[5]}set textbgcolor(t){this.$set({textbgcolor:t}),Q()}}function Vt(e){let n,o,i,s,c,l,a,u,d;return{c(){n=x("main"),o=x("div"),i=x("div"),s=x("big-transcript"),c=E(),l=x("div"),a=k(e[1]),this.c=t,N(s,"textbgcolor",e[2]),S(l,"class","hint"),P(l,"opacity",e[5].opacity),S(i,"class","pad"),S(o,"class","drawer"),P(o,"background-color",e[2]),P(o,"opacity",e[3].opacity),P(o,"transform","translate(0px, "+e[4].y+"rem)"),S(n,"class","placementTop"),P(n,"--height",e[0])},m(t,r){w(t,n,r),b(n,o),b(o,i),b(i,s),b(i,c),b(i,l),b(l,a),u||(d=[_(window,"message",e[10]),_(s,"visibilitychanged",e[9])],u=!0)},p(t,[e]){4&e&&N(s,"textbgcolor",t[2]),2&e&&T(a,t[1]),32&e&&P(l,"opacity",t[5].opacity),4&e&&P(o,"background-color",t[2]),8&e&&P(o,"opacity",t[3].opacity),16&e&&P(o,"transform","translate(0px, "+t[4].y+"rem)"),1&e&&P(n,"--height",t[0])},i:t,o:t,d(t){t&&v(n),u=!1,r(d)}}}function Ut(t,n,o){let i,r,s,{height:c="8rem"}=n,{hint:l=""}=n,{textbgcolor:a="#202020"}=n,d=bt({y:-1},{duration:200});u(t,d,(t=>o(4,r=t)));let f=bt({opacity:0},{duration:200,easing:e});u(t,f,(t=>o(3,i=t)));let h=bt({opacity:0},{duration:200,delay:200,easing:e});u(t,h,(t=>o(5,s=t)));return t.$$set=t=>{"height"in t&&o(0,c=t.height),"hint"in t&&o(1,l=t.hint),"textbgcolor"in t&&o(2,a=t.textbgcolor)},[c,l,a,i,r,s,d,f,h,t=>{!1===t.detail?(d.set({y:-1},{easing:gt}),f.set({opacity:0}),h.set({opacity:0})):(d.set({y:0},{easing:pt}),f.set({opacity:1}),h.set({opacity:1}))},t=>{switch(t.data.type){case"speechsegment":h.set({opacity:0})}}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Ht);class qt extends ft{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{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:#fff7;font-size:0.9rem;line-height:135%;margin-top:0.15rem}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Ut,Vt,l,{height:0,hint:1,textbgcolor:2}),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),Q()))}static get observedAttributes(){return["height","hint","textbgcolor"]}get height(){return this.$$.ctx[0]}set height(t){this.$set({height:t}),Q()}get hint(){return this.$$.ctx[1]}set hint(t){this.$set({hint:t}),Q()}get textbgcolor(){return this.$$.ctx[2]}set textbgcolor(t){this.$set({textbgcolor:t}),Q()}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",qt)}(); | ||
!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 i(){return Object.create(null)}function r(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 g=new Set;function p(t){g.forEach((e=>{e.c(t)||(g.delete(e),e.f())})),0!==g.size&&f(p)}function m(t){let e;return 0===g.size&&f(p),{promise:new Promise((n=>{g.add(e={c:t,f:n})})),abort(){g.delete(e)}}}let $=!1;const b=new Set;function y(t,e){$&&b.delete(e),e.parentNode!==t&&t.appendChild(e)}function w(t,e,n){$&&b.delete(e),(e.parentNode!==t||n&&e.nextSibling!==n)&&t.insertBefore(e,n||null)}function x(t){$?b.add(t):t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function C(t){return document.createTextNode(t)}function _(){return C(" ")}function S(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 N(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:E(t,e,n)}function T(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function z(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function P(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 D=new Set;let M,A=0;function B(t,e,n,o,i,r,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*r(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=t.ownerDocument;D.add(h);const f=h.__svelte_stylesheet||(h.__svelte_stylesheet=h.head.appendChild(v("style")).sheet),g=h.__svelte_rules||(h.__svelte_rules={});g[u]||(g[u]=!0,f.insertRule(`@keyframes ${u} ${d}`,f.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${u} ${o}ms linear ${i}ms 1 both`,A+=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")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),A-=i,A||f((()=>{A||(D.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),D.clear())})))}function F(t){M=t}function j(){if(!M)throw new Error("Function called outside component initialization");return M}const O=[],L=[],H=[],V=[],q=Promise.resolve();let U=!1;function W(t){H.push(t)}let G=!1;const J=new Set;function K(){if(!G){G=!0;do{for(let t=0;t<O.length;t+=1){const e=O[t];F(e),Q(e.$$)}for(F(null),O.length=0;L.length;)L.pop()();for(let t=0;t<H.length;t+=1){const e=H[t];J.has(e)||(J.add(e),e())}H.length=0}while(O.length);for(;V.length;)V.pop()();U=!1,G=!1,J.clear()}}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(W)}}let X;function Y(){return X||(X=Promise.resolve(),X.then((()=>{X=null}))),X}function Z(t,e,n){t.dispatchEvent(function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(`${e?"intro":"outro"}${n}`))}const tt=new Set;let et;function nt(t,e){t&&t.i&&(tt.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(tt.has(t))return;tt.add(t),et.c.push((()=>{tt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const it={duration:0};function rt(n,o,i){let r,c,a=o(n,i),l=!1,d=0;function u(){r&&I(n,r)}function f(){const{delay:o=0,duration:i=300,easing:s=e,tick:f=t,css:g}=a||it;g&&(r=B(n,0,1,i,o,s,g,d++)),f(0,1);const p=h()+o,$=p+i;c&&c.abort(),l=!0,W((()=>Z(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),Z(n,!0,"end"),u(),l=!1;if(t>=p){const e=s((t-p)/i);f(e,1-e)}}return l}))}let g=!1;return{start(){g||(I(n),s(a)?(a=a(),Y().then(f)):f())},invalidate(){g=!1},end(){l&&(u(),l=!1)}}}const st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ct(t,e,n,i){const{fragment:c,on_mount:a,on_destroy:l,after_update:d}=t.$$;c&&c.m(e,n),i||W((()=>{const e=a.map(o).filter(s);l?l.push(...e):r(e),t.$$.on_mount=[]})),d.forEach(W)}function at(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 lt(t,e){-1===t.$$.dirty[0]&&(O.push(t),U||(U=!0,q.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dt(e,n,o,s,c,a,l=[-1]){const d=M;F(e);const u=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:n.context||[]),callbacks:i(),dirty:l,skip_bound:!1};let h=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=i)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](i),h&<(e,t)),n})):[],u.update(),h=!0,r(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){$=!0;const t=function(t){return Array.from(t.childNodes)}(n.target);u.fragment&&u.fragment.l(t),t.forEach(x)}else u.fragment&&u.fragment.c();n.intro&&nt(e.$$.fragment),ct(e,n.target,n.anchor,n.customElement),function(){$=!1;for(const t of b)t.parentNode.removeChild(t);b.clear()}(),K()}F(d)}let ut;"function"==typeof HTMLElement&&(ut=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(){r(this.$$.on_disconnect)}$destroy(){at(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function ht(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function ft(t){return t*t*t}function gt(t){const e=t-1;return e*e*e+1}const pt=[];function mt(t){return"[object Date]"===Object.prototype.toString.call(t)}function $t(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)=>$t(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(mt(t)&&mt(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]=$t(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,i={}){const r=function(e,n=t){let o;const i=[];function r(t){if(c(e,t)&&(e=t,o)){const t=!pt.length;for(let t=0;t<i.length;t+=1){const n=i[t];n[1](),pt.push(n,e)}if(t){for(let t=0;t<pt.length;t+=2)pt[t][0](pt[t+1]);pt.length=0}}}return{set:r,update:function(t){r(t(e))},subscribe:function(s,c=t){const a=[s,c];return i.push(a),1===i.length&&(o=n(r)||t),s(e),()=>{const t=i.indexOf(a);-1!==t&&i.splice(t,1),0===i.length&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return r.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:u=0,duration:f=400,easing:g=e,interpolate:p=$t}=n(n({},i),c);if(0===f)return l&&(l.abort(),l=null),r.set(o=a),Promise.resolve();const $=h()+u;let b;return s=m((e=>{if(e<$)return!0;d||(b=p(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(r.set(o=t),!1):(r.set(o=b(g(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:r.subscribe}}var yt,wt,xt,vt,kt,Ct=(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),(n=e.ClientState||(e.ClientState={}))[n.Failed=0]="Failed",n[n.NoBrowserSupport=1]="NoBrowserSupport",n[n.NoAudioConsent=2]="NoAudioConsent",n[n.Disconnected=3]="Disconnected",n[n.Disconnecting=4]="Disconnecting",n[n.Connecting=5]="Connecting",n[n.Connected=6]="Connected",n[n.Starting=7]="Starting",n[n.Stopping=8]="Stopping",n[n.Recording=9]="Recording"}(yt={exports:{}},yt.exports),yt.exports);function _t(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 St(t,{delay:e=0,speed:n,duration:o,easing:i=ht}={}){const r=t.getTotalLength();return void 0===o?o=void 0===n?800:r/n:"function"==typeof o&&(o=o(r)),{delay:e,duration:o,easing:i,css:(t,e)=>`stroke-dasharray: ${t*r} ${e*r}`}}!function(t){t.Failed="Failed",t.NoBrowserSupport="NoBrowserSupport",t.NoAudioConsent="NoAudioConsent",t.Idle="Idle",t.Connecting="Connecting",t.Ready="Ready",t.Recording="Recording",t.Loading="Loading"}(wt||(wt={})),function(t){t.Poweron="poweron",t.Mic="mic",t.Error="error",t.Denied="denied"}(xt||(xt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(vt||(vt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(kt||(kt={})),Ct.ClientState.Disconnected,xt.Poweron,vt.Click,kt.None,Ct.ClientState.Disconnecting,xt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connecting,xt.Poweron,vt.Noninteractive,kt.Connecting,Ct.ClientState.Connected,xt.Mic,vt.Hold,kt.None,Ct.ClientState.Starting,xt.Mic,vt.Hold,kt.Connecting,Ct.ClientState.Recording,xt.Mic,vt.Hold,kt.None,Ct.ClientState.Stopping,xt.Mic,vt.Noninteractive,kt.Busy,Ct.ClientState.Failed,xt.Error,vt.Click,kt.None,Ct.ClientState.NoBrowserSupport,xt.Error,vt.Click,kt.None,Ct.ClientState.NoAudioConsent,xt.Denied,vt.Click,kt.None,wt.Idle,xt.Poweron,vt.Click,kt.None,wt.Connecting,xt.Poweron,vt.Noninteractive,kt.Connecting,wt.Ready,xt.Mic,vt.Hold,kt.None,wt.Recording,xt.Mic,vt.Hold,kt.None,wt.Loading,xt.Mic,vt.Noninteractive,kt.Busy,wt.Failed,xt.Error,vt.Click,kt.None,wt.NoBrowserSupport,xt.Error,vt.Click,kt.None,wt.NoAudioConsent,xt.Denied,vt.Click,kt.None;const Et=[0,1];function Nt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let i=(o-n)/(t.length-1);if(i<=0)return t[0];let r=(e-n)/i,s=Math.floor(r),c=Math.ceil(r),a=r-s;return(1-a)*t[s]+a*t[c]}function Tt(e){let n;return{c(){n=v("canvas"),z(n,"color",e[0]),z(n,"display","block"),z(n,"width","1.35rem"),z(n,"height","1.5rem"),z(n,"margin","0"),z(n,"padding","0 0.8rem 0 0rem"),z(n,"flex-grow","0"),z(n,"flex-shrink","0"),z(n,"flex-basis","1.35rem"),E(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&z(n,"color",t[0])},i:t,o:t,d(t){t&&x(n),e[3](null)}}}function zt(t,e,n){let{color:o="#60e0ff"}=e;const i=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let r,s=0,c=0,a=[0,0];const l=(t,e,n,o,i,r)=>{o<2*r&&(r=o/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.arcTo(e+o,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+o,n,r),t.closePath()};return function(t){j().$$.on_mount.push(t)}((()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!r)return;const e=r.getContext("2d");if(!e)return;let i=(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(r).getPropertyValue("width").slice(0,-2)),h=Number.parseInt(getComputedStyle(r).getPropertyValue("height").slice(0,-2));n(1,r.width=u*i,r),n(1,r.height=h*i,r),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,r.width,r.height);const g=3/o*r.width*.5,p=4/o*r.width;for(e.fillStyle=r.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*r.height;t*r.height>2*g?l(e,.5*r.width-g+f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width+f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*r.height>2*g?l(e,.5*r.width-g-f*p,.5*(r.height-t),2*g,t,g):(e.beginPath(),e.arc(.5*r.width-f*p,.5*r.height,t*r.height*.5,0,2*Math.PI)),e.fill())}};return d(),i(1,500),()=>{cancelAnimationFrame(t)}})),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,r,i,function(t){L[t?"unshift":"push"]((()=>{r=t,n(1,r)}))}]}class Pt extends class{$destroy(){at(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){var e;super(),document.getElementById("svelte-1fz8oog-style")||((e=v("style")).id="svelte-1fz8oog-style",e.textContent="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}",y(document.head,e)),dt(this,t,zt,Tt,c,{color:0,updateVU:2})}get updateVU(){return this.$$.ctx[2]}}const{window:Rt}=st;function Dt(t,e,n){const o=t.slice();return o[37]=e[n],o[39]=n,o}function Mt(n){let o,i,c,a,l,d,u,f,g,p,$,b,k,C={color:n[5]};d=new Pt({props:C}),n[29](d);let S=n[14]&&At(n),N=n[10],T=[];for(let t=0;t<N.length;t+=1)T[t]=It(Dt(n,N,t));let z=n[13]&&Ft(n);return{c(){var t;o=v("div"),i=v("div"),c=v("div"),a=_(),l=v("div"),(t=d.$$.fragment)&&t.c(),u=_(),S&&S.c(),g=_();for(let t=0;t<T.length;t+=1)T[t].c();p=_(),z&&z.c(),E(c,"class","TransscriptItemBgDiv"),E(l,"class","TransscriptItemContent"),E(i,"class","TranscriptItem"),E(o,"class","BigTranscript")},m(t,e){w(t,o,e),y(o,i),y(i,c),y(i,a),y(i,l),ct(d,l,null),y(l,u),S&&S.m(l,null),y(o,g);for(let t=0;t<T.length;t+=1)T[t].m(o,null);y(o,p),z&&z.m(o,null),k=!0},p(t,e){const n={};if(32&e[0]&&(n.color=t[5]),d.$set(n),t[14]?S?16384&e[0]&&nt(S,1):(S=At(t),S.c(),nt(S,1),S.m(l,null)):S&&(S.d(1),S=null),2106368&e[0]){let n;for(N=t[10],n=0;n<N.length;n+=1){const i=Dt(t,N,n);T[n]?(T[n].p(i,e),nt(T[n],1)):(T[n]=It(i),T[n].c(),nt(T[n],1),T[n].m(o,p))}for(;n<T.length;n+=1)T[n].d(1);T.length=N.length}t[13]?z?(z.p(t,e),8192&e[0]&&nt(z,1)):(z=Ft(t),z.c(),nt(z,1),z.m(o,null)):z&&(z.d(1),z=null)},i(t){if(!k){nt(d.$$.fragment,t),nt(S),f||W((()=>{f=rt(i,n[19],{duration:200}),f.start()}));for(let t=0;t<N.length;t+=1)nt(T[t]);nt(z),W((()=>{b&&b.end(1),$||($=rt(o,n[18],{})),$.start()})),k=!0}},o(i){ot(d.$$.fragment,i),$&&$.invalidate(),b=function(n,o,i){let c,a=o(n,i),l=!0;const d=et;function u(){const{delay:o=0,duration:i=300,easing:s=e,tick:u=t,css:f}=a||it;f&&(c=B(n,1,0,i,o,s,f));const g=h()+o,p=g+i;W((()=>Z(n,!1,"start"))),m((t=>{if(l){if(t>=p)return u(0,1),Z(n,!1,"end"),--d.r||r(d.c),!1;if(t>=g){const e=s((t-g)/i);u(1-e,e)}}return l}))}return d.r+=1,s(a)?Y().then((()=>{a=a(),u()})):u(),{end(t){t&&a.tick&&a.tick(1,0),l&&(c&&I(n,c),l=!1)}}}(o,n[18],{}),k=!1},d(t){t&&x(o),n[29](null),at(d),S&&S.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(T,t),z&&z.d(),t&&b&&b.end()}}}function At(e){let n,o;return{c(){n=v("div"),n.textContent="Listening...",E(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||W((()=>{o=rt(n,e[19],{duration:400}),o.start()}))},o:t,d(t){t&&x(n)}}}function Bt(t){let e,n;return{c(){e=v("span"),E(e,"style",n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){9216&o[0]&&n!==(n=t[39]<t[10].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&E(e,"style",n)},d(t){t&&x(e)}}}function It(e){let n,o,i,r,s,c,a,l,d,u=e[37].word+"",h=e[39]<e[10].length&&Bt(e);return{c(){n=v("div"),o=v("div"),r=_(),s=v("div"),c=C(u),a=_(),h&&h.c(),E(o,"class","TransscriptItemBgDiv"),E(s,"class","TransscriptItemContent"),E(n,"class",d="TranscriptItem "+e[21](e[37])),P(n,"Entity",null!==e[37].entityType),P(n,"Final",e[37].isFinal)},m(t,e){w(t,n,e),y(n,o),y(n,r),y(n,s),y(s,c),y(s,a),h&&h.m(s,null)},p(t,e){1024&e[0]&&u!==(u=t[37].word+"")&&T(c,u),t[39]<t[10].length?h?h.p(t,e):(h=Bt(t),h.c(),h.m(s,null)):h&&(h.d(1),h=null),1024&e[0]&&d!==(d="TranscriptItem "+t[21](t[37]))&&E(n,"class",d),1024&e[0]&&P(n,"Entity",null!==t[37].entityType),1024&e[0]&&P(n,"Final",t[37].isFinal)},i(t){i||W((()=>{i=rt(o,e[19],{}),i.start()})),l||W((()=>{l=rt(s,e[19],{}),l.start()}))},o:t,d(t){t&&x(n),h&&h.d()}}}function Ft(e){let n,o,i,r,s,c,a,l;return{c(){n=v("div"),o=v("div"),i=_(),r=v("div"),s=k("svg"),c=k("path"),E(o,"class","TransscriptItemBgDiv"),z(o,"background-color",e[5]),E(c,"stroke","currentColor"),E(c,"stroke-width","3"),E(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),E(c,"fill","none"),E(c,"fill-rule","evenodd"),z(s,"width","2rem"),z(s,"height","2rem"),z(s,"position","absolute"),z(s,"transform","translate(-0.5rem, -0.5rem)"),z(s,"stroke","#eee"),E(s,"viewBox","0 0 24 24"),E(s,"xmlns","http://www.w3.org/2000/svg"),z(r,"width","1.0rem"),z(r,"height","1rem"),z(r,"position","relative"),E(n,"class","TranscriptItem")},m(t,e){w(t,n,e),y(n,o),y(n,i),y(n,r),y(r,s),y(s,c)},p(t,e){32&e[0]&&z(o,"background-color",t[5])},i(t){a||W((()=>{a=rt(c,e[17],{duration:500}),a.start()})),l||W((()=>{l=rt(n,e[19],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&x(n)}}}function jt(e){let n,o,i,s,c,a,l=e[11]&&Mt(e);return{c(){n=v("main"),l&&l.c(),o=_(),i=v("link"),this.c=t,z(n,"--voffset",e[1]),z(n,"--hoffset",e[2]),z(n,"--fontsize",e[3]),z(n,"--color",e[4]),z(n,"--highlight-color",e[5]),z(n,"--text-bg-color",e[6]),z(n,"--gradient-stop1",e[7]),z(n,"--gradient-stop2",e[8]),z(n,"--marginbottom",e[9]),z(n,"--transition",e[15].transition),P(n,"placementTop","top"===e[0]),E(i,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),E(i,"rel","stylesheet")},m(t,r){w(t,n,r),l&&l.m(n,null),w(t,o,r),y(document.head,i),s=!0,c||(a=S(Rt,"message",e[20]),c=!0)},p(t,e){t[11]?l?(l.p(t,e),2048&e[0]&&nt(l,1)):(l=Mt(t),l.c(),nt(l,1),l.m(n,null)):l&&(et={r:0,c:[],p:et},ot(l,1,1,(()=>{l=null})),et.r||r(et.c),et=et.p),(!s||2&e[0])&&z(n,"--voffset",t[1]),(!s||4&e[0])&&z(n,"--hoffset",t[2]),(!s||8&e[0])&&z(n,"--fontsize",t[3]),(!s||16&e[0])&&z(n,"--color",t[4]),(!s||32&e[0])&&z(n,"--highlight-color",t[5]),(!s||64&e[0])&&z(n,"--text-bg-color",t[6]),(!s||128&e[0])&&z(n,"--gradient-stop1",t[7]),(!s||256&e[0])&&z(n,"--gradient-stop2",t[8]),(!s||512&e[0])&&z(n,"--marginbottom",t[9]),(!s||32768&e[0])&&z(n,"--transition",t[15].transition),1&e[0]&&P(n,"placementTop","top"===t[0])},i(t){s||(nt(l),s=!0)},o(t){ot(l),s=!1},d(t){t&&x(n),l&&l.d(),t&&x(o),x(i),c=!1,a()}}}function Ot(t,e,n){let o,i,r,{placement:s}=e,{voffset:c="3rem"}=e,{hoffset:a="2rem"}=e,{fontsize:l="1.5rem"}=e,{color:u="#ffffff"}=e,{highlightcolor:h="#15e8b5"}=e,{backgroundcolor:f="#202020"}=e,{gradientstop1:g="#ffffff88"}=e,{gradientstop2:p="#ffffffcc"}=e,{marginbottom:m="0rem"}=e,$=[],b=!1,y=null,w=null,x=Ct.ClientState.Disconnected,v=!1,k=!1,C=!1,_=bt({transition:0},{duration:200});d(t,_,(t=>n(15,i=t)));const S=j(),E=_t(St),N=_t(((t,{delay:e=0,duration:n=400})=>({delay:e,duration:n,easing:ht,css:t=>`\n opacity: ${Nt(Et,t,0,1)};\n max-height: ${10*Nt(Et,t,0,.6)}rem;\n `}))),T=_t(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Nt(Et,t,0,1)*o}rem;\n `}))),z=()=>{b=!0},P=()=>{b=!1},R=t=>{t&&n(13,C=!0)},D=t=>{n(27,x=t),x===Ct.ClientState.Recording&&(n(13,C=!1),n(10,$=[]),w=null)},M=t=>{if(void 0===t)return;r&&b&&r.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?A($.length>0?2e3:0):$.length>0&&(v||n(28,v=!0),A(2e3));const e=`${t.contextId}/${t.id}`;null!==w?w!==e&&(n(13,C=!1),w=e):w=e,n(10,$=[]),t.words.forEach((t=>{n(10,$[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},$)})),t.entities.forEach((t=>{n(10,$[t.startPosition].word=t.value,$),n(10,$[t.startPosition].entityType=t.type,$),n(10,$[t.startPosition].isFinal=t.isFinal,$),n(10,$[t.startPosition].hide=!1,$);for(let e=t.startPosition+1;e<t.endPosition;e++)$[e]&&n(10,$[e].hide=!0,$)})),n(10,$=$.filter((t=>!t.hide)))},A=(t=0)=>{B(),y=window.setTimeout((()=>{y=null,v&&n(28,v=!1)}),t)},B=()=>{null!==y&&(window.clearTimeout(y),y=null)};return t.$$set=t=>{"placement"in t&&n(0,s=t.placement),"voffset"in t&&n(1,c=t.voffset),"hoffset"in t&&n(2,a=t.hoffset),"fontsize"in t&&n(3,l=t.fontsize),"color"in t&&n(4,u=t.color),"highlightcolor"in t&&n(5,h=t.highlightcolor),"backgroundcolor"in t&&n(6,f=t.backgroundcolor),"gradientstop1"in t&&n(7,g=t.gradientstop1),"gradientstop2"in t&&n(8,p=t.gradientstop2),"marginbottom"in t&&n(9,m=t.marginbottom)},t.$$.update=()=>{if(1024&t.$$.dirty[0]&&n(14,o=0===$.length),402655232&t.$$.dirty[0]){const t=x===Ct.ClientState.Recording||v;t!==k&&(e="visibilitychanged",i=t,S.dispatchEvent(new CustomEvent(e,{detail:i,composed:!0}))),n(11,k=t),_.set({transition:k?1:0})}var e,i},[s,c,a,l,u,h,f,g,p,m,$,k,r,C,o,i,_,E,N,T,t=>{switch(t.data.type){case"speechsegment":M(t.data.segment);break;case"holdstart":z();break;case"holdend":P();break;case"speechhandled":R(t.data.success);break;case"speechstate":D(t.data.state)}},t=>t.entityType||"",z,P,R,D,M,x,v,function(t){L[t?"unshift":"push"]((()=>{r=t,n(12,r)}))}]}class Lt extends ut{constructor(t){super(),this.shadowRoot.innerHTML="<style>.BigTranscript{position:relative;user-select:none;font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition))}.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}.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},Ot,jt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,holdstart:22,holdend:23,speechhandled:24,speechstate:25,speechsegment:26},[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","holdstart","holdend","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$set({placement:t}),K()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$set({voffset:t}),K()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$set({hoffset:t}),K()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$set({fontsize:t}),K()}get color(){return this.$$.ctx[4]}set color(t){this.$set({color:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$set({marginbottom:t}),K()}get holdstart(){return this.$$.ctx[22]}get holdend(){return this.$$.ctx[23]}get speechhandled(){return this.$$.ctx[24]}get speechstate(){return this.$$.ctx[25]}get speechsegment(){return this.$$.ctx[26]}}function Ht(e){let n,o,i,s,c,a,l,d,u;return{c(){n=v("main"),o=v("div"),i=v("div"),s=v("big-transcript"),c=_(),a=v("div"),l=C(e[0]),this.c=t,N(s,"fontsize",e[2]),N(s,"color",e[3]),N(s,"backgroundcolor",e[6]),N(s,"highlightcolor",e[5]),N(s,"gradientstop1",e[7]),N(s,"gradientstop2",e[8]),E(a,"class","hint"),z(a,"opacity",e[11].opacity),E(i,"class","pad"),E(o,"class","drawer"),z(o,"background-color",e[6]),z(o,"opacity",e[9].opacity),z(o,"transform","translate(0px, "+e[10].y+"rem)"),E(n,"class","placementTop"),z(n,"--height",e[1]),z(n,"--smalltextcolor",e[4])},m(t,r){w(t,n,r),y(n,o),y(o,i),y(i,s),y(i,c),y(i,a),y(a,l),d||(u=[S(window,"message",e[16]),S(s,"visibilitychanged",e[15])],d=!0)},p(t,[e]){4&e&&N(s,"fontsize",t[2]),8&e&&N(s,"color",t[3]),64&e&&N(s,"backgroundcolor",t[6]),32&e&&N(s,"highlightcolor",t[5]),128&e&&N(s,"gradientstop1",t[7]),256&e&&N(s,"gradientstop2",t[8]),1&e&&T(l,t[0]),2048&e&&z(a,"opacity",t[11].opacity),64&e&&z(o,"background-color",t[6]),512&e&&z(o,"opacity",t[9].opacity),1024&e&&z(o,"transform","translate(0px, "+t[10].y+"rem)"),2&e&&z(n,"--height",t[1]),16&e&&z(n,"--smalltextcolor",t[4])},i:t,o:t,d(t){t&&x(n),d=!1,r(u)}}}function Vt(t,n,o){let i,r,s,{height:c="8rem"}=n,{hint:a=""}=n,{fontsize:l="1.5rem"}=n,{color:u="#ffffff"}=n,{smalltextcolor:h="#ffffff70"}=n,{highlightcolor:f="#15e8b5"}=n,{backgroundcolor:g="#202020"}=n,{gradientstop1:p="#ffffff88"}=n,{gradientstop2:m="#ffffffcc"}=n,$=bt({y:-1},{duration:200});d(t,$,(t=>o(10,r=t)));let b=bt({opacity:0},{duration:200,easing:e});d(t,b,(t=>o(9,i=t)));let y=bt({opacity:0},{duration:200,delay:200,easing:e});d(t,y,(t=>o(11,s=t)));const w=t=>{o(0,a=t)};return t.$$set=t=>{"height"in t&&o(1,c=t.height),"hint"in t&&o(0,a=t.hint),"fontsize"in t&&o(2,l=t.fontsize),"color"in t&&o(3,u=t.color),"smalltextcolor"in t&&o(4,h=t.smalltextcolor),"highlightcolor"in t&&o(5,f=t.highlightcolor),"backgroundcolor"in t&&o(6,g=t.backgroundcolor),"gradientstop1"in t&&o(7,p=t.gradientstop1),"gradientstop2"in t&&o(8,m=t.gradientstop2)},[a,c,l,u,h,f,g,p,m,i,r,s,$,b,y,t=>{!1===t.detail?($.set({y:-1},{easing:ft}),b.set({opacity:0}),y.set({opacity:0})):($.set({y:0},{easing:gt}),b.set({opacity:1}),y.set({opacity:1}))},t=>{switch(t.data.type){case"speechsegment":y.set({opacity:0});break;case"hint":w(t.data.hint)}},w]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Lt);class qt extends ut{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{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:0.9rem;line-height:135%;margin-top:0.15rem}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},Vt,Ht,a,{height:1,hint:0,fontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,sethint:17}),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),K()))}static get observedAttributes(){return["height","hint","fontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","sethint"]}get height(){return this.$$.ctx[1]}set height(t){this.$set({height:t}),K()}get hint(){return this.$$.ctx[0]}set hint(t){this.$set({hint:t}),K()}get fontsize(){return this.$$.ctx[2]}set fontsize(t){this.$set({fontsize:t}),K()}get color(){return this.$$.ctx[3]}set color(t){this.$set({color:t}),K()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$set({smalltextcolor:t}),K()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$set({highlightcolor:t}),K()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$set({backgroundcolor:t}),K()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$set({gradientstop1:t}),K()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$set({gradientstop2:t}),K()}get sethint(){return this.$$.ctx[17]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",qt)}(); | ||
//# sourceMappingURL=transcript-drawer.js.map |
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
891392
14
763