PageSourceSearch

https://ailikeme.ai/static/6716.99a8b4e8fcdfef3c628b.js

js ailikeme.ai collected 2026-10-05 15:30:12 UTC 25,644 bytes, 54 lines download raw bytes

1"use strict";(self.webpackChunkmy_webpack_project=self.webpackChunkmy_webpack_project||[]).push([[6716],{49038(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle")},1325(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline")},75552(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M7 18h2V6H7zm4 4h2V2h-2zm-8-8h2v-4H3zm12 4h2V6h-2zm4-8v4h2v-4z"}),"GraphicEq")},21477(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic")},54193(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow")},59631(e,t,r){var n=r(88569);t.A=void 0;var a=n(r(89987)),o=r(47671);t.A=(0,a.default)((0,o.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay")},46716(e,t,r){r.r(t),r.d(t,{default:()=>ie});var n=r(39471),a=r(86822),o=r(5185),l=r(35256),i=r(77956),c=r(35710),s=r(8569),u=r(21098),d=r(82195),m=r(34164),f=r(88094),h=r(51102),b=r(41126),v=r(8439),p=r(25119),g=r(58659),y=r(26946),w=r(55072),x=r(26896);function A(e){return(0,x.Ay)("MuiLinearProgress",e)}(0,w.A)("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);var k=r(47671);const E=["className","color","value","valueBuffer","variant"];let C,_,S,R,U,M,j=e=>e;const q=(0,h.i7)(C||(C=j`
2  0% {
3    left: -35%;
4    right: 100%;
5  }
6
7  60% {
8    left: 100%;
9    right: -90%;
10  }
11
12  100% {
13    left: 100%;
14    right: -90%;
15  }
16`)),L=(0,h.i7)(_||(_=j`
17  0% {
18    left: -200%;
19    right: 100%;
20  }
21
22  60% {
23    left: 107%;
24    right: -8%;
25  }
26
27  100% {
28    left: 107%;
29    right: -8%;
30  }
31`)),I=(0,h.i7)(S||(S=j`
32  0% {
33    opacity: 1;
34    background-position: 0 -23px;
35  }
36
37  60% {
38    opacity: 0;
39    background-position: 0 -23px;
40  }
41
42  100% {
43    opacity: 1;
44    background-position: -200px -23px;
45  }
46`)),z=(e,t)=>"inherit"===t?"currentColor":e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:"light"===e.palette.mode?(0,b.a)(e.palette[t].main,.62):(0,b.e$)(e.palette[t].main,.5),B=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${(0,p.A)(r.color)}`],t[r.variant]]}})(({ownerState:e,theme:t})=>(0,d.A)({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:z(t,e.color)},"inherit"===e.color&&"buffer"!==e.variant&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},"buffer"===e.variant&&{backgroundColor:"transparent"},"query"===e.variant&&{transform:"rotate(180deg)"})),W=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.dashed,t[`dashedColor${(0,p.A)(r.color)}`]]}})(({ownerState:e,theme:t})=>{const r=z(t,e.color);return(0,d.A)({position:"absolute",marginTop:0,height:"100%",width:"100%"},"inherit"===e.color&&{opacity:.3},{backgroundImage:`radial-gradient(${r} 0%, ${r} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},(0,h.AH)(R||(R=j`
47    animation: ${0} 3s infinite linear;
48  `),I)),N=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.bar,t[`barColor${(0,p.A)(r.color)}`],("indeterminate"===r.variant||"query"===r.variant)&&t.bar1Indeterminate,"determinate"===r.variant&&t.bar1Determinate,"buffer"===r.variant&&t.bar1Buffer]}})(({ownerState:e,theme:t})=>(0,d.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===e.color?"currentColor":(t.vars||t).palette[e.color].main},"determinate"===e.variant&&{transition:"transform .4s linear"},"buffer"===e.variant&&{zIndex:1,transition:"transform .4s linear"}),({ownerState:e})=>("indeterminate"===e.variant||"query"===e.variant)&&(0,h.AH)(U||(U=j`
49      width: auto;
50      animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
51    `),q)),P=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.bar,t[`barColor${(0,p.A)(r.color)}`],("indeterminate"===r.variant||"query"===r.variant)&&t.bar2Indeterminate,"buffer"===r.variant&&t.bar2Buffer]}})(({ownerState:e,theme:t})=>(0,d.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==e.variant&&{backgroundColor:"inherit"===e.color?"currentColor":(t.vars||t).palette[e.color].main},"inherit"===e.color&&{opacity:.3},"buffer"===e.variant&&{backgroundColor:z(t,e.color),transition:"transform .4s linear"}),({ownerState:e})=>("indeterminate"===e.variant||"query"===e.variant)&&(0,h.AH)(M||(M=j`
52      width: auto;
53      animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
54    `),L)),T=n.forwardRef(function(e,t){const r=(0,y.b)({props:e,name:"MuiLinearProgress"}),{className:n,color:a="primary",value:o,valueBuffer:l,variant:i="indeterminate"}=r,c=(0,u.A)(r,E),s=(0,d.A)({},r,{color:a,variant:i}),h=(e=>{const{classes:t,variant:r,color:n}=e,a={root:["root",`color${(0,p.A)(n)}`,r],dashed:["dashed",`dashedColor${(0,p.A)(n)}`],bar1:["bar",`barColor${(0,p.A)(n)}`,("indeterminate"===r||"query"===r)&&"bar1Indeterminate","determinate"===r&&"bar1Determinate","buffer"===r&&"bar1Buffer"],bar2:["bar","buffer"!==r&&`barColor${(0,p.A)(n)}`,"buffer"===r&&`color${(0,p.A)(n)}`,("indeterminate"===r||"query"===r)&&"bar2Indeterminate","buffer"===r&&"bar2Buffer"]};return(0,f.A)(a,A,t)})(s),b=(0,v.I)(),g={},w={bar1:{},bar2:{}};if(("determinate"===i||"buffer"===i)&&void 0!==o){g["aria-valuenow"]=Math.round(o),g["aria-valuemin"]=0,g["aria-valuemax"]=100;let e=o-100;b&&(e=-e),w.bar1.transform=`translateX(${e}%)`}if("buffer"===i&&void 0!==l){let e=(l||0)-100;b&&(e=-e),w.bar2.transform=`translateX(${e}%)`}return(0,k.jsxs)(B,(0,d.A)({className:(0,m.A)(h.root,n),ownerState:s,role:"progressbar"},g,{ref:t},c,{children:["buffer"===i?(0,k.jsx)(W,{className:h.dashed,ownerState:s}):null,(0,k.jsx)(N,{className:h.bar1,ownerState:s,style:w.bar1}),"determinate"===i?null:(0,k.jsx)(P,{className:h.bar2,ownerState:s,style:w.bar2})]}))});var $=r(21477),D=r(29054),O=r(49038),F=r(59631),V=r(1325),H=r(54193),G=r(75552),Y=r(18467),Q=r(29934),X=r(51794);const K=16e3,Z={echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,channelCount:1},J={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1};function ee(e){let t=0;
54e.forEach(e=>t+=e.length);const r=new Int16Array(t);let n=0;return e.forEach(e=>{r.set(e,n),n+=e.length}),r}class te{constructor(){this._raw=null,this._cleaned=null,this._recording=!1,this._startedAt=0,this._ready=!1}get ready(){return this._ready}async _openDomain(e,t){const r=await navigator.mediaDevices.getUserMedia({audio:e,video:!1}),n=new(window.AudioContext||window.webkitAudioContext);"suspended"===n.state&&await n.resume(),await n.audioWorklet.addModule("/deepgram-worklet.js");const a=n.createMediaStreamSource(r),o=new AudioWorkletNode(n,"deepgram-pcm-worklet",{processorOptions:{targetSampleRate:K}});a.connect(o);const l=[];o.port.onmessage=e=>{this._recording&&l.push(new Int16Array(e.data))};let i=null;return t&&(i=n.createAnalyser(),i.fftSize=512,a.connect(i)),{stream:r,ctx:n,source:a,node:o,chunks:l,analyser:i}}async init(){if(!this._ready){this._raw=await this._openDomain(Z,!0);try{this._cleaned=await this._openDomain(J,!1)}catch(e){throw this.dispose(),e}this._ready=!0}}startClip(){if(!this._ready)throw new Error("recorder_not_initialized");this._raw.chunks.length=0,this._cleaned.chunks.length=0,this._recording=!0,this._startedAt="undefined"!=typeof performance?performance.now():0}stopClip(){this._recording=!1;const e=("undefined"!=typeof performance?performance.now():0)-this._startedAt,t=ee(this._raw.chunks),r=ee(this._cleaned.chunks);return{raw:t.buffer,cleaned:r.buffer,rawPcm:t,cleanedPcm:r,durationMs:e,seconds:t.length/K}}getLevel(){const e=this._raw&&this._raw.analyser;if(!e)return 0;const t=new Uint8Array(e.fftSize);e.getByteTimeDomainData(t);let r=0;for(let e=0;e<t.length;e++){const n=(t[e]-128)/128;r+=n*n}const n=Math.sqrt(r/t.length);return Math.min(1,2.2*n)}dispose(){this._recording=!1,this._ready=!1,[this._raw,this._cleaned].forEach(e=>{if(e){try{e.stream.getTracks().forEach(e=>e.stop())}catch(e){}try{e.ctx&&"closed"!==e.ctx.state&&e.ctx.close()}catch(e){}}}),this._raw=null,this._cleaned=null}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ne(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const ae=[{id:"s1",label:"Sentence 1 of 4",text:"The quick brown fox jumps over the lazy dog while the bright sun sets."},{id:"s2",label:"Sentence 2 of 4",text:"She sells fresh seashells by the seashore on a calm Tuesday morning."},{id:"s3",label:"Sentence 3 of 4",text:"We drove through the village, past the old church, toward the quiet harbor."},{id:"digits",label:"Numbers (4 of 4)",text:"Read these numbers aloud: four, eight, fifteen, sixteen, twenty-three, forty-two."}],oe="#34B5B1",le={too_short:e=>{var t;return"that recording had only about ".concat((null!==(t=null==e?void 0:e.voiced_s)&&void 0!==t?t:0).toFixed(1),"s of speech — please read the whole sentence.")},too_quiet:e=>"your mic level was low".concat(null!=(null==e?void 0:e.peak_dbfs)?" (peak ".concat(Math.round(e.peak_dbfs)," dBFS)"):""," — move closer to the mic or speak up."),noisy:()=>"there was background noise — try somewhere quieter.",clipped:()=>"that was too loud and distorted — move back a little or lower your mic gain.",cut_off:()=>"the recording stopped before you finished — read the whole line and wait a moment before pressing Stop."},ie=e=>{let t=e.setBanner;
54const r=(0,Y.wA)(),u=re((0,n.useState)("loading"),2),d=u[0],m=u[1],f=re((0,n.useState)(null),2),h=f[0],b=f[1],v=re((0,n.useState)(!1),2),p=v[0],g=v[1],y=re((0,n.useState)(!1),2),w=y[0],x=y[1],A=re((0,n.useState)(null),2),k=A[0],E=A[1],C=re((0,n.useState)(0),2),_=C[0],S=C[1],R=re((0,n.useState)(()=>ae.map(()=>null)),2),U=R[0],M=R[1],j=re((0,n.useState)(null),2),q=j[0],L=j[1],I=re((0,n.useState)(!1),2),z=I[0],B=I[1],W=re((0,n.useState)(0),2),N=W[0],P=W[1],Z=re((0,n.useState)(0),2),J=Z[0],ee=Z[1],ne=re((0,n.useState)(!1),2),ie=ne[0],ce=ne[1],se=re((0,n.useState)(null),2),ue=se[0],de=se[1],me=re((0,n.useState)(!1),2),fe=me[0],he=me[1],be=re((0,n.useState)([]),2),ve=be[0],pe=be[1],ge=(0,n.useRef)(null),ye=(0,n.useRef)(!1),we=(0,n.useRef)(0),xe=(0,n.useRef)(null),Ae=(0,n.useRef)(!1),ke=(0,n.useRef)(0),Ee=(0,n.useRef)([]),Ce=(0,n.useRef)(null),_e=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=!0;return(async()=>{try{var t;const n=await(0,X.qA)();if(!e)return;const a=!(null==n||null===(t=n.data)||void 0===t||!t.enrolled);b(a?n.data.metadata:null),m(a?"enrolled":"not_enrolled"),r((0,Q.QO)({voice_enrolled:a}))}catch(t){if(!e)return;m("not_enrolled")}})(),()=>{e=!1}},[r]),(0,n.useEffect)(()=>()=>{if(xe.current&&cancelAnimationFrame(xe.current),_e.current){try{_e.current.pause()}catch(e){}_e.current=null}if(ge.current){try{ge.current.dispose()}catch(e){}ge.current=null}Ee.current.forEach(e=>(null==e?void 0:e.url)&&URL.revokeObjectURL(e.url)),Ee.current=[]},[]);const Se=(0,n.useCallback)(()=>{M(e=>(e.forEach(e=>(null==e?void 0:e.wavUrl)&&URL.revokeObjectURL(e.wavUrl)),e))},[]),Re=(0,n.useCallback)(()=>{Ee.current.forEach(e=>(null==e?void 0:e.url)&&URL.revokeObjectURL(e.url)),Ee.current=[],pe([])},[]),Ue=(0,n.useCallback)(async()=>{E(null),de(null),x(!0);try{(0,X.Zp)();const e=new te;await e.init(),ge.current=e,M(ae.map(()=>null)),S(0),L(null),g(!0)}catch(e){E("We couldn't access your microphone. Please allow mic access in your browser and try again.")}finally{x(!1)}},[]),Me=(0,n.useCallback)(()=>{const e=ge.current;if(!e||!ye.current)return;const t=e.getLevel();ee(t);const r=performance.now(),n=(r-we.current)/1e3;if(P(n),n>=12)Ce.current&&Ce.current();else{if(t>=.08)Ae.current=!0,ke.current=0;else if(Ae.current&&n>=1.5&&t<.04)if(ke.current){if(r-ke.current>=1100)return void(Ce.current&&Ce.current())}else ke.current=r;else ke.current=0;xe.current=requestAnimationFrame(Me)}},[]),je=(0,n.useCallback)(()=>{const e=ge.current;e&&!ye.current&&(de(null),e.startClip(),ye.current=!0,we.current=performance.now(),Ae.current=!1,ke.current=0,B(!0),P(0),xe.current=requestAnimationFrame(Me))},[Me]),qe=(0,n.useCallback)(()=>{const e=ge.current;if(!e||!ye.current)return;ye.current=!1,B(!1),xe.current&&cancelAnimationFrame(xe.current),ee(0);const t=e.stopClip();if(t.seconds<.6||(e=>{if(!e||!e.length)return-99;let t=0;for(let r=0;r<e.length;r++){const n=Math.abs(e[r]);n>t&&(t=n)}const r=t/32768;return r>0?20*Math.log10(r):-99})(t.cleanedPcm)<-55)return de({severity:"warning",text:"We didn't catch any audio — check your microphone is on and unmuted, then record again."}),void L(_);const r=URL.createObjectURL(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;const r=e instanceof Int16Array?e:new Int16Array(e),n=2*r.length,a=new ArrayBuffer(44+n),o=new DataView(a),l=(e,t)=>{for(let r=0;r<t.length;r++)o.setUint8(e+r,t.charCodeAt(r))};l(0,"RIFF"),o.setUint32(4,36+n,!0),l(8,"WAVE"),l(12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,1,!0),o.setUint32(24,t,!0),o.setUint32(28,2*t,!0),o.setUint16(32,2,!0),o.setUint16(34,16,!0),l(36,"data"),o.setUint32(40,n,!0);let i=44;for(let e=0;e<r.length;e++,i+=2)o.setInt16(i,r[e],!0);return new Blob([o],{type:"audio/wav"})}(t.cleanedPcm));M(e=>{var n;const a=[...e];return null!==(n=a[_])&&void 0!==n&&n.wavUrl&&URL.revokeObjectURL(a[_].wavUrl),a[_]={raw:t.raw,cleaned:t.cleaned,seconds:t.seconds,wavUrl:r},a}),L(e=>e===_?null:e),de(null)},[_]),Le=(0,n.useCallback)(()=>{const e=ge.current;if(e&&ye.current){ye.current=!1,B(!1),xe.current&&cancelAnimationFrame(xe.current),ee(0),P(0);try{e.stopClip()}catch(e){}de(null)}},[]);Ce.current=qe;
54const Ie=(0,n.useCallback)(e=>{if(!e)return;let t=_e.current;t||(t=new Audio,_e.current=t);try{t.pause(),t.src=e,t.currentTime=0,t.play().catch(e=>{de({severity:"warning",text:"Couldn't play that recording in this browser."}),console.warn("[VoiceEnrollment] playback failed:",e)})}catch(e){console.warn("[VoiceEnrollment] playback error:",e)}},[]),ze=(0,n.useCallback)(e=>{const t=(e=>{const t=null==e?void 0:e.reason,r="number"==typeof(null==e?void 0:e.clip)?e.clip:null;if(null!=r){var n;const a=(null===(n=ae[r])||void 0===n?void 0:n.label)||"Sentence ".concat(r+1," of ").concat(ae.length),o=le[t]?le[t](e):"please re-record this sentence.";return{clip:r,severity:"warning",text:"".concat(a," — ").concat(o)}}return"inconsistent_samples"===t?{clip:null,severity:"warning",text:((null==e?void 0:e.advice)||"Your recordings varied too much to build a reliable voiceprint.")+" Re-record in a quiet room at a steady volume — your previous takes are kept."}:"no_speech_detected"===t?{clip:null,severity:"warning",text:"We couldn't hear enough clear speech. Re-record a bit closer to the mic, somewhere quieter."}:"model_unavailable"===t?{clip:null,severity:"error",text:"The voice model is warming up. Please wait a moment and try again."}:{clip:null,severity:"error",text:(null==e?void 0:e.advice)||"Something went wrong saving your voice profile. Please try again."}})(e);de({severity:t.severity,text:t.text}),null!=t.clip?(M(e=>{var r;const n=[...e];return null!==(r=n[t.clip])&&void 0!==r&&r.wavUrl&&URL.revokeObjectURL(n[t.clip].wavUrl),n[t.clip]=null,n}),S(t.clip),L(t.clip)):L(null)},[]),Be=(0,n.useCallback)(async()=>{if(!U.some(e=>!e)){ce(!0),de(null);try{const e=new FormData;U.forEach((t,r)=>{e.append("raw_".concat(r),new Blob([t.raw],{type:"application/octet-stream"}),"raw_".concat(r,".pcm")),e.append("cleaned_".concat(r),new Blob([t.cleaned],{type:"application/octet-stream"}),"cleaned_".concat(r,".pcm"))});const n=await(0,X.CB)(e),a=(null==n?void 0:n.data)||{};if("enrolled"===a.status){const e=U.map((e,t)=>{var r;return null!=e&&e.wavUrl?{url:e.wavUrl,label:(null===(r=ae[t])||void 0===r?void 0:r.label)||"Take ".concat(t+1)}:null}).filter(Boolean);Ee.current=e,pe(e),ge.current&&(ge.current.dispose(),ge.current=null),g(!1),b(a.metadata||null),m("enrolled"),r((0,Q.QO)({voice_enrolled:!0})),de(null);const n="marginal"===a.quality?" (quality: fair)":"";t&&t({show:!0,text:"Voice enrolled successfully".concat(n,".")})}else ze(a)}catch(t){var e;const r=null==t||null===(e=t.response)||void 0===e?void 0:e.data;r&&(r.reason||r.advice)?ze(r):de({severity:"error",text:"Something went wrong saving your voice profile. Please try again."})}finally{ce(!1)}}},[U,r,Se,t,ze]),We=(0,n.useCallback)(()=>{Re(),m("not_enrolled"),g(!1),M(ae.map(()=>null)),S(0),L(null),de(null)},[Re]),Ne=(0,n.useCallback)(async()=>{he(!0);try{await(0,X.$X)(),Re(),b(null),m("not_enrolled"),r((0,Q.QO)({voice_enrolled:!1})),t&&t({show:!0,text:"Voice profile removed."})}catch(e){de({severity:"error",text:"Couldn't remove your voice profile."})}finally{he(!1)}},[r,t,Re]),Pe=()=>n.createElement(a.A,{className:"flex items-center gap-2 mb-1"},n.createElement(G.A,{sx:{color:oe}}),n.createElement(o.A,{variant:"h6",sx:{fontWeight:700,color:"var(--ink)"}},"Voice Enrollment")),Te=()=>n.createElement(o.A,{variant:"caption",sx:{color:"#7a7a7a",display:"block",mt:2}},"Your voice profile is stored securely and used only to recognize you during calls. Raw recordings are not retained beyond processing.");if("loading"===d)return n.createElement(a.A,{className:"flex items-center justify-center",sx:{minHeight:200}},n.createElement(l.A,{sx:{color:oe}}));if("enrolled"===d){const e=(null==h?void 0:h.updated_at)||(null==h?void 0:h.created_at),t=e?new Date(e).toLocaleDateString():null;return n.createElement(a.A,{sx:{maxWidth:720}},Pe(),n.createElement(a.A,{className:"flex flex-col gap-3 rounded-2xl border p-5",sx:{borderColor:"rgba(52,181,177,0.4)",background:"rgba(52,181,177,0.06)"}},n.createElement(a.A,{className:"flex items-center gap-2"},n.createElement(O.A,{sx:{color:oe}}),n.createElement(o.A,{sx:{fontWeight:600,color:"var(--ink)"}},"Your voice is enrolled"),(null==h?void 0:h.quality)&&n.createElement(i.A,{size:"small",label:"good"===h.quality?"Good quality":"Fair quality",sx:{ml:1,bgcolor:"good"===h.quality?"rgba(52,181,177,0.15)":"rgba(237,160,0,0.15)",color:"good"===h.quality?oe:"#b27700",fontWeight:600}})),t&&n.createElement(o.A,{variant:"body2",sx:{color:"#5a5a5a"}},"Enrolled on ",t,null!=h&&h.sample_count?" · ".concat(h.sample_count," samples"):"",null!=h&&h.total_speech_seconds?" · ".concat(h.total_speech_seconds,"s of speech"):""),ue&&n.createElement(c.A,{severity:ue.severity,onClose:()=>de(null)},ue.text),ve.length>0&&n.createElement(a.A,{className:"flex flex-col gap-2 mt-1"},n.createElement(o.A,{variant:"body2",sx:{color:"#5a5a5a",fontWeight:600}},"Listen to your enrolled voice"),n.createElement(a.A,{className:"flex flex-wrap gap-2"},ve.map((e,t)=>n.createElement(s.A,{key:t,size:"small",variant:"outlined",startIcon:n.createElement(H.A,
54null),onClick:()=>Ie(e.url),sx:{textTransform:"none",borderColor:"rgba(52,181,177,0.5)",color:oe}},e.label)))),n.createElement(a.A,{className:"flex flex-wrap gap-3 mt-1"},n.createElement(s.A,{variant:"contained",startIcon:n.createElement(F.A,null),onClick:We,sx:{bgcolor:oe,"&:hover":{bgcolor:"#2c9a96"},textTransform:"none"}},"Re-enroll"),n.createElement(s.A,{variant:"outlined",color:"error",startIcon:n.createElement(V.A,null),onClick:Ne,disabled:fe,sx:{textTransform:"none"}},fe?"Removing…":"Remove"))),Te())}if(!p)return n.createElement(a.A,{sx:{maxWidth:720}},Pe(),n.createElement(o.A,{variant:"body1",sx:{color:"#444",mb:2}},"Teach the app your voice. During calls, this lets the AI recognize you specifically — so only you can interrupt it, and other voices (videos, people nearby) are treated as background."),n.createElement(a.A,{className:"rounded-2xl border p-5 flex flex-col gap-3",sx:{borderColor:"rgba(0,0,0,0.1)",background:"rgba(0,0,0,0.02)"}},n.createElement(o.A,{sx:{fontWeight:600,color:"var(--ink)"}},"What you'll do"),n.createElement(o.A,{variant:"body2",sx:{color:"#555"}},"Read ",ae.length," short prompts aloud in a quiet place (about 20–30 seconds total). You can listen back and re-record any clip before saving. We check the quality automatically and only save a voiceprint that actually recognizes you."),k&&n.createElement(c.A,{severity:"error"},k),n.createElement(a.A,null,n.createElement(s.A,{variant:"contained",startIcon:w?null:n.createElement($.A,null),onClick:Ue,disabled:w,sx:{bgcolor:oe,"&:hover":{bgcolor:"#2c9a96"},textTransform:"none"}},w?"Starting…":"Begin voice setup"))),Te());const $e=ae[_],De=U[_],Oe=U.filter(Boolean).length,Fe=Oe===ae.length,Ve=Oe/ae.length*100,He=q===_;return n.createElement(a.A,{sx:{maxWidth:720}},Pe(),n.createElement(a.A,{className:"flex items-center justify-between mb-1"},n.createElement(o.A,{variant:"body2",sx:{color:"#666",fontWeight:600}},"Step ",_+1," of ",ae.length," · ",$e.label),n.createElement(o.A,{variant:"caption",sx:{color:"#888"}},Oe,"/",ae.length," recorded")),n.createElement(T,{variant:"determinate",value:Ve,sx:{height:8,borderRadius:4,mb:3,bgcolor:"rgba(0,0,0,0.08)","& .MuiLinearProgress-bar":{bgcolor:oe}}}),n.createElement(a.A,{className:"rounded-2xl border p-5 flex flex-col gap-4",sx:{borderColor:He?"#d98a00":"rgba(0,0,0,0.1)",borderWidth:He?2:1,background:He?"rgba(217,138,0,0.05)":"transparent"}},n.createElement(a.A,{className:"flex items-center justify-between"},n.createElement(o.A,{variant:"subtitle1",sx:{color:"#1f1f1f",fontWeight:700,letterSpacing:"0.06em"}},"Read this aloud: ",n.createElement(o.A,{variant:"body2",sx:{color:"#666"}},"(Keep reading — repeat the line if you finish early — until the timer reaches ",12,"s.)")),He&&n.createElement(i.A,{size:"small",label:"Re-record this one",sx:{bgcolor:"rgba(217,138,0,0.15)",color:"#b27700",fontWeight:600}})),n.createElement(o.A,{variant:"h6",sx:{color:"#1f1f1f",fontWeight:500,lineHeight:1.4}},"“",$e.text,"”"),z&&n.createElement(a.A,{className:"flex items-center gap-3"},n.createElement(a.A,{sx:{flex:1,height:10,borderRadius:5,bgcolor:"rgba(0,0,0,0.08)",overflow:"hidden"}},n.createElement(a.A,{sx:{height:"100%",width:"".concat(Math.round(100*J),"%"),bgcolor:J>.05?oe:"#cfcfcf",transition:"width 80ms linear"}})),n.createElement(o.A,{variant:"caption",sx:{color:"#666",minWidth:64,textAlign:"right"}},N.toFixed(1),"s / ",12,"s")),ue&&n.createElement(c.A,{severity:ue.severity,onClose:()=>de(null)},ue.text),n.createElement(a.A,{className:"flex flex-wrap items-center gap-3"},z?n.createElement(s.A,{variant:"outlined",color:"error",startIcon:n.createElement(D.A,null),onClick:Le,sx:{textTransform:"none"}},"Cancel"):n.createElement(s.A,{variant:"contained",startIcon:De?n.createElement(F.A,null):n.createElement($.A,null),onClick:je,sx:{bgcolor:De?"#6b6b6b":oe,"&:hover":{bgcolor:De?"#555":"#2c9a96"},textTransform:"none"}},De?"Re-record":"Start Recording"),De&&!z&&n.createElement(n.Fragment,null,n.createElement(i.A,{icon:n.createElement(O.A,null),label:"Recorded · ".concat(De.seconds.toFixed(1),"s"),sx:{bgcolor:"rgba(52,181,177,0.15)",fontWeight:600}}),n.createElement(s.A,{variant:"text",startIcon:n.createElement(H.A,
54null),onClick:()=>Ie(De.wavUrl),sx:{textTransform:"none"}},"Play")))),n.createElement(a.A,{className:"flex items-center justify-between mt-4"},n.createElement(s.A,{variant:"text",disabled:0===_||z,onClick:()=>{de(null),S(e=>Math.max(0,e-1))},sx:{textTransform:"none",color:"#666"}},"Back"),!Fe&&_<ae.length-1?n.createElement(s.A,{variant:"contained",disabled:!De||z,onClick:()=>{de(null),S(e=>Math.min(ae.length-1,e+1))},sx:{bgcolor:oe,"&:hover":{bgcolor:"#2c9a96"},textTransform:"none"}},"Next"):n.createElement(s.A,{variant:"contained",disabled:!Fe||z||ie,onClick:Be,startIcon:ie?n.createElement(l.A,{size:16,color:"inherit"}):n.createElement(O.A,null),sx:{bgcolor:oe,"&:hover":{bgcolor:"#2c9a96"},textTransform:"none"}},ie?"Saving…":"Finish enrollment")),Te())}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.