PageSourceSearch

https://omni-smart.ai/static/js/7823.ea5e27e8.chunk.js

js omni-smart.ai collected 2026-10-05 13:17:53 UTC 9,230 bytes, 3 lines download raw bytes

1/*! For license information please see 7823.ea5e27e8.chunk.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[7823],{7823(e,t,a){a.r(t),a.d(t,{default:()=>p});var s=a(5043),r=a(9364),i=a(6328),d=a(1);const n=(0,a(7784).A)("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var l=a(2874),o=a(8693),c=a(4185),x=a(8559),m=a(8330),h=a(579);function p(){const[e,t]=(0,s.useState)(c.ZI),[a,p]=(0,s.useState)(""),[v,u]=(0,s.useState)(c.Tp),b=(0,s.useRef)("en"),[g,y]=(0,s.useState)(!1),[f,A]=(0,s.useState)(!1),[N,j]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!0),[R,S]=(0,s.useState)((0,x.R1)());(0,s.useEffect)(()=>{(async()=>{k(!0);try{const{data:e}=await r.Ay.get("/admin/settings");t(e.aria_voice_en||c.ZI),p(e.aria_voice_ar||"ar-SA-ZariyahNeural")}catch{}finally{k(!1)}})(),(0,m.q3)(),(0,m.M4)(e=>S(e))},[]);const L=(0,c.r9)("en"),C=(0,c.r9)("ar"),[U,M]=(0,s.useState)(c.ZI),E=c.SQ.find(e=>e.id===U)||{},F=(e,t)=>{t!==b.current&&(u("ar"===t?c.J2:c.Tp),b.current=t),M(e)},[B,_]=(0,s.useState)("");return(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"font-mono-accent text-xs text-[#0052FF] mb-2",children:"ARIA"}),(0,h.jsx)("h1",{className:"font-display font-black text-4xl text-[#0A1128] mb-2",children:"Voice Lab"}),(0,h.jsx)("p",{className:"text-[#0B1529]/60 text-sm mb-8",children:"Studio-grade neural voices. English via Piper (free, in-browser). Arabic via edge-tts (server-side, native Arabic female voices). Arabic voices speak Arabic text automatically. Pick and Apply."}),(0,h.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,h.jsxs)("div",{className:"bg-white border border-[#0A1128]/10 rounded-2xl p-6",children:[(0,h.jsxs)("div",{className:"font-display font-bold text-[#0A1128] mb-4 flex items-center gap-2",children:[(0,h.jsx)(d.A,{className:"w-4 h-4"})," English Voices"]}),w?(0,h.jsx)("div",{className:"text-sm text-[#0B1529]/50",children:"Loading\u2026"}):(0,h.jsx)("div",{className:"grid grid-cols-2 gap-2 max-h-[280px] overflow-y-auto pr-1",children:L.map(a=>(0,h.jsxs)("button",{onClick:()=>{t(a.id),F(a.id,"en")},className:"text-left px-3 py-2 rounded-xl border text-sm "+(e===a.id?"border-[#0052FF] bg-[#0052FF]/10":"border-[#0A1128]/10 hover:bg-[#0A1128]/5"),children:[(0,h.jsx)("div",{className:"font-medium text-[#0A1128]",children:a.label}),(0,h.jsxs)("div",{className:"text-[10px] text-[#0B1529]/50",children:[a.gender," \xb7 ",a.tone]})]},a.id))})]}),(0,h.jsxs)("div",{className:"bg-white border border-[#0A1128]/10 rounded-2xl p-6",children:[(0,h.jsxs)("div",{className:"font-display font-bold text-[#0A1128] mb-4 flex items-center gap-2",children:[(0,h.jsx)(d.A,{className:"w-4 h-4"})," Arabic Voices"]}),w?(0,h.jsx)("div",{className:"text-sm text-[#0B1529]/50",children:"Loading\u2026"}):(0,h.jsx)("div",{className:"flex flex-col gap-2",children:C.map(e=>(0,h.jsxs)("button",{onClick:()=>{p(e.id),F(e.id,"ar")},className:"text-left px-3 py-2 rounded-xl border text-sm "+(a===e.id?"border-[#0052FF] bg-[#0052FF]/10":"border-[#0A1128]/10 hover:bg-[#0A1128]/5"),children:[(0,h.jsx)("div",{className:"font-medium text-[#0A1128]",children:e.label}),(0,h.jsxs)("div",{className:"text-[10px] text-[#0B1529]/50",children:[e.gender," \xb7 ",e.tone]})]},e.id))}),(0,h.jsx)("div",{className:"mt-2 text-[10px] text-[#0B1529]/40",children:"Microsoft Neural TTS (server-side)"})]})]}),(0,h.jsxs)("div",{className:"mt-6 bg-white border border-[#0A1128]/10 rounded-2xl p-6",children:[(0,h.jsx)("div",{className:"font-display font-bold text-[#0A1128] mb-4",children:"Preview"}),(0,h.jsx)("textarea",{value:v,onChange:e=>u(e.target.value),rows:4,className:"w-full px-4 py-3 rounded-xl border border-[#0A1128]/10 text-sm mb-4","data-testid":"voice-test-text"}),(0,h.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,h.jsxs)("button",{onClick:async()=>{const e=c.SQ.find(e=>e.id===U)||{};_("");try{if(y(!0),"edge-tts"===e.engine){const t=await(0,x.qx)(v,{voice:e.id,language:"ar-SA"});if(!t)throw new Error("No audio returned");const a=URL.createObjectURL(t),s=new Audio(a);s.onended=()=>URL.revokeObjectURL(a),s.onerror=()=>URL.revokeObjectURL(a),await s.play()}else{const e=await(0,x.generate)(v,{voice:U,lang:"en-US"});if(e){const t=URL.createObjectURL(e),a=new Audio(t);a.onended=()=>URL.revokeObjectURL(t),a.onerror=()=>URL.revokeObjectURL(t),await a.play()}}}catch(t){console.error("Voice Lab test failed:",t);const e=(null===t||void 0===t?void 0:t.stack)||(null===t||void 0===t?void 0:t.message)||String(t);_(e),i.oR.error("Preview failed \u2014 see error box below")}finally{y(!1)}},disabled:g||"edge-tts"!==(null===E||void 0===E?void 0:E.engine)&&!R,className:"btn-primary","data-testid":"voice-test",children:[(0,h.jsx)(n,{className:"w-4 h-4"})," ",g?"Playing\u2026":"edge-tts"===(null===E||void 0===E?void 0:E.engine)||R?"Test voice":"Warming up\u2026"]}),!R&&"edge-tts"!==(null===E||void 0===E?void 0:E.engine)&&(0,h.jsx)("span",{className:"text-xs text-amber-600 animate-pulse",children:"Downloading voice model\u2026"})]}),(0,h.jsxs)("div",{className:"mt-4 text-xs text-[#0B1529]/50",children:["Selected: ",(0,h.jsx)("span",{className:"font-mono",children:U}),(0,h.jsx)("span",{className:"ml-2 text-[10px] uppercase",children:"edge-tts"===(null===E||void 0===E?void 0:E.engine)?"
2server":"Piper"})]}),B&&(0,h.jsx)("pre",{className:"mt-3 max-h-48 overflow-auto rounded-lg bg-[#0A1128] text-red-300 text-[11px] p-3 whitespace-pre-wrap","data-testid":"voice-error",children:B})]}),(0,h.jsxs)("div",{className:"mt-6 grid md:grid-cols-2 gap-4",children:[(0,h.jsxs)("div",{className:"bg-white border border-[#0A1128]/10 rounded-2xl p-6 flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"text-sm text-[#0A1128]/70",children:[(0,h.jsx)(l.A,{className:"w-4 h-4 inline mr-2"}),"Apply ",(0,h.jsx)("span",{className:"font-mono",children:e})," (EN)"]}),(0,h.jsxs)("button",{onClick:async()=>{A(!0);try{await r.Ay.put("/admin/settings",{aria_voice_en:e}),i.oR.success("English voice applied site-wide")}catch{i.oR.error("Could not save English voice settings.")}finally{A(!1)}},disabled:f,className:"btn-primary","data-testid":"voice-apply-en",children:[(0,h.jsx)(o.A,{className:"w-4 h-4"})," ",f?"Saving\u2026":"Apply EN"]})]}),(0,h.jsxs)("div",{className:"bg-white border border-[#0A1128]/10 rounded-2xl p-6 flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"text-sm text-[#0A1128]/70",children:[(0,h.jsx)(l.A,{className:"w-4 h-4 inline mr-2"}),"Apply ",(0,h.jsx)("span",{className:"font-mono",children:a||"ar-SA-ZariyahNeural"})," (AR)"]}),(0,h.jsxs)("button",{onClick:async()=>{j(!0);try{await r.Ay.put("/admin/settings",{aria_voice_ar:a}),i.oR.success("Arabic voice applied site-wide")}catch{i.oR.error("Could not save Arabic voice settings.")}finally{j(!1)}}
2,disabled:N,className:"btn-primary","data-testid":"voice-apply-ar",children:[(0,h.jsx)(o.A,{className:"w-4 h-4"})," ",N?"Saving\u2026":"Apply AR"]})]})]})]})}},7784(e,t,a){a.d(t,{A:()=>o});var s=a(5043);const r=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.filter((e,t,a)=>Boolean(e)&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()},d=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(0,s.forwardRef)((e,t)=>{let{color:a="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:x,iconNode:m,...h}=e;return(0,s.createElement)("svg",{ref:t,...n,width:r,height:r,stroke:a,strokeWidth:o?24*Number(l)/Number(r):l,className:i("lucide",c),...!x&&!d(h)&&{"aria-hidden":"true"},...h},[...m.map(e=>{let[t,a]=e;return(0,s.createElement)(t,a)}),...Array.isArray(x)?x:[x]])}),o=(e,t)=>{const a=(0,s.forwardRef)((a,d)=>{let{className:n,...o}=a;return(0,s.createElement)(l,{ref:d,iconNode:t,className:i(`lucide-${c=r(e),c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o});var c});return a.displayName=r(e),a}},2874(e,t,a){const s=(0,a(7784).A)("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);a.d(t,["A",0,s])},1(e,t,a){const s=(0,a(7784).A)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);a.d(t,["A",0,s])},8693(e,t,a){const s=(0,a(7784).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);a.d(t,["A",0,s])}}]);
3//# sourceMappingURL=7823.ea5e27e8.chunk.js.map

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.