PageSourceSearch

https://panel.insightgenie.ai/assets/PassphraseTestPage-CK1tUdgv.js

js insightgenie.ai collected 2026-10-05 12:06:16 UTC 5,015 bytes, 1 lines download raw bytes

1import{r,j as e,i as w,k as b}from"./index-CvCLQTzb.js";const k=[{value:"en",label:"English"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}],j="passphrase-test-speaker",I={stopButtonText:"Stop",recordVoiceFirstSwalDescription:"Your recording needs to be at least 6 seconds",recordVoiceSecondSwalDescription:"Please allow microphone access to continue.",recordVoiceAllowToStopRecordingMessage:"You can stop recording now",yourRecordingHeader:"Your recording",recordAgainButtonText:"Record again"},P=()=>{const[c,N]=r.useState("en"),[l,S]=r.useState(j),[s,o]=r.useState(null),[i,p]=r.useState(null),[x,h]=r.useState(!1),[m,u]=r.useState(!1),[g,f]=r.useState(""),[n,d]=r.useState(null),y=async()=>{h(!0),f(""),d(null),p(null),o(null);const a=await b.createVoiceAuthenticationPassphraseChallenge({speakerId:l.trim(),language:c,isTestPassphrase:!0});if(h(!1),!(a!=null&&a.success)){f((a==null?void 0:a.error)||"Could not fetch passphrase.");return}o(a)},v=async()=>{if(!(s!=null&&s.challengeId)||!i)return;u(!0),d(null);const a=await b.verifyPassphraseOnly({recordedFile:i,speakerId:l.trim(),passphraseChallengeId:s.challengeId,preventLoading:!0});u(!1),d(a)},t=n==null?void 0:n.passphraseTest;return e.jsx("div",{className:"min-h-screen bg-[#f5f7f4] px-4 py-10",children:e.jsxs("div",{className:"mx-auto max-w-2xl rounded-2xl border border-[#d9e5d7] bg-white p-8 shadow-sm",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-sm uppercase tracking-wide text-[#6b7280]",children:"Internal tool"}),e.jsx("h1",{className:"mt-2 text-3xl font-semibold text-[#1f2937]",children:"Passphrase test"}),e.jsx("p",{className:"mt-2 text-[#4b5563]",children:"Fetch a passphrase, record yourself saying it, and verify the transcript match without running voice embedding comparison."})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("label",{className:"flex flex-col gap-2 text-sm text-[#374151]",children:["Language",e.jsx("select",{className:"rounded-lg border border-[#d1d5db] px-3 py-2",value:c,onChange:a=>N(a.target.value),children:k.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}),e.jsxs("label",{className:"flex flex-col gap-2 text-sm text-[#374151]",children:["Speaker ID",e.jsx("input",{className:"rounded-lg border border-[#d1d5db] px-3 py-2",value:l,onChange:a=>S(a.target.value),placeholder:j})]})]}),e.jsx("button",{type:"button",className:"mt-6 rounded-lg bg-[#339A31] px-5 py-3 text-white disabled:cursor-not-allowed disabled:opacity-60",onClick:y,disabled:x||!l.trim(),children:x?"Fetching passphrase...":"Fetch passphrase"}),g&&e.jsx("div",{className:"mt-4 rounded-lg border border-[#fecaca] bg-[#fef2f2] px-4 py-3 text-sm text-[#b91c1c]",children:g}),(s==null?void 0:s.passphrase)&&e.jsxs("div",{className:"mt-6 rounded-xl border border-[#dbeafe] bg-[#eff6ff] p-5",children:[e.jsx("p",{className:"text-sm font-medium text-[#1d4ed8]",children:"Say this passphrase"}),e.jsx("p",{className:"mt-3 text-xl leading-relaxed text-[#111827]",children:s.passphrase}),e.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-[#4b5563]",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Challenge ID:"})," ",s.challengeId]}),s.expiresAt&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Expires:"})," ",new Date(s.expiresAt).toLocaleString()]})]})]}),(s==null?void 0:s.passphrase)&&e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-[#1f2937]",children:"Record your voice"}),e.jsx(w,{voiceFile:i,setVoiceFile:p,translations:I,minDurationSeconds:6,maxDurationSeconds:30,tooShortMessage:"Your recording needs to be at least 6 seconds"})]}),(s==null?void 0:s.passphrase)&&e.jsx("button",{type:"button",className:"mt-6 rounded-lg bg-[#1f2937] px-5 py-3 text-white disabled:cursor-not-allowed disabled:opacity-60",onClick:v,disabled:m||!i,children:m?"Verifying passphrase...":"Verify passphrase only"}),n&&e.jsxs("div",{className:"mt-6 rounded-xl border border-[#e5e7eb] bg-[#f9fafb] p-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#1f2937]",children:"Verification result"}),!n.success&&e.jsx("p",{className:"mt-3 text-sm text-[#b91c1c]",children:n.error||"Verification failed."}),t&&e.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-[#374151]",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Passed:"})," ",t.isSkipped?"Skipped":t.isPassed?"Yes":"No"]}),!t.isSkipped&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Accuracy:"})," ",Math.round((t.accuracyScore||0)*100),"%"]}),t.isSkipped&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Skip reason:"})," ",t.skipReason]}),t.language&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Language:"})," ",t.language]})]}),e.jsx("pre",{className:"mt-4 overflow-x-auto rounded-lg bg-[#111827] p-4 text-xs text-[#e5e7eb]",children:JSON.stringify(n,null,2)})]})]})})};export{P as default};

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.