1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5728],{5728:function(e,t,a){var n=a(7437),i=a(2265),r=a(2213);let s=()=>/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),l=()=>{let e=navigator.userAgent.toLowerCase(),t=/android [1-4]/.test(e),a=/os [1-9]_/.test(e),n=navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=2;return t||a||n},o=[{base:"linear-gradient(135deg, #f97316 0%, #fbbf24 45%, #fde047 100%)",glow:"linear-gradient(135deg, rgba(249,115,22,0.5) 0%, rgba(251,191,36,0.35) 45%, rgba(253,224,71,0.25) 100%)"},{base:"linear-gradient(135deg, #34d399 0%, #22d3ee 45%, #60a5fa 100%)",glow:"linear-gradient(135deg, rgba(52,211,153,0.5) 0%, rgba(34,211,238,0.35) 45%, rgba(96,165,250,0.25) 100%)"},{base:"linear-gradient(135deg, #a855f7 0%, #6366f1 45%, #3b82f6 100%)",glow:"linear-gradient(135deg, rgba(168,85,247,0.5) 0%, rgba(99,102,241,0.35) 45%, rgba(59,130,246,0.25) 100%)"},{base:"linear-gradient(135deg, #f472b6 0%, #fb7185 45%, #fb923c 100%)",glow:"linear-gradient(135deg, rgba(244,114,182,0.5) 0%, rgba(251,113,133,0.35) 45%, rgba(251,146,60,0.25) 100%)"},{base:"linear-gradient(135deg, #22d3ee 0%, #38bdf8 45%, #818cf8 100%)",glow:"linear-gradient(135deg, rgba(34,211,238,0.5) 0%, rgba(56,189,248,0.35) 45%, rgba(129,140,248,0.25) 100%)"},{base:"linear-gradient(135deg, #fb7185 0%, #f97316 45%, #facc15 100%)",glow:"linear-gradient(135deg, rgba(251,113,133,0.5) 0%, rgba(249,115,22,0.35) 45%, rgba(250,204,21,0.25) 100%)"},{base:"linear-gradient(135deg, #38bdf8 0%, #818cf8 45%, #c084fc 100%)",glow:"linear-gradient(135deg, rgba(56,189,248,0.5) 0%, rgba(129,140,248,0.35) 45%, rgba(192,132,252,0.25) 100%)"},{base:"linear-gradient(135deg, #f59e0b 0%, #fde047 45%, #86efac 100%)",glow:"linear-gradient(135deg, rgba(245,158,11,0.5) 0%, rgba(253,224,71,0.35) 45%, rgba(134,239,172,0.25) 100%)"}],u=()=>{try{let e=document.createElement("canvas");return!!(e.getContext("webgl2")||e.getContext("webgl"))}catch(e){return!1}},d=i.memo(e=>{let{isRecording:t=!1,isSpeaking:a=!1,isAISpeaking:d=!1,isProcessing:c=!1,isConnecting:g=!1,isSleeping:v=!1,size:b=128,color:m=7,customRgb:h,isTransitioning:f=!1,audioAmplitude:p=0}=e,[w,M]=i.useState(0),[S,y]=i.useState(0),[R,I]=i.useState(0),[x,E]=i.useState(!1),[k,_]=i.useState(!1),A=i.useRef(null);i.useEffect(()=>_(!0),[]);let C=(0,i.useMemo)(()=>{var e,t,a,n;let i=new Set,r=e=>{if(!e)return;let t=String(e).trim();if(t){if("/"===t||""===t){i.add("");return}t.startsWith("http"),i.add(t.replace(/\/$/,""))}};r(window.VENBIT_CDN_URL);try{let e=null===(n=document.currentScript)||void 0===n?void 0:n.src;if(!e){let t=Array.from(document.getElementsByTagName("script")).find(e=>e.src&&e.src.includes("venbit-site-agent.js"));e=null==t?void 0:t.src}if(e){let t=new URL(e,window.location.href),a=t.pathname.split("/");a.pop();let n=a.join("/"),i=n?"".concat(t.origin).concat(n):t.origin;r(i),n&&!n.endsWith("/dist")&&r("".concat(i,"/dist"))}}catch(e){}return r(null===(e=({}).env)||void 0===e?void 0:e.VITE_PUBLIC_CDN_URL),r(null===(t=({}).env)||void 0===t?void 0:t.VITE_VENBIT_CDN_URL),r(null===(a=({}).env)||void 0===a?void 0:a.BASE_URL),r("https://www.venbit.ai"),r(""),Array.from(i)},[]),N=(0,i.useMemo)(()=>{let e=window.VENBIT_ORB_SOURCES;if(Array.isArray(e))return e.filter(Boolean).map(e=>String(e))},[]),j=(0,i.useMemo)(()=>{let e=window.VENBIT_RIVE_WASM_SOURCES;if(Array.isArray(e))return e.filter(Boolean).map(e=>String(e))},[]),L=(0,i.useMemo)(()=>{let e=C.map(e=>e?"".concat(e.replace(/\/$/,""),"/orb/orb-1.2.riv"):"/orb/orb-1.2.riv");return(null==N?void 0:N.length)&&N.forEach(t=>e.push(t)),e.push("/ai-chat-widget/widgets/venbit-voice/orb/orb-1.2.riv"),e.push("/orb/orb-1.2.riv"),e.push("https://www.venbit.ai/orb/orb-1.2.riv"),e.push("https://www.venbit.ai/ai-chat-widget/widgets/venbit-voice/orb/orb-1.2.riv"),Array.from(new Set(["/orb/orb-1.2.riv",...e.filter(Boolean)]))},[C,N]),T=(0,i.useMemo)(()=>{let e=C.map(e=>e?"".concat(e.replace(/\/$/,""),"/rive.wasm"):"/rive.wasm");(null==j?void 0:j.length)&&j.forEach(t=>e.push(t)),e.push("/rive.wasm"),e.push("/ai-chat-widget/widgets/venbit-voice/rive.wasm"),e.push("https://www.venbit.ai/rive.wasm"),e.push("https://www.venbit.ai/ai-chat-widget/widgets/venbit-voice/rive.wasm"),e.push("https://cdn.jsdelivr.net/npm/@rive-app/webgl2@latest/rive.wasm"),e.push("https://cdn.jsdelivr.net/npm/@rive-app/canvas@latest/rive.wasm");let t=null===r.RuntimeLoader||void 0===r.RuntimeLoader?void 0:r.RuntimeLoader.wasmURL;return t&&e.push(t),Array.from(new Set(["/rive.wasm",...e.filter(Boolean)]))},[C,j]),U=L[Math.min(w,L.length-1)]||L[0],B=T[Math.min(S,T.length-1)]||T[0];if((0,i.useEffect)(()=>{u()||E(!0)},[]),B&&(null===r.RuntimeLoader||void 0===r.RuntimeLoader?void 0:r.RuntimeLoader.setWasmUrl)&&A.current!==B)try{r.RuntimeLoader.setWasmUrl(B),A.current=B}catch(e){}let O="default",P=(0,i.useMemo)(()=>s(),[]),V=(0,i.useMemo)(()=>l(),[]);(0,i.useEffect)(()=>{console.log("ManaOrb initialization:",{environment:"production",baseUrl:"/",orbPath:U,wasmUrl:B,isMobile:P,isLowPerformance:V,deviceInfo:{userAgent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory},timestamp:new Date().toISOString()})},[P,V,U,B]);let D=(0,i.useMemo)(()=>{let e={src:U,stateMachines:O,autoplay:!0,onLoad:()=>{E(!1),console.log("ManaOrb loaded successfully",{isMobile:P,isLowPerformance:V,mode:"production",prod:!0,dev:!1})},onLoadError:e=>{console.error("ManaOrb load error:",{error:e,orbPath:U,wasmUrl:B,currentUrl:window.location.href,baseUrl:"/",mode:"production"});let t=!1;if(w<L.length-1&&(L[w+1],M(e=>Math.min(e+1,L.length-1)),t=!0),S<T.length-1&&(T[S+1],y(e=>Math.min(e+1,T.length-1)),t=!0),t){I(e=>e+1);return}E(!0)}};return P||V?(e.fps=V?24:30,e.useOffscreenRenderer=!1,e.shouldResizeCanvasToContainer=!0,e.enableRiveAssetCDN=!1,e.locateFile=void 0):(e.fps=60,e.useOffscreenRenderer=!0),e},[U,B,O,P,V,w,L.length,S,T.length]),{rive:W,RiveComponent:z}=(0,r.useRive)(D),$=(0,r.useStateMachineInput)(W,O,"listening"),F=(0,r.useStateMachineInput)(W,O,"thinking"),q=(0,r.useStateMachineInput)(W,O,"speaking"),G=(0,r.useStateMachineInput)(W,O,"sleeping"),H=(0,r.useStateMachineInput)(W,O,"asleep"),J=(0,r.useStateMachineInput)(W,O,"color"),K=(0,r.useStateMachineInput)(W,O,"colorIndex"),Q=(0,r.useStateMachineInput)(W,O,"palette"),X=(0,r.useStateMachineInput)(W,O,"theme"),Y=(0,r.useStateMachineInput)(W,O,"r"),Z=(0,r.useStateMachineInput)(W,O,"g"),ee=(0,r.useStateMachineInput)(W,O,"b"),et=(0,r.useStateMachineInput)(W,O,"amplitude"),ea=(0,r.useStateMachineInput)(W,O,"intensity"),en=(0,r.useStateMachineInput)(W,O,"volume"),[ei,er]=i.useState("idle"),es=i.useRef(null),[el,eo]=i.useState(0),eu=i.useRef(0),ed=i.useRef(null),ec=(0,i.useMemo)(()=>(console.log("ManaOrb animation state:",{isSleeping:v,isTransitioning:f,isAISpeaking:d,isSpeaking:a,isConnecting:g,isProcessing:c,isRecording:t}),d)?"speaking":a?"listening":g&&!c||c&&!d?"thinking":"idle",[t,a,d,c,g,v,f]);(0,i.useEffect)(()=>(es.current&&clearTimeout(es.current),"speaking"===ec||"listening"===ec?er(ec):es.current=setTimeout(()=>{er(ec)},100),()=>{es.current&&clearTimeout(es.current)}),[ec]),(0,i.useEffect)(()=>
1{if(h){if(Y&&Z&&ee){Y.value=h.r,Z.value=h.g,ee.value=h.b;return}if(W)try{let e=W.artboard;e&&"function"==typeof e.setRgb&&e.setRgb(h.r,h.g,h.b)}catch(e){}return}let e=J||K||Q||X;if(e){let t=Math.max(0,Math.min(9,m));e.value=t}},[m,h,J,K,Q,X,Y,Z,ee,W]),(0,i.useEffect)(()=>(ed.current&&clearInterval(ed.current),"speaking"===ei?ed.current=setInterval(()=>{let e=p||0,t=eu.current,a=Math.max(0,Math.min(1,t+(e-t)*(e>t?.3:.15)+(Math.random()-.5)*.02));eu.current=a,eo(a)},16):(eu.current=0,eo(0)),()=>{ed.current&&clearInterval(ed.current)}),[ei,p]),(0,i.useEffect)(()=>{if("speaking"===ei){let e=et||ea||en;e&&(e.value=el)}},[el,ei,et,ea,en]),(0,i.useEffect)(()=>{let e=()=>{$&&($.value="listening"===ei),F&&(F.value="thinking"===ei),q&&(q.value="speaking"===ei),G&&(G.value=!1),H&&(H.value=!1),console.log("ManaOrb state machine inputs updated:",{animationState:ei,isTransitioning:f,isConnecting:g,isRecording:t,isSpeaking:a,isProcessing:c,isAISpeaking:d,isSleeping:v,isMobile:P,isLowPerformance:V,timestamp:new Date().toISOString(),inputs:{listening:null==$?void 0:$.value,thinking:null==F?void 0:F.value,speaking:null==q?void 0:q.value,sleeping:null==G?void 0:G.value,asleep:null==H?void 0:H.value}})};if(P||V){let t=setTimeout(e,16);return()=>clearTimeout(t)}e()},[ei,f,P,V,$,F,q,G,H]);let eg=(0,i.useMemo)(()=>{let e={width:b,height:b};return P?{...e,imageRendering:"auto",filter:V?"none":void 0}:e},[b,P,V]),ev=(0,i.useMemo)(()=>{let e={width:"100%",height:"100%"};return P||V?{...e,imageRendering:"auto"}:e},[P,V]),eb=(0,i.useMemo)(()=>o[m%o.length],[m]);return k?x?(0,n.jsxs)("div",{className:"relative flex items-center justify-center",style:eg,children:[(0,n.jsx)("div",{className:"absolute inset-0 rounded-full blur-2xl animate-pulse",style:{background:eb.glow,opacity:.85}}),(0,n.jsx)("div",{className:"absolute inset-0 rounded-full animate-[spin_10s_linear_infinite]",style:{background:eb.base,filter:"brightness(1.05)"}}),(0,n.jsx)("div",{className:"absolute inset-[22%] rounded-full blur-xl",style:{background:"radial-gradient(circle, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 75%)"}}),(0,n.jsx)("div",{className:"absolute inset-[34%] rounded-full",style:{background:"radial-gradient(circle at 35% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%)",mixBlendMode:"screen"}}),(0,n.jsx)("div",{className:"relative w-full h-full rounded-full",style:{border:"1px solid rgba(255,255,255,0.25)",boxShadow:"0 22px 48px rgba(59,130,246,0.35)"}})]}):(0,n.jsx)("div",{className:"flex items-center justify-center",style:eg,children:z?(0,n.jsx)(z,{style:ev},"mana-orb-".concat(R,"-").concat(U)):(0,n.jsx)("div",{className:"flex items-center justify-center text-gray-400 text-sm",style:{width:"100%",height:"100%"},children:"Loading orb..."})}):(0,n.jsx)("div",{className:"flex items-center justify-center",style:eg,"aria-hidden":!0})},(e,t)=>{var a,n,i,r,s,l;let o=Math.abs((e.audioAmplitude||0)-(t.audioAmplitude||0))>.05;return e.isRecording===t.isRecording&&e.isSpeaking===t.isSpeaking&&e.isAISpeaking===t.isAISpeaking&&e.isProcessing===t.isProcessing&&e.isConnecting===t.isConnecting&&e.isSleeping===t.isSleeping&&e.size===t.size&&e.color===t.color&&e.isTransitioning===t.isTransitioning&&!o&&(null===(a=e.customRgb)||void 0===a?void 0:a.r)===(null===(n=t.customRgb)||void 0===n?void 0:n.r)&&(null===(i=e.customRgb)||void 0===i?void 0:i.g)===(null===(r=t.customRgb)||void 0===r?void 0:r.g)&&(null===(s=e.customRgb)||void 0===s?void 0:s.b)===(null===(l=t.customRgb)||void 0===l?void 0:l.b)});t.default=d}}]);
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.