1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[67860],{9282:()=>{},16974:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(95155);r(9282);var l=r(12115),a=r(47650);function s(e){let{text:t,side:r="top",maxWidth:s=240,ariaLabel:i}=e,[o,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(!1),f=(0,l.useId)(),p=(0,l.useRef)(null),[g,h]=(0,l.useState)({top:0,left:0,flipBelow:!1});return(0,l.useEffect)(()=>d(!0),[]),(0,l.useEffect)(()=>{if(!o||!p.current)return;let e=()=>{let e=p.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,l="bottom"===r,a=!l&&e.top<140,i=l&&e.bottom>n-140,o=l?!i:a,c=e.left+e.width/2,u=Math.min(s,t-16)/2,d=Math.max(8+u,Math.min(t-8-u,c));h({top:o?e.bottom+6:e.top-6,left:d,flipBelow:o})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[o,r,s]),(0,n.jsxs)("span",{"data-sx":"sx-29bee6cc60",className:"vms-hdot-wrap",children:[(0,n.jsx)("button",{"data-sx":"sx-e95f75c154",ref:p,type:"button",className:"vms-hdot-trigger","aria-label":null!=i?i:t,"aria-describedby":o?f:void 0,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),onClick:e=>{e.preventDefault(),c(e=>!e)},onKeyDown:e=>{"Escape"===e.key&&c(!1)},children:"?"}),u&&o&&(0,a.createPortal)((0,n.jsx)("span",{"data-sx":"sx-b23f4cb234",id:f,role:"tooltip",className:"vms-hdot-tip",style:{top:g.top,left:g.left,transform:g.flipBelow?"translateX(-50%)":"translate(-50%, -100%)",maxWidth:s,zIndex:0x7fffffff},children:t}),document.body)]})}},22757:(e,t,r)=>{"use strict";r.d(t,{ah:()=>i});var n=r(95155),l=r(12115),a=r(96195);function s(e){return e.hasMore&&!e.isLoadingMore&&!e.pending&&e.hasLoadMore}function i(e){let{items:t,renderItem:r,isLoading:i=!1,error:o=null,emptyState:c=null,hasMore:u=!1,isLoadingMore:d=!1,loadMore:f,loadNewer:p,tailEvicted:g=!1,visible:h=!0,copyOnSelect:v=!0,estimateSize:m=96,overscan:x=8,apiRef:b,children:y,afterFeed:w,persistentTail:I,loadingLabel:k="Loading conversationâ¦",loadingMoreLabel:C="Loading earlier messagesâ¦"}=e,E=(0,l.useRef)(null),S=(0,l.useRef)(!0),T=(0,l.useRef)(null),R=(0,l.useRef)(!1),j=(0,l.useCallback)(()=>{let e=E.current;if(!e||0===e.clientHeight)return;let t=e.scrollHeight-e.clientHeight;1>Math.abs(e.scrollTop-t)||(R.current=!0,e.scrollTop=e.scrollHeight)},[]);(0,l.useEffect)(()=>{if(b)return b.current={reAnchor:()=>{S.current=!0,j()}},()=>{b.current=null}},[b,j]);let L=(0,l.useRef)(h);L.current=h;let _=(0,l.useRef)(null),A=(0,l.useCallback)(e=>{var t;if(T.current=e,null==(t=_.current)||t.disconnect(),_.current=null,e&&"undefined"!=typeof ResizeObserver){let t=new ResizeObserver(()=>{S.current&&L.current&&j()});t.observe(e),_.current=t}},[j]);(0,l.useEffect)(()=>()=>{var e;return null==(e=_.current)?void 0:e.disconnect()},[]);let M=(0,a.Te)({count:t.length,getScrollElement:()=>E.current,estimateSize:()=>m,overscan:x,getItemKey:e=>{var r,n;return null!=(n=null==(r=t[e])?void 0:r.id)?n:e}}),N=(0,l.useRef)(null),z=(0,l.useRef)(!1),W=(0,l.useCallback)(()=>{var e;let t=E.current;if(!t)return;let r=M.getVirtualItems(),n=t.scrollTop,l=null!=(e=r.find(e=>e.start+e.size>n))?e:r[0];N.current=l?{key:String(l.key),gap:l.start-n}:null},[M]),H=(0,l.useRef)("");(0,l.useEffect)(()=>{if(!v||"undefined"==typeof document)return;let e=null,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{try{var e,t;let r=window.getSelection();if(!r||r.isCollapsed)return;let n=r.toString();if(!n.trim()||n===H.current||r.anchorNode&&E.current&&!E.current.contains(r.anchorNode)||r.focusNode&&E.current&&!E.current.contains(r.focusNode))return;H.current=n;let l=window.supraosDesktop;(null==l||null==(e=l.clipboard)?void 0:e.writeText)?l.clipboard.writeText(n):null==(t=navigator.clipboard)||t.writeText(n).catch(()=>{})}catch(e){}},600)};return document.addEventListener("selectionchange",t),()=>{e&&clearTimeout(e),document.removeEventListener("selectionchange",t)}},[v]);let V=(0,l.useCallback)(()=>{f&&(z.current=!0,W(),f())},[f,W]);(0,l.useEffect)(()=>{d||(z.current=!1,N.current=null)},[d]),(0,l.useEffect)(()=>
1{if(!h)return;let e=E.current;e&&e.clientHeight>0&&e.scrollHeight<=e.clientHeight+400&&s({hasMore:u,isLoadingMore:d,pending:z.current,hasLoadMore:!!f})&&V()},[t,u,d,h,f,V]);let P=(0,l.useCallback)(()=>{let e=E.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;R.current?(R.current=!1,S.current=!0):S.current=t<80,e.scrollTop<400&&s({hasMore:u,isLoadingMore:d,pending:z.current,hasLoadMore:!!f})&&V(),t<400&&g&&!d&&p&&p()},[u,d,g,f,p,V]);(0,l.useLayoutEffect)(()=>{let e=E.current;if(!e||0===e.clientHeight)return;let r=N.current;if(r){let l=t.findIndex(e=>e.id===r.key);if(l>=0){var n;let t=null==(n=M.getOffsetForIndex)?void 0:n.call(M,l,"start"),a=Array.isArray(t)?t[0]:void 0;"number"==typeof a&&(e.scrollTop=Math.max(0,a-r.gap))}N.current=null,z.current=!1;return}S.current&&j()},[t,M,j]),(0,l.useLayoutEffect)(()=>{h&&S.current&&j()},[h,j]);let B=M.getVirtualItems();return(0,n.jsxs)("div",{"data-sx":"sx-96f56f5b03",ref:E,onScroll:P,style:{flex:1,overflowY:"auto",background:"var(--bg)",position:"relative"},children:[i&&(0,n.jsx)("div",{"data-sx":"sx-4db3e85b59",style:{padding:"40px 32px",textAlign:"center",color:"var(--t2)",fontSize:"var(--vms-fs-13)",fontStyle:"italic"},children:k}),o&&(0,n.jsxs)("div",{"data-sx":"sx-6e702c431c",style:{maxWidth:780,margin:"20px auto",padding:"14px 18px",background:"var(--rM)",border:"1px solid var(--rBd)",borderRadius:"var(--vms-radius-card)",color:"var(--r)",fontSize:"var(--vms-fs-13-5)",fontWeight:500},children:["Couldn't load messages: ",o.message]}),!i&&!o&&0===t.length&&c,!i&&!o&&t.length>0&&(0,n.jsxs)(n.Fragment,{children:[u&&!d&&f&&(0,n.jsx)("div",{"data-sx":"sx-6439203e05",style:{display:"flex",justifyContent:"center",padding:"10px 0 4px"},children:(0,n.jsx)("button",{"data-sx":"sx-3277d9d086",type:"button",onClick:V,"aria-label":"Load earlier messages",style:{font:"inherit",fontSize:"var(--vms-fs-13)",padding:"6px 14px",borderRadius:"var(--vms-radius-control)",border:"1px solid var(--border, #ccc)",background:"var(--vms-surface, transparent)",color:"var(--t2)",cursor:"pointer"},children:"Load earlier messages"})}),d&&!g&&(0,n.jsx)("div",{"data-sx":"sx-2cba699826",style:{position:"sticky",top:0,zIndex:2,textAlign:"center",padding:"8px 0",color:"var(--t2)",fontSize:"var(--vms-fs-12)",fontStyle:"italic",pointerEvents:"none"},children:C}),(0,n.jsxs)("div",{"data-sx":"sx-294beccc96",ref:A,style:{paddingTop:12,paddingBottom:12},children:[(0,n.jsx)("div",{"data-sx":"sx-1cbe589370",style:{height:M.getTotalSize(),width:"100%",position:"relative"},children:B.map(e=>{let l=t[e.index];return l?(0,n.jsx)("div",{"data-sx":"sx-d48a2c5890","data-index":e.index,ref:M.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:"translateY("+e.start+"px)"},children:r(l,e.index)},e.key):null})}),y,w]})]}),I]})}},24166:(e,t,r)=>{"use strict";r.d(t,{U:()=>s,i:()=>i});let n=/<\/?(?:verdict|delta|phase)\b/i,l=/<\/(?:verdict|delta|phase)\s*>/gi,a=/(```[\s\S]*?```)/g;function s(e){let t=null!=e?e:"";if(!n.test(t))return t;let r=(t=t.split("\0").join("")).split(a),s=1===r.length,i=!1,o=r.map(e=>{if(e.startsWith("```"))return e;let t=function(e,t){if(!n.test(e))return e;let r=e;for(let e=0;e<4;e++){let e=r.replace(RegExp("<(verdict|delta|phase)\\b[^>\\n]{0,300}(?:\\/>|>(?:(?!<\\/?(?:verdict|delta|phase)\\b)[\\s\\S])*?<\\/\\1\\s*>)","gi"),"\0");if(e===r)break;r=e}if(!(r=r.replace(l,"\0")).includes("\0"))return e;let a=r.split("\n"),s=[];for(let e of a){if(!e.includes("\0")){s.push(e);continue}e.split("\0").join("").trim()&&s.push(e.split(/[ \t]*\u0000[ \t]*/).filter(e=>e.length>0).join(" ").replace(/[ \t]+$/,""))}let i=s.join("\n").replace(/\n{3,}/g,"\n\n");return t?i.replace(/^\n+/,"").replace(/\s+$/,""):i}(e,s);return t!==e&&(i=!0),t});return i?o.join("").replace(/^\n+/,"").replace(/\s+$/,""):t}function i(e){var t;let r=s(e),n=r.match(/<(?:verdict|delta|phase)\b[^>\n]{0,300}>(?:(?!<\/?(?:verdict|delta|phase)\b)[\s\S])*$/i);n&&void 0!==n.index&&!n[0].includes("\n\n")&&(r=r.slice(0,n.index).replace(/\s+$/,""));let l=r.lastIndexOf("<");if(-1===l||-1!==r.indexOf(">",l))return r;let a=r.slice(l+1);a.startsWith("/")&&(a=a.slice(1));let i=(null!=(t=a.match(/^[a-zA-Z]*/))?t:[""])[0].toLowerCase(),o=/^(?:verdict|delta|phase)\b/i.test(a),c=a===i&&("verdict".startsWith(i)||"delta".startsWith(i)||"phase".startsWith(i));return o||c?r.slice(0,l).replace(/[ \t]+$/,""):r}},42599:(e,t,r)=>{"use strict";r.d(t,{CP:()=>c.C,Io:()=>o.Io,PF:()=>s.PF,VJ:()=>a.VJ,ZC:()=>s.ZC,Zk:()=>s.Zk,_L:()=>l._L,aE:()=>s.aE,ah:()=>n.ah,do:()=>a.do,h3:()=>a.h3,jW:()=>c.j,p0:()=>i.p0});var n=r(22757),l=r(82027),a=r(23866),s=r(21246);r(10025);var i=r(87019),o=r(21693);r(16080);var c=r(61656)},48643:(e,t,r)=>{"use strict";r.d(t,{C:()=>i});var n=r(38638),l=r(24103),a=r(33577);let s=new WeakMap;function i(e,t){var r;let i=t&&s.get(t);if(i)return i;let o=l.useActiveDashboardStore.getState(),c={agentScope:null!=(r=null==t?void 0:t.scope)?r:(0,n.Tj)(e),activeDashboardId:o.dashboardId,lastWidgetId:o.lastChartWidgetId,moneyDashboardDraft:(0,a.kR)(e)};return t&&s.set(t,c),c}},78060:(e,t,r)=>{"use strict";r.d(t,{bW:()=>n,bf:()=>l,tV:()=>a});let n="sent_attachment_previews";function l(e){let t=[];for(let n of null!=e?e:[]){var r;let e=null!=(r=n.thumb)?r:null;t.push({name:n.name,kind:n.kind,url:e})}return t}function a(e){let t=null==e?void 0:e[n];if(!Array.isArray(t)){let t=null==e?void 0:e.sent_attachments;return Array.isArray(t)?t.flatMap(e=>{var t,r;if(!e||"object"!=typeof e)return[];let n=(null!=(t=e.mime)?t:"").toLowerCase(),l=n.startsWith("image/")||"image"===e.kind?"image":"application/pdf"===n||"pdf"===e.kind||"document"===e.kind?"pdf":"file";return[{name:e.filename||e.storagePath&&e.storagePath.split("/").pop()||"file",kind:l,url:"image"===l&&null!=(r=e.url)?r:null}]}):[]}return t.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.name&&(null===e.url||"string"==typeof e.url))}},95325:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(48643),l=r(12115),a=r(38638),s=r(18611);function i(e){let[t,i]=(0,l.useState)("off"),[o,c]=(0,l.useState)("stopped"),u=(0,l.useRef)("stopped"),d=(0,l.useRef)(null),f=(0,l.useRef)(0),p=(0,l.useRef)(null),g=(0,l.useRef)(!1),h=(0,l.useRef)(e.address),v=(0,l.useRef)(e);v.current=e;let m=(0,l.useCallback)(e=>{var t,r;i(e),null==(t=(r=v.current).onStateChange)||t.call(r,e)},[]),x=(0,l.useCallback)(()=>{f.current+=1,p.current=null,g.current=!1;try{var e;
1null==(e=d.current)||e.disconnect()}catch(e){}d.current=null,u.current="stopped",c("stopped"),m("off")},[m]);return(0,l.useEffect)(()=>{let t=h.current;h.current=e.address,t&&t!==e.address&&x()},[e.address,x]),(0,l.useEffect)(()=>{let e=()=>x();return window.addEventListener(s.Vg,e),()=>window.removeEventListener(s.Vg,e)},[x]),{start:(0,l.useCallback)(async()=>{var e,l,s,i,o;let h=v.current;if(!h.address||d.current||"connecting"===t)return;let x=++f.current,b=!1,y=!1;u.current="stopped",c("stopped"),m("connecting");try{let{startConversation:t}=await Promise.all([r.e(48944),r.e(10748)]).then(r.bind(r,10748)),{VMS_VOICE_SYSTEM_SUFFIX:i}=await r.e(48944).then(r.bind(r,48944));if(x!==f.current)return;let o={onTranscript:(e,t)=>{var r,n,l,a;x===f.current&&("input"===t?null==(r=(n=v.current).onUserSpeech)||r.call(n,e):null==(l=(a=v.current).onAgentSpeech)||l.call(a,e))},onTurnComplete:()=>{var e,t;x===f.current&&(null==(e=(t=v.current).onTurnComplete)||e.call(t))},onInterrupted:()=>{var e,t;x===f.current&&(null==(e=(t=v.current).onInterrupted)||e.call(t))},onToolCall:async(e,t,l)=>{var s,i,o,c,u,d,h,m;if(x!==f.current)return{error:"Voice session cancelled."};let b=v.current;if("ask_vms_agent"===e){if(!b.address)return{error:"Connect your wallet before sending."};let e=String(null!=(s=t.query)?s:""),l={text:e,voiceMode:!0,agentId:b.agentId,...b.contextId?{contextId:b.contextId}:{},...b.conversationId?{conversationId:b.conversationId}:{}},i=p.current;try{let e=!!(i&&i.matches(l)&&(0,a.CT)(i.scope,b.address));if(g.current&&!e)return{result:"Already processing your request, please wait."};e||(p.current=i=(0,a.bu)((0,a.Tj)(b.address),l))}catch(e){return{result:e instanceof Error?e.message:"Connect your wallet before sending."}}if(!i)return{error:"Connect your wallet before sending."};let o=(0,n.C)(b.address,i);g.current=!0;let{askVmsAgent:c}=await r.e(34493).then(r.bind(r,1636));if(x!==f.current)return g.current=!1,{error:"Voice session cancelled."};let u=!1;try{let r=await c(e,{address:b.address,agentId:b.agentId,conversationId:b.conversationId,chatThreadId:b.chatThreadId,contextId:b.contextId,pathname:b.pathname,onStatus:b.onStatus,onNavigate:b.onNavigate,originalSubmission:i,dashboardContext:o,onTurn:()=>{u=!0}},{isBuildRequest:!!t.is_build_request});return(u||r===a.E_)&&p.current===i&&(p.current=null),{result:r}}finally{g.current=!1}}if("navigate_to"===e&&t.path)return null==(i=b.onNavigate)||i.call(b,t.path,null!=(c=null!=(o=t.highlight_section_id)?o:t.sectionId)?c:null,null!=(u=t.reason)?u:null),{success:!0};if("switch_agent"===e&&t.agentName)return null!=(h=null==(d=b.onHandoff)?void 0:d.call(b,t.agentName))&&h?{result:"Handing off to ".concat(t.agentName,".")}:{result:"I couldn't hand off to \"".concat(t.agentName,'" from here.')};if("send_chat_message"===e&&t.text)return null==(m=b.onAgentMessage)||m.call(b,t.text),{success:!0};if(b.extraTools){let r=await b.extraTools(e,t,l);if(void 0!==r)return r}return{error:"unknown"}},onMicrophoneStateChange:e=>{x===f.current&&(u.current=e,c(e),"error"===e?(b=!0,d.current=null,m("error")):"active"===e?m("listening"):"pending"===e&&m("connecting"))},onError:e=>{var t,r;x===f.current&&(console.warn("[useAgentVoice] error:",e),null==(t=(r=v.current).onError)||t.call(r,e))},onStateChange:e=>{var t,r;x===f.current&&(null==(t=(r=v.current).onRawStateChange)||t.call(r,e),x===f.current&&("listening"===e||"speaking"===e?b||m("active"===u.current?"listening":"connecting"):"connecting"===e||"connected"===e?b||m("connecting"):"disconnected"===e&&(y=!0,d.current=null,b||m("off"))))}},w=o;if(!1!==h.persist&&h.address){let{withVoicePersistence:t}=await r.e(87174).then(r.bind(r,87174)),{authFetch:n}=await Promise.resolve().then(r.bind(r,71247));w=t(o,{address:h.address,getAgentId:null!=(e=h.getPersistAgentId)?e:()=>h.agentId,source:null!=(l=h.persistSource)?l:"voice",authedFetch:(e,t)=>n(e,{address:h.address,method:t.method,body:t.body})})}if(x!==f.current)return;let I=await t({address:h.address,agentId:h.agentId,agentName:h.agentName,systemPrompt:h.systemPrompt+i,enableTools:h.enableTools,callbacks:w,conversationId:null!=(s=h.conversationId)?s:null});if(x!==f.current||b||y){try{I.disconnect()}catch(e){}return}d.current=I}catch(t){if(x!==f.current)return;console.warn("[useAgentVoice] start failed:",t),d.current=null;let e=t instanceof Error&&t.message.trim()?t.message:"Voice could not connect. Try again or type your idea.";null==(i=(o=v.current).onError)||i.call(o,e),m("error")}},[t,m]),stop:x,sendText:(0,l.useCallback)(e=>{try{var t;null==(t=d.current)||t.sendText(e)}catch(e){}},[]),state:t,microphoneState:o,active:"off"!==t&&"error"!==t}}}}]);
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.