it-data-nexus-ui-library 2.9.10 → 2.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionBar.mjs +1 -1
- package/dist/components/AgentChat/AgentChatDialog.mjs +1 -1
- package/dist/components/AgentChat/AgentChatWindow.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/ChatContentFallback.mjs +1 -0
- package/dist/components/AgentChat/ChatComponents/ChatDatapoints.mjs +1 -0
- package/dist/components/AgentChat/ChatComponents/ChatResponseMarkdown.mjs +1 -0
- package/dist/components/AgentChat/ChatComponents/CopyableTableContainer.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/EmptyState.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/MarkdownContent.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/MessageBubble.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/MessageFeedbackBar.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/MessageList.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/SourceCitations.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/StreamingBubble.mjs +1 -1
- package/dist/components/AgentChat/ChatComponents/TypingIndicator.mjs +1 -1
- package/dist/components/AgentChat/ChatHistory.mjs +1 -1
- package/dist/components/AgentChat/ChatHistoryButtonBase.mjs +1 -1
- package/dist/components/AgentChat/ChatInput.mjs +1 -1
- package/dist/components/AgentChat/FABButton.mjs +1 -1
- package/dist/components/AgentChat/WidgetParts/WidgetBody.mjs +1 -1
- package/dist/components/AgentChat/WidgetParts/WidgetInput.mjs +1 -1
- package/dist/components/DateRangeFilter.mjs +1 -1
- package/dist/components/DateRangePicker.mjs +1 -1
- package/dist/components/GlassPaperAsync.mjs +1 -1
- package/dist/components/LoadingSpinnerNexus.mjs +1 -1
- package/dist/components/NexusOrbit.mjs +7 -0
- package/dist/components/PaperAsync.mjs +1 -1
- package/dist/components/ProcessSteps.mjs +1 -0
- package/dist/generated/version.mjs +1 -1
- package/dist/index.d.ts +179 -13
- package/dist/index.mjs +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.mjs +2 -0
- package/dist/utils/chatDatapoints.mjs +1 -0
- package/dist/utils/chatTableHtml.mjs +1 -0
- package/dist/utils/safeMarkdownUrl.mjs +1 -0
- package/package.json +4 -2
- package/dist/components/_Primitives/Box.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useTheme as i,useMediaQuery as r,AppBar as l,Toolbar as o,IconButton as s}from"@mui/material";import c from"@mui/icons-material/ChevronLeft";import a from"@mui/icons-material/Menu";import
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useTheme as i,useMediaQuery as r,AppBar as l,Toolbar as o,IconButton as s}from"@mui/material";import c from"@mui/icons-material/ChevronLeft";import a from"@mui/icons-material/Menu";import d from"@mui/material/Box";import{Stack as m}from"./_Primitives/Stack.mjs";import{NexusHome as f}from"./Logo/NexusHome.mjs";import{ThemeToggle as x}from"./Theme/ThemeToggle.mjs";import h from"./Logo/NexusLogo.mjs";import{ActionBarTitle as p}from"./Typography.mjs";import{useRef as u,useState as g,useEffect as w}from"react";const y=({title:y,extraLeft:v,extraRight:C,rightActions:I,homeHref:b,showHome:j=!0,logo:z,mobileNavigation:R})=>{const k=z??e(h,{}),B=i(),L=r(B.breakpoints.up("lg")),E=u(null),[M,T]=g(49),A=u(null),S=u(null),H=u(null),O=u(null),N=u(null),$=u(null),[D,W]=g(null),[X,P]=g(null);return w(()=>{const e=E.current;if(!e)return;const n=()=>T(e.getBoundingClientRect().height);n();const t=window.ResizeObserver;if(!t)return;const i=new t(n);return i.observe(e),()=>i.disconnect()},[]),w(()=>{if(!L)return W(null),void P(null);function e(){const e=S.current,n=H.current,t=A.current,i=O.current,r=N.current,l=$.current;if(!e||!n||!t)return;const o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),c=t.getBoundingClientRect();if(i){const e=i.getBoundingClientRect().width||0,n=(o.right+s.left)/2,t=o.right+e/2+8,r=s.left-e/2-8,l=Math.min(Math.max(n,t),r);W(l-c.left)}else W(null);if(r&&l){const e=r.getBoundingClientRect().width||0,n=l.getBoundingClientRect(),t=(s.right+n.left)/2,i=s.right+e/2+8,o=n.left-e/2-8,a=Math.min(Math.max(t,i),o);P(a-c.left)}else P(null)}e(),window.addEventListener("resize",e);let n=null;const t=window.ResizeObserver;return t&&(n=new t(e),A.current&&n.observe(A.current)),()=>{window.removeEventListener("resize",e),n&&n.disconnect()}},[L,v,C]),n(t,{children:[e(l,{position:"sticky",component:"header",color:"inherit",elevation:0,ref:E,sx:{zIndex:{xs:B.zIndex.appBar,sm:B.zIndex.drawer+1},[B.breakpoints.up("sm")]:{position:"fixed"}},children:n(o,{variant:"dense",sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:{lg:"center"},py:{xs:.5,lg:0}},children:[n(m,{direction:"row",sx:{display:{xs:"grid",sm:"none"},gridTemplateColumns:"minmax(72px, 1fr) minmax(0, auto) minmax(72px, 1fr)",alignItems:"center",width:"100%",minHeight:40,"& .MuiIconButton-root":{padding:"4px"},"& svg":{fontSize:"1.1rem"}},children:[e(d,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:R&&e(s,{ref:R.buttonRef,onClick:R.onToggle,size:"small","aria-label":R.open?"Close navigation":"Open navigation","aria-expanded":R.open,children:R.open?e(c,{fontSize:"small"}):e(a,{fontSize:"small"})})}),e(p,{noWrap:!0,sx:{minWidth:0,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},children:y}),n(m,{direction:"row",sx:{justifyContent:"flex-end",alignItems:"center"},children:[I,j&&e(f,{href:b}),e(x,{})]})]}),(v||C)&&n(m,{direction:"row",sx:{display:{xs:"flex",sm:"none"},justifyContent:"center",alignItems:"center",gap:1,width:"100%",mt:1},children:[v,C]}),n(m,{sx:{display:{xs:"none",sm:"flex",lg:"none"},width:"100%"},spacing:.5,children:[n(m,{direction:"row",sx:{alignItems:"center",width:"100%"},children:[e(d,{sx:{flex:1,display:"flex",alignItems:"center"},children:e(d,{sx:{height:"38px",pt:.5},children:k})}),e(p,{children:y}),n(m,{direction:"row",sx:{flex:1,justifyContent:"flex-end",alignItems:"center",gap:1},children:[I,j&&e(f,{href:b}),e(x,{})]})]}),(v||C)&&n(m,{direction:"row",sx:{justifyContent:"center",alignItems:"center",gap:2,pb:.5},children:[v&&e(d,{children:v}),C&&e(d,{children:C})]})]}),e(d,{sx:{display:{xs:"none",lg:"block"},width:"100%"},children:n(d,{sx:{display:"flex",flexDirection:"row",alignItems:"center",width:"100%",position:"relative"},ref:A,children:[e(d,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-start"},children:e(d,{sx:{height:"38px",pt:.5},ref:S,children:k})}),e(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,right:0,pointerEvents:"none"},children:e(d,{sx:{pointerEvents:"auto",textAlign:"center"},children:e(d,{ref:H,children:e(p,{children:y})})})}),e(d,{sx:{display:v?"block":"none",position:"absolute",left:null!=D?`${D}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:e(d,{ref:O,children:v})}),e(d,{sx:{display:C?"block":"none",position:"absolute",left:null!=X?`${X}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:e(d,{ref:N,children:C})}),e(d,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-end"},children:n(d,{sx:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:1},ref:$,children:[I,j&&e(f,{href:b}),e(x,{})]})})]})})]})}),e(d,{sx:{display:{xs:"none",sm:"block"},height:`${M}px`,flexShrink:0}})]})};export{y as ActionBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as i}from"react";import{useTheme as n,useMediaQuery as r,Popover as s}from"@mui/material";import l from"@mui/icons-material/CloseFullscreen";import a from"@mui/icons-material/GridView";import m from"@mui/icons-material/History";import{AgentChatWindow as p}from"./AgentChatWindow.mjs";import{ChatHistory as c}from"./ChatHistory.mjs";import{Dialog as d}from"../_Primitives/Dialog.mjs";import
|
|
1
|
+
import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as i}from"react";import{useTheme as n,useMediaQuery as r,Popover as s}from"@mui/material";import l from"@mui/icons-material/CloseFullscreen";import a from"@mui/icons-material/GridView";import m from"@mui/icons-material/History";import{AgentChatWindow as p}from"./AgentChatWindow.mjs";import{ChatHistory as c}from"./ChatHistory.mjs";import{Dialog as d}from"../_Primitives/Dialog.mjs";import h from"@mui/material/Box";import{Stack as u}from"../_Primitives/Stack.mjs";import{IconButton as C}from"../Buttons/IconButton.mjs";import{AiChip as f}from"../AiChip.mjs";import{H1 as g,H2 as v}from"../Typography.mjs";import"@mui/icons-material/Check";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Download";import"@mui/icons-material/ArrowUpward";import"@mui/icons-material/ArrowDownward";import"@mui/material/styles";import"../Theme/tokens.mjs";import"./ChatComponents/ChatAvatar.mjs";import"./ChatComponents/MarkdownContent.mjs";import"../../node_modules/dompurify/dist/purify.es.mjs";import"../MetricStat.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"../Code.mjs";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import x from"./ChatComponents/SuggestedPrompts.mjs";import w from"./ChatComponents/MessageList.mjs";function S({open:S,onClose:y,title:b="Ask Nexus",subtitle:A="Ready to help",placeholder:j,suggestedPrompts:k=[],showAiChip:I=!0,isTyping:T,messages:z,streamingText:D,liveTraceEvents:P,showActivity:U=!1,onSend:E,onStop:O,onFeedback:L,followUpPrompts:N,followUpLabel:B="Suggested follow-ups:",topOffset:F,conversations:M,activeConversationId:_,onSelectConversation:H,onDeleteConversation:W,onNewConversation:X,agents:$,activeAgentId:G,onSelectAgent:R}){const V=n(),q=r(V.breakpoints.down("md")),[J,K]=i(!1),[Q,Y]=i(!1),[Z,oo]=i(null),eo=z.length>0||T,to=void 0!==M,io=F?`calc(100vh - ${F}px)`:"100vh",no=o(u,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[I&&e(f,{}),to&&q&&e(C,{title:"Chat history",size:"small",onClick:()=>K(o=>!o),children:e(m,{sx:{fontSize:18}})}),e(C,{title:"Close full view",size:"small",onClick:y,children:e(l,{sx:{fontSize:16}})})]}),ro=eo?e(w,{messages:z,isTyping:T,streamingText:D,liveTraceEvents:P,showActivity:U,onFeedback:L}):o(u,{direction:"column",sx:{gap:4,alignItems:"center"},children:[e(g,{children:b}),e(v,{sx:{color:"text.secondary"},children:A})]}),so=!eo&&k.length>0?o(t,{children:[e(C,{title:"Open prompt gallery",ariaLabel:"Open prompt gallery",size:"small",sx:{color:"text.jades"},onClick:o=>oo(o.currentTarget),children:e(a,{sx:{fontSize:18}})}),e(s,{open:Boolean(Z),anchorEl:Z,onClose:()=>oo(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:e(h,{sx:{p:2,maxWidth:360},children:e(x,{prompts:k,onSelect:o=>{oo(null),E(o)}})})})]}):void 0;return o(d,{open:S,fullScreen:!0,onClose:y,sx:F?{top:`${F}px`}:void 0,children:[o(h,{sx:{display:"flex",height:io,overflow:"hidden"},children:[to&&e(h,{sx:{display:{xs:"none",md:"flex"},flexShrink:0},children:e(c,{conversations:M,activeConversationId:_??null,onSelectConversation:H??(()=>{}),onDeleteConversation:W,onNewConversation:X,agents:$,activeAgentId:G,onSelectAgent:R,isCollapsed:Q,onToggleCollapse:()=>Y(o=>!o)})}),e(p,{title:b,subtitle:A,showAiChip:!1,headerActions:no,isEmpty:!eo,body:ro,followUpPrompts:N,onSelectFollowUp:E,followUpLabel:B,onSend:E,isStreaming:T,onStop:O,inputPlaceholder:j,inputActions:so})]}),to&&q&&o(t,{children:[J&&e(h,{onClick:()=>K(!1),sx:{position:"absolute",inset:0,zIndex:9,bgcolor:"rgba(0,0,0,0.45)"}}),e(h,{sx:{position:"absolute",top:0,left:0,bottom:0,width:288,zIndex:10,bgcolor:"background.paper",boxShadow:4,display:"flex",flexDirection:"column",overflow:"hidden",transform:J?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease"},children:e(c,{conversations:M,activeConversationId:_??null,onSelectConversation:o=>{H?.(o),K(!1)},onDeleteConversation:W,onNewConversation:X?()=>{X(),K(!1)}:void 0,agents:$,activeAgentId:G,onSelectAgent:R,onClose:()=>K(!1)})})]})]})}export{S as AgentChatDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useState as i,useRef as
|
|
1
|
+
import{jsx as r,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as n}from"react";import s from"@mui/material/Box";import{Stack as m}from"../_Primitives/Stack.mjs";import{Caption as a}from"../Typography.mjs";import{Paper as l}from"../_Primitives/Paper.mjs";import{ChatInput as c}from"./ChatInput.mjs";import"@mui/icons-material/Check";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Download";import"@mui/icons-material/ArrowUpward";import"@mui/icons-material/ArrowDownward";import"@mui/material";import"@mui/material/styles";import"../Theme/tokens.mjs";import"./ChatComponents/ChatAvatar.mjs";import"./ChatComponents/MarkdownContent.mjs";import"../../node_modules/dompurify/dist/purify.es.mjs";import"../MetricStat.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"../Code.mjs";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import p from"./ChatComponents/SuggestedPrompts.mjs";import{AgentChatWindowHeader as u}from"./AgentChatWindowHeader.mjs";const d=({title:d="Nexus AI Chat",subtitle:h="Your intelligent assistant",showAiChip:f=!0,headerActions:x,body:C,followUpLabel:y="Suggested follow-ups:",followUpPrompts:b,onSelectFollowUp:g,onSend:w,inputDisabled:S=!1,inputPlaceholder:A="Ask me anything...",isStreaming:j=!1,onStop:k,inputActions:D,inputRef:M,inputLabel:T="Message",isEmpty:v=!1,inputSx:P,sx:I})=>{const[R,U]=i(!1),E=o(0),L=o(0),Y=o(0),H=o(null),W=Boolean(b&&b.length>0&&g);n(()=>{v&&(U(!1),E.current=0,L.current=0)},[v]);const _=r(c,{onSend:w,disabled:S,placeholder:A,isStreaming:j,onStop:k,actions:D,inputRef:M,label:T});return t(s,{sx:[{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0,height:"100%"},...Array.isArray(I)?I:I?[I]:[]],onWheelCapture:()=>{Y.current=Date.now()},onTouchStartCapture:r=>{H.current=r.touches[0]?.clientY??null},onTouchMoveCapture:r=>{const t=r.touches[0]?.clientY;void 0!==t&&null!==H.current&&Math.abs(t-H.current)>1&&(Y.current=Date.now(),H.current=t)},onScrollCapture:r=>{const t=r.target;if(!(t instanceof HTMLElement))return;if("true"!==t.dataset.agentChatScrollContainer)return;const e=t.scrollTop,i=e-E.current;if(E.current=e,e<=0)return L.current=0,void U(!1);Date.now()-Y.current>250?L.current=0:(Math.sign(i)!==Math.sign(L.current)?L.current=i:L.current+=i,L.current>=12?(U(!0),L.current=0):L.current<=-12&&(U(!1),L.current=0))},children:[r(s,{sx:{display:{xs:R?"none":"block",sm:"block"},flexShrink:0},children:r(u,{title:d,subtitle:h,showAiChip:f,actions:x})}),v?t(l,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",px:2,pb:4},children:[C,r(s,{sx:[{mt:3,width:"100%"},...Array.isArray(P)?P:P?[P]:[]],children:_})]}):t(e,{children:[r(l,{"data-agent-chat-scroll-container":"true",sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",overflowY:"scroll"},children:C}),W&&t(m,{direction:{xs:"column",md:"row"},spacing:1,sx:{px:2,py:1,justifyContent:{xs:"center",sm:"flex-end"},alignItems:"center"},children:[r(a,{sx:{display:"block",mb:1},children:y}),r(p,{prompts:b??[],onSelect:g})]}),r(l,{sx:{borderRadius:0,border:"none"},children:r(s,{sx:[{p:2,flexShrink:0},...Array.isArray(P)?P:P?[P]:[]],children:_})})]})]})};export{d as AgentChatWindow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Alert as i}from"../../_Primitives/Alert.mjs";import t from"@mui/material/Box";import{Paper as o}from"../../_Primitives/Paper.mjs";import{Stack as a}from"../../_Primitives/Stack.mjs";import{Caption as n}from"../../Typography.mjs";const s={chart:"This chart couldn't be displayed.",mermaid:"This diagram couldn't be displayed."},m=m=>"notice"===m.variant?e(a,{spacing:.5,role:"status",children:e(n,{children:m.kind&&s[m.kind]||"This content couldn't be displayed."})}):r(a,{spacing:1,role:"status",children:[e(i,{severity:"warning",children:m.reason||m.defaultReason||"This rich response could not be rendered safely."}),e(o,{variant:"outlined",component:"pre",sx:{p:1.5,overflowX:"auto",whiteSpace:"pre-wrap"},children:e(t,{component:"code",children:m.rawSource})})]});export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as t,jsx as r}from"react/jsx-runtime";import e from"@mui/material/Box";import{Stack as l}from"../../_Primitives/Stack.mjs";import{Card as i}from"../../Card.mjs";import{MetricStat as a}from"../../MetricStat.mjs";import{H4 as o,Caption as n}from"../../Typography.mjs";import{columnsForItemCount as m,formatDatapointValue as s,formatDatapointDelta as p,deltaColorForPolarity as u}from"../../../utils/chatDatapoints.mjs";const d={p:.5,"&:last-child":{pb:.5}},c=({datapoints:c})=>{if(!c||!Array.isArray(c.items)||0===c.items.length)return null;const{items:f}=c,h=f.map(t=>[t.period,t.source].filter(Boolean).join(" · ")),g=f.length>1&&h.every(t=>t&&t===h[0])?h[0]:null,x=m(f.length);return t(l,{spacing:1,role:"group","aria-label":c.title||"Key figures",children:[c.title?r(o,{children:c.title}):null,g?r(n,{children:g}):null,r(e,{"data-testid":"datapoints-grid",sx:{display:"grid",gap:1.5,alignItems:"stretch",gridTemplateColumns:{xs:"repeat(auto-fill, minmax(140px, 1fr))",sm:`repeat(${x}, minmax(0, 1fr))`}},children:f.map((e,l)=>{const o=s(e.value,e.valueFormat,{currency:e.currency,unit:e.unit}),m=p(e.delta,e),c=u(e.delta,e.polarity),f=h[l],x=Boolean(f)&&!g;return t(i,{sx:{flexGrow:1},contentSx:d,children:[r(a,{label:e.label,value:o,delta:m||void 0,deltaColor:c}),x?r(n,{children:f}):null]},`${e.label}-${l}`)})})]})};export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import e from"@mui/material/Box";import{Link as o}from"../../_Primitives/Link.mjs";import{safeMarkdownUrl as n}from"../../../utils/safeMarkdownUrl.mjs";import{splitRawHtmlTables as a,sanitizeRawHtmlTable as m}from"../../../utils/chatTableHtml.mjs";import{CopyableTableContainer as i}from"./CopyableTableContainer.mjs";import l from"./ChatContentFallback.mjs";import c,{chatWindowMarkdownComponents as s}from"./MarkdownContent.mjs";const h={img:({alt:r})=>t(e,{component:"span",children:r?`[Image omitted: ${r}]`:"[Image omitted]"}),a:({href:r,children:a})=>{const m=n(r);if(!m)return t(e,{component:"span",children:a});const i=m.startsWith("#");return t(o,{href:m,openInNewTab:!i,rel:i?void 0:"noopener noreferrer",children:a})}},p=({html:e})=>{const o=r(()=>{try{return{html:m(e),reason:null}}catch{return{html:null,reason:"The raw HTML table could not be rendered safely."}}},[e]);return o.html?t(i,{sanitizedHtml:o.html}):t(l,{variant:"diagnostic",reason:o.reason,rawSource:e})},u=({content:o,highlightQuery:n,compact:m=!1,components:i})=>{const u=r(()=>a(o),[o]),d={...m||n?{}:s,...h,...i};return t(e,{sx:{color:"text.primary"},children:u.map(r=>"html-table"===r.type?t(p,{html:r.html},r.key):"fallback"===r.type?t(l,{variant:"diagnostic",reason:r.reason,rawSource:r.rawSource},r.key):r.content?t(c,{content:r.content,highlightQuery:n,compact:m,components:d},r.key):null)})};export{u as default,h as safeChatMarkdownComponents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r,useRef as o}from"react";import l from"@mui/icons-material/Check";import
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r,useRef as o,useMemo as n,createElement as i}from"react";import l from"@mui/icons-material/Check";import a from"@mui/icons-material/ContentCopy";import c from"@mui/icons-material/Download";import s from"@mui/icons-material/ArrowUpward";import d from"@mui/icons-material/ArrowDownward";import m from"@mui/material/Box";import{Stack as p}from"../../_Primitives/Stack.mjs";import{Table as u,TableHead as f,TableRow as h,TableCell as y,TableBody as x}from"../../_Primitives/Table.mjs";import{ButtonBase as b}from"../../Buttons/ButtonBase.mjs";import{SecondaryButton as w}from"../../Buttons/SecondaryButton.mjs";const S=e=>e.replace(/\s+/g," ").trim(),g=e=>e?Array.from(e.querySelectorAll("table")).map(e=>Array.from(e.querySelectorAll("tr")).map(e=>Array.from(e.querySelectorAll("th, td")).map(e=>(e=>{const t=S(e||"");return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t})(e.textContent||"")).join(",")).filter(Boolean).join("\r\n")).filter(Boolean).join("\r\n\r\n"):"",C=(e,t)=>{if(3===e.nodeType)return e.textContent;if(1!==e.nodeType)return null;const r=e,o=r.tagName.toLowerCase();return["br","strong","em","code"].includes(o)?i(o,{key:t},...Array.from(r.childNodes,C)):r.textContent},A=({children:i,table:A,sanitizedHtml:v})=>{const[j,B]=r(!1),[T,q]=r(null),$=o(null),k=n(()=>v?(e=>{if("undefined"==typeof DOMParser)return null;const t=(new DOMParser).parseFromString(e,"text/html").querySelector("table");if(!t)return null;const r=e=>Array.from(e.cells,e=>({content:Array.from(e.childNodes,C),sortText:S(e.textContent||""),colSpan:e.colSpan,rowSpan:e.rowSpan,scope:e.getAttribute("scope")||void 0,header:"TH"===e.tagName})),o=Array.from(t.tHead?.rows||[]),n=[...Array.from(t.tBodies).flatMap(e=>Array.from(e.rows)),...Array.from(t.children).filter(e=>"TR"===e.tagName)],i=!o.length&&n[0]?.querySelector("th")?n.shift():void 0,l=o[0]||i||n.shift();return l?{headers:r(l),rows:[...o.slice(1),...n].map(r),footer:Array.from(t.tFoot?.rows||[],r),caption:t.caption?.textContent||void 0}:null})(v):null,[v]),z=A||k,D=n(()=>z&&T?z.rows.map((e,t)=>({row:e,index:t})).sort((e,t)=>{const r=e.row[T.column]?.sortText||"",o=t.row[T.column]?.sortText||"",n=r.localeCompare(o,void 0,{sensitivity:"base"});return("asc"===T.direction?n:-n)||e.index-t.index}).map(({row:e})=>e):z?.rows||[],[z,T]),L=(e,r)=>e.map((e,o)=>t(y,{colSpan:e.colSpan,rowSpan:e.rowSpan,component:e.header?"th":"td",scope:e.scope,sx:{border:"1px solid",borderColor:"divider",px:1.25,py:.75,textAlign:"left"},children:e.content},`${r}-${o}`));return e(m,{sx:{my:1},children:[e(p,{direction:"row",sx:{justifyContent:"flex-end",gap:1,mb:.5},children:[t(w,{size:"small",startIcon:t(j?l:a,{sx:{fontSize:14}}),onClick:async()=>{const e=(t=$.current)?Array.from(t.querySelectorAll("table")).map(e=>{const t=Array.from(e.querySelectorAll("tr"));return t.length?t.map(e=>{const r=null!==e.closest("thead")||e===t[0]&&null!==e.querySelector("th"),o=Array.from(e.querySelectorAll("th, td")).map(e=>S(e.textContent||"")),n="| "+o.join(" | ")+" |";return r?n+"\n| "+o.map(()=>"---").join(" | ")+" |":n}).join("\n"):""}).filter(Boolean).join("\n\n"):"";var t;const r=(e=>e?Array.from(e.querySelectorAll("table")).map(e=>{const t=Array.from(e.querySelectorAll("tr"));return t.length?`<table style="border-collapse:collapse;border:1px solid #d0d7de;">${t.map(e=>`<tr>${Array.from(e.querySelectorAll("th, td")).map(e=>{const t="th"===e.tagName.toLowerCase()?"th":"td";return`<${t} style="border:1px solid #d0d7de;padding:6px 10px;text-align:left;">${S(e.textContent||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</${t}>`}).join("")}</tr>`).join("")}</table>`:""}).filter(Boolean).join("<br>"):"")($.current);await(async(e,t)=>{if(navigator.clipboard?.write&&"undefined"!=typeof ClipboardItem)try{const r={"text/plain":new Blob([t||""],{type:"text/plain"})};return e&&(r["text/html"]=new Blob([e],{type:"text/html"})),void await navigator.clipboard.write([new ClipboardItem(r)])}catch{}t&&await navigator.clipboard.writeText(t)})(r,e),B(!0),setTimeout(()=>B(!1),2e3)},title:j?"Table copied":"Copy table","aria-label":j?"Table copied to clipboard":"Copy table",children:j?"Copied":"Copy table"}),t(w,{size:"small",startIcon:t(c,{sx:{fontSize:14}}),onClick:()=>{const e=g($.current);if(!e)return;((e,t)=>{if(!e)return;const r=new Blob(["\ufeff",e],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(r),n=document.createElement("a");n.href=o,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(o)})(e,`nexus-table-${(new Date).toISOString().slice(0,19).replace(/[:T]/g,"-")}.csv`)},title:"Download CSV","aria-label":"Download table as CSV",children:"CSV"})]}),t(m,{ref:$,sx:{overflowX:"auto",width:"100%",maxWidth:"100%"},children:z?e(u,{sx:{width:"100%",minWidth:"max-content",borderCollapse:"collapse"},children:[z.caption?t("caption",{children:z.caption}):null,t(f,{children:t(h,{children:z.headers.map((r,o)=>t(y,{component:"th",scope:"col",colSpan:r.colSpan,rowSpan:r.rowSpan,"aria-sort":T?.column===o?"asc"===T.direction?"ascending":"descending":void 0,sx:{border:"1px solid",borderColor:"divider",bgcolor:"action.hover",px:1.25,py:.75,fontWeight:600,textAlign:"left"},children:e(b,{onClick:()=>{return e=o,q(t=>t?.column!==e?{column:e,direction:"asc"}:"asc"===t.direction?{column:e,direction:"desc"}:null);var e},"aria-label":`Sort by ${r.sortText}${T?.column===o?", "+("asc"===T.direction?"ascending":"descending"):""}`,sx:{width:"100%",justifyContent:"flex-start",textAlign:"left",font:"inherit",fontWeight:"inherit",color:"inherit",gap:.5,"&.Mui-focusVisible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}},children:[r.content,t(m,{component:"span","aria-hidden":"true",sx:{display:"inline-flex",flex:"0 0 14px",width:14,height:14,visibility:T?.column===o?"visible":"hidden"},children:T?.column===o&&("asc"===T.direction?t(s,{sx:{fontSize:14}}):t(d,{sx:{fontSize:14}}))})]})},o))})}),e(x,{children:[D.map((e,r)=>t(h,{children:L(e,r)},r)),z.footer?.map((e,r)=>t(h,{children:L(e,r)},`footer-${r}`))]})]}):i})]})};export{A as CopyableTableContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"@mui/material/Box";import{Stack as i}from"../../_Primitives/Stack.mjs";import{Chip as n}from"../../_Primitives/Chip.mjs";import{H2 as m,H3 as o}from"../../Typography.mjs";import s from"./SuggestedPrompts.mjs";const l=({title:l,description:c,dataSources:p,prompts:a,onSelect:d})=>e(i,{direction:"column",sx:{alignItems:"center",justifyContent:"center",gap:3,p:2,flex:1},children:[e(i,{direction:"column",sx:{alignItems:"center",justifyContent:"center",gap:2},children:[t(m,{children:l}),t(o,{sx:{color:"text.secondary",textAlign:"center"},children:c})]}),p&&p.length>0&&t(r,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:.75,mt:1},children:p.map(e=>t(n,{label:e,size:"small"},e))}),a.length>0&&t(r,{sx:{mt:2},children:t(s,{prompts:a,onSelect:d})})]});export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as r,useContext as t,isValidElement as n,cloneElement as o,createElement as i}from"react";import l from"react-markdown";import c from"remark-gfm";import d from"@mui/material/Box";import{Paper as p}from"../../_Primitives/Paper.mjs";import{ChatWindowBody as m,H4 as a,H3 as h}from"../../Typography.mjs";import{Code as s}from"../../Code.mjs";import{CopyableTableContainer as f}from"./CopyableTableContainer.mjs";const g=(r,t)=>{const n=t?.trim();if(!n)return r;const o=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(n)})`,"ig");return r.split(o).map((r,t)=>{if(!r)return null;return r.toLowerCase()===n.toLowerCase()?e(d,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:r},`${r}-${t}`):r})},u=(e,r)=>{if("string"==typeof e)return g(e,r);if("number"==typeof e)return g(e.toString(),r);if(Array.isArray(e))return e.map(e=>u(e,r));if(n(e)){const t=e.props.children;return void 0===t?e:o(e,void 0,u(t,r))}return e},y=r({}),x=e=>"text"===e.type?e.value:"children"in e?e.children.map(x).join(""):"",b=(e,r,t)=>{if("text"===e.type)return e.value;if("element"!==e.type)return null;const n=r[e.tagName]||e.tagName,o="string"==typeof n?{...e.properties,key:t}:{...e.properties,key:t,node:e};return i(n,o,...e.children.map((e,t)=>b(e,r,t)))},v=e=>"element"===e.type,S=(e,r)=>{const t=e.children.filter(v),n=t.find(e=>"thead"===e.tagName),o=t.find(e=>"tbody"===e.tagName),i=t.find(e=>"tfoot"===e.tagName),l=e=>e?.children.filter(v).filter(e=>"tr"===e.tagName).map(e=>e.children.filter(v).filter(e=>"th"===e.tagName||"td"===e.tagName).map(e=>((e,r)=>({content:e.children.map((e,t)=>b(e,r,t)),sortText:e.children.map(x).join("").replace(/\s+/g," ").trim(),colSpan:"number"==typeof e.properties.colSpan?e.properties.colSpan:void 0,rowSpan:"number"==typeof e.properties.rowSpan?e.properties.rowSpan:void 0}))(e,r)))||[],c=l(n),d=l(o);return{headers:c[0]||d.shift()||[],rows:[...c.slice(1),...d],footer:l(i)}},C=({node:r})=>{const n=t(y);return r?e(f,{table:S(r,n)}):null},w={table:C,p:({children:r})=>e(m,{sx:{mb:1,"&:last-child":{mb:0}},children:r}),li:({children:r})=>e(m,{component:"li",children:r}),strong:({children:r})=>e(d,{component:"strong",sx:{fontWeight:700,fontSize:"inherit",lineHeight:"inherit"},children:r}),em:({children:r})=>e(d,{component:"em",sx:{fontStyle:"italic",fontSize:"inherit",lineHeight:"inherit"},children:r})},k=({content:r,highlightQuery:t,compact:n=!1,components:o})=>{const i=e=>u(e,t),f=n?"0.875rem":void 0,g={...{p:({children:r})=>e(m,{sx:{mb:1,"&:last-child":{mb:0},fontSize:f},children:i(r)}),strong:({children:r})=>e(d,{component:"strong",sx:{fontWeight:700},children:i(r)}),em:({children:r})=>e(d,{component:"em",sx:{fontStyle:"italic"},children:i(r)}),ul:({children:r})=>e(d,{component:"ul",sx:{pl:2.5,my:2,display:"grid",gap:.5,listStyleType:"disc"},children:i(r)}),ol:({children:r})=>e(d,{component:"ol",sx:{pl:2.5,my:2,display:"grid",gap:.5,listStyleType:"decimal"},children:i(r)}),li:({children:r})=>e(m,{component:"li",sx:{fontSize:f},children:i(r)}),h1:({children:r})=>e(h,{sx:{mb:1,mt:.5},children:i(r)}),h2:({children:r})=>e(a,{sx:{mb:.5,mt:.5},children:i(r)}),h3:({children:r})=>e(a,{sx:{mb:.5,mt:.5},children:i(r)}),code:({children:r})=>e(s,{children:i(r)}),pre:({children:r})=>e(p,{component:"pre",variant:"outlined",sx:{my:2,p:1.5,overflowX:"auto",fontFamily:'"SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace',fontSize:"0.75rem",lineHeight:1.5,bgcolor:"action.hover"},children:i(r)}),hr:()=>e(d,{component:"hr",sx:{my:3,border:0,borderTop:1,borderColor:"divider"}}),table:C,th:({children:r})=>e(d,{component:"th",sx:{border:"1px solid",borderColor:"divider",px:1.25,py:.75,textAlign:"left",bgcolor:"action.hover",fontWeight:600},children:r}),td:({children:r})=>e(d,{component:"td",sx:{border:"1px solid",borderColor:"divider",px:1.25,py:.75,textAlign:"left"},children:r})},...o};return e(y.Provider,{value:g,children:e(l,{remarkPlugins:[c],components:g,children:r})})};export{w as chatWindowMarkdownComponents,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as r}from"react";import t from"@mui/icons-material/ExpandMore";import n from"@mui/icons-material/ExpandLess";import i from"@mui/icons-material/Download";import a from"../AgentActivity/AgentActivity.mjs";import
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as r}from"react";import t from"@mui/icons-material/ExpandMore";import n from"@mui/icons-material/ExpandLess";import i from"@mui/icons-material/Download";import a from"../AgentActivity/AgentActivity.mjs";import l from"@mui/material/Box";import{Stack as c}from"../../_Primitives/Stack.mjs";import{GhostButton as s}from"../../Buttons/GhostButton.mjs";import{SecondaryButton as m}from"../../Buttons/SecondaryButton.mjs";import d from"./ChatResponseMarkdown.mjs";import p from"./MessageFeedbackBar.mjs";import{ChatWindowBody as f}from"../../Typography.mjs";import{colours as h}from"../../Theme/tokens.mjs";const u=({block:i})=>{const[a,c]=r(!1),m=i.language?.trim()||"text",d=i.content||"";if(!d.trim())return null;const p=Boolean(i.title);return o(l,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",mb:1,"&:last-child":{mb:0}},children:[p&&o(s,{onClick:()=>c(e=>!e),"aria-expanded":a,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",px:1.5,py:.75,bgcolor:"action.hover",borderBottom:a?"1px solid":"none",borderColor:"divider"},children:[e(l,{component:"span",sx:{fontSize:"0.8rem",fontWeight:600,color:"text.secondary"},children:i.title}),e(l,{component:"span","aria-hidden":"true",sx:{display:"inline-flex",alignItems:"center",color:"text.secondary"},children:e(a?n:t,{sx:{fontSize:16}})})]}),(!p||a)&&e(l,{component:"pre",sx:{m:0,p:1.5,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"0.8125rem",fontFamily:'"SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace',lineHeight:1.5,bgcolor:"action.hover"},children:e(l,{component:"code",className:`language-${m}`,children:d})})]})},g=({file:o,onDownloadFile:t})=>{const[n,a]=r(!1);return e(m,{size:"small",startIcon:e(i,{}),onClick:async()=>{if(t){a(!0);try{await t(o)}finally{a(!1)}}},disabled:n||!t,children:n?"Preparing…":o.downloadLabel||o.displayName||"Download file"})},x=(o,r)=>{const t=r?.trim();if(!t)return o;const n=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return o.split(n).map((o,r)=>{if(!o)return null;return o.toLowerCase()===t.toLowerCase()?e(l,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:o},`${o}-${r}`):o})},y=({message:r,highlightQuery:t,showActivity:n=!1,onFeedback:i,onDownloadFile:s,contentRenderer:m,markdownComponents:y,compact:b=!1})=>{const w="user"===r.role,k=!w&&r.codeBlocks&&r.codeBlocks.length>0,v=!w&&r.files&&r.files.length>0;return e(l,{sx:{display:"flex",justifyContent:w?"flex-end":"flex-start"},children:o(l,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:0,...w?{}:{flex:1}},children:[!w&&n&&r.traceEvents&&r.traceEvents.length>0&&e(a,{isStreaming:!1,traceEvents:r.traceEvents,latency:r.latency,activitySummary:r.activitySummary,compact:!0}),o(l,{sx:{borderRadius:w?"1rem 0.25rem 1rem 1rem":"0.25rem 1rem 1rem 1rem",px:1.75,py:1.25,bgcolor:w?h.jadeLight:"background.default",color:w?h.black:"text.primary",border:"none"},children:[k&&e(c,{spacing:0,sx:{mb:1.5},children:r.codeBlocks.map((o,r)=>e(u,{block:o},r))}),w?e(f,{sx:{whiteSpace:"pre-wrap",fontSize:b?"0.875rem":void 0},children:x(r.content,t)}):e("div",{className:"message-content",children:m?m(r.content):e(d,{content:r.content,highlightQuery:t,compact:b,components:y})}),v&&e(c,{direction:"row",spacing:1,sx:{mt:1.5,flexWrap:"wrap"},children:r.files.map((o,r)=>e(g,{file:o,onDownloadFile:s},`${o.bucket}-${o.key}-${r}`))})]}),!w&&i&&e(p,{message:r,onFeedback:i})]})})};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,Fragment as e,jsx as t}from"react/jsx-runtime";import{useState as o}from"react";import r from"@mui/icons-material/ThumbUp";import m from"@mui/icons-material/ThumbDown";import
|
|
1
|
+
import{jsxs as i,Fragment as e,jsx as t}from"react/jsx-runtime";import{useState as o}from"react";import r from"@mui/icons-material/ThumbUp";import m from"@mui/icons-material/ThumbDown";import a from"@mui/icons-material/ContentCopy";import s from"@mui/icons-material/Check";import l from"@mui/material/Box";import{Stack as n}from"../../_Primitives/Stack.mjs";import{IconButton as c}from"../../Buttons/IconButton.mjs";import{PrimaryButton as p}from"../../Buttons/PrimaryButton.mjs";import{SecondaryButton as d}from"../../Buttons/SecondaryButton.mjs";import{Dialog as u,DialogTitle as h,DialogContent as f,DialogActions as g}from"../../_Primitives/Dialog.mjs";import{TextField as x}from"../../_Primitives/TextField.mjs";import{Caption as C}from"../../Typography.mjs";const b=({message:b,onFeedback:v})=>{const[k,w]=o(!1),[y,j]=o(b.rating??null),[T,B]=o(!1),[z,S]=o(""),[P,F]=o(!1);return i(e,{children:[i(n,{direction:"row",spacing:.5,sx:{alignItems:"center"},children:[t(c,{size:"small",title:k?"Copied":"Copy message",ariaLabel:k?"Copied to clipboard":"Copy message to clipboard",onClick:async()=>{try{await navigator.clipboard.writeText(b.content),w(!0),setTimeout(()=>w(!1),2e3)}catch{}},children:t(k?s:a,{sx:{fontSize:16}})}),t(c,{size:"small",title:"Helpful",ariaLabel:"Mark as helpful",onClick:()=>{v(b.id,"positive"),j("positive"),F(!0),setTimeout(()=>F(!1),3e3)},sx:"positive"===y?{color:"primary.main"}:void 0,children:t(r,{sx:{fontSize:16}})}),t(c,{size:"small",title:"Not helpful",ariaLabel:"Mark as not helpful",onClick:()=>{S(""),B(!0)},sx:"negative"===y?{color:"error.main"}:void 0,children:t(m,{sx:{fontSize:16}})}),P&&t(C,{sx:{color:"text.secondary",ml:.5},children:"Feedback submitted!"})]}),i(u,{open:T,onClose:()=>B(!1),maxWidth:"sm",fullWidth:!0,children:[t(h,{children:"What was the issue with this response?"}),t(f,{children:t(l,{sx:{mt:1},children:t(x,{multiline:!0,rows:4,fullWidth:!0,placeholder:"Please describe what was wrong with this response...",value:z,onChange:i=>S(i.target.value),autoFocus:!0})})}),i(g,{children:[t(d,{onClick:()=>B(!1),children:"Cancel"}),t(p,{onClick:()=>{v(b.id,"negative",z.trim()),j("negative"),B(!1),F(!0),setTimeout(()=>F(!1),3e3)},disabled:!z.trim(),children:"Submit"})]})]})]})};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useRef as r,useEffect as o}from"react";import
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useRef as r,useEffect as o}from"react";import n from"@mui/material/Box";import c from"./MessageBubble.mjs";import i from"./StreamingBubble.mjs";import l from"./TypingIndicator.mjs";import{latestTraceLabel as s}from"./latestTraceLabel.mjs";const m=({messages:m,isTyping:a,streamingText:u,liveTraceEvents:g,highlightQuery:h,onAbort:p,showActivity:f=!1,compact:d=!1,markdownComponents:b,onFeedback:x})=>{const y=r(null),v=r(null),T=r(!1),w=r(m.length),A=r(!1),j=()=>{const t=v.current;t&&(A.current=!0,t.scrollTop=t.scrollHeight,requestAnimationFrame(()=>{A.current=!1}))};o(()=>{const t=m[m.length-1];m.length>w.current&&"user"===t?.role&&(T.current=!1,j()),w.current=m.length},[m]),o(()=>{T.current||j()},[a,u]);const k=(u||"").trim().length>0,H=a&&(k||f),B=a&&!H;return t(n,{ref:v,"data-agent-chat-scroll-container":"true",onScroll:()=>{A.current||(T.current=!(()=>{const t=v.current;return!t||t.scrollHeight-t.scrollTop-t.clientHeight<80})())},sx:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1.5,px:2,py:1.5},children:[m.filter(t=>"user"===t.role||t.content).map(t=>e(c,{message:t,highlightQuery:h,showActivity:f,compact:d,markdownComponents:b,onFeedback:x},t.id)),H&&e(i,{text:u||"",traceEvents:g||[],highlightQuery:h,onAbort:p,showActivity:f,compact:d}),B&&e(l,{traceLabel:g&&g.length>0?s(g):void 0}),e(n,{ref:y})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import o from"@mui/material/Box";import{Chip as i}from"../../_Primitives/Chip.mjs";import{Caption as m}from"../../Typography.mjs";const l=({sources:l})=>l.length?r(o,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.5,px:2,py:1,borderTop:1,borderColor:"divider"},children:[e(m,{sx:{mr:.5},children:"Sources:"}),l.map(r=>e(i,{label:r,size:"small"},r))]}):null;export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as t,Fragment as r}from"react/jsx-runtime";import e from"../AgentActivity/AgentActivity.mjs";import
|
|
1
|
+
import{jsxs as i,jsx as t,Fragment as r}from"react/jsx-runtime";import e from"../AgentActivity/AgentActivity.mjs";import n from"@mui/material/Box";import{Stack as o}from"../../_Primitives/Stack.mjs";import{Caption as a}from"../../Typography.mjs";import c from"./ChatResponseMarkdown.mjs";import{latestTraceLabel as m}from"./latestTraceLabel.mjs";const s=()=>t(n,{sx:{display:"inline-block",width:"2px",height:16,bgcolor:"primary.main",verticalAlign:"text-bottom",animation:"pulse 1.2s ease-in-out infinite","@keyframes pulse":{"0%, 100%":{opacity:.35},"50%":{opacity:1}}}}),l=({text:l,traceEvents:p,highlightQuery:g,avatarIcon:h,compact:d=!1,showActivity:x=!1})=>i(o,{direction:"row",spacing:1,sx:{justifyContent:"flex-start"},children:[h&&t(n,{sx:{mt:.25,flexShrink:0},children:h}),t(o,{spacing:1,sx:{flex:1,minWidth:0},children:x?i(r,{children:[t(e,{isStreaming:!0,traceEvents:p}),l&&i(n,{sx:{borderRadius:"0.25rem 1rem 1rem 1rem",bgcolor:"background.default",color:"text.primary",px:1.75,py:1.25,lineHeight:1.6},children:[t(c,{content:l,highlightQuery:g,compact:d}),t(s,{})]})]}):t(r,{children:l?i(n,{sx:{borderRadius:"0.25rem 1rem 1rem 1rem",bgcolor:"background.default",color:"text.primary",px:1.75,py:1.25,lineHeight:1.6},children:[t(c,{content:l,highlightQuery:g,compact:d}),t(s,{})]}):t(n,{sx:{bgcolor:"background.default",px:1.75,py:1.25},children:t(o,{direction:"row",spacing:1,sx:{alignItems:"center"},children:i(o,{direction:"row",spacing:.5,children:[t(a,{children:p.length>0?`Agent is working... ${m(p)}`:"Agent is working..."}),[0,150,300].map(i=>t(n,{component:"span",sx:{bgcolor:"primary.main",animation:"bounce 1s ease-in-out infinite",animationDelay:`${i}ms`,"@keyframes bounce":{"0%, 80%, 100%":{opacity:.35,transform:"translateY(0)"},"40%":{opacity:1,transform:"translateY(-1px)"}}}},i))]})})})})})]});export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import i from"@mui/material/Box";import{Stack as t}from"../../_Primitives/Stack.mjs";import{Body2 as o}from"../../Typography.mjs";import{useTheme as a}from"@mui/material/styles";import{colours as n}from"../../Theme/tokens.mjs";const m=({traceLabel:m,avatarIcon:s})=>{const c="dark"===a().palette.mode?n.jadeLight:n.jadeDark;return r(t,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[s&&e(i,{sx:{mt:.25,flexShrink:0},children:s}),e(i,{sx:{borderRadius:"1rem 1rem 1rem 0.25rem",border:"1px solid",borderColor:"divider",bgcolor:"background.default",px:1.75,py:1.25},children:r(t,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e(o,{sx:{color:"text.primary",fontWeight:600,opacity:1},children:m?`Agent is working... ${m}`:"Agent is working..."}),e(t,{direction:"row",spacing:.5,children:[0,150,300].map(r=>e(i,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:c,animation:"bounce 1s ease-in-out infinite",animationDelay:`${r}ms`,"@keyframes bounce":{"0%, 80%, 100%":{opacity:.35,transform:"translateY(0)"},"40%":{opacity:1,transform:"translateY(-1px)"}}}},r))})]})})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useState as i,useCallback as r}from"react";import n from"@mui/icons-material/ChevronRight";import{H4 as s,Caption as l}from"../Typography.mjs";import
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useState as i,useCallback as r}from"react";import n from"@mui/icons-material/ChevronRight";import{H4 as s,Caption as l}from"../Typography.mjs";import a from"@mui/material/Box";import{Stack as c}from"../_Primitives/Stack.mjs";import{Divider as h}from"../_Primitives/Divider.mjs";import{IconButton as d}from"../Buttons/IconButton.mjs";import{ChatHistoryHeader as m}from"./ChatHistoryHeader.mjs";import{ChatHistoryButtonBase as x}from"./ChatHistoryButtonBase.mjs";import{ChatHistoryAgentItem as p}from"./ChatHistoryAgentItem.mjs";import{filterChatHistoryConversations as g}from"./ChatHistorySearch.mjs";const f=({conversations:f,activeConversationId:C,onSelectConversation:v,onDeleteConversation:y,onNewConversation:u,onClose:b,onSearchChange:S,agents:w,activeAgentId:j,onSelectAgent:k,title:A="Chat history",agentsLabel:H="Agents",sectionLabel:T="Chats",emptyText:D="No conversations yet",newChatTitle:B="New chat",deleteConversationTitle:I="Delete conversation",searchPlaceholder:N="Search conversations",searchDebounceMs:M=300,width:P=288,sx:L,formatMessageCount:R=e=>`${e} messages`,isCollapsed:W=!1,onToggleCollapse:$,collapsedWidth:_=40})=>{const[z,E]=i(""),Q=r(e=>{E(e),S?.(e)},[S]),Y=g(f,z),q=w&&w.length>0;return e(a,{sx:{width:W?_:P,minWidth:W?_:0,flexShrink:0,borderRight:1,borderColor:"divider",overflow:"hidden",transition:"width 0.2s ease, min-width 0.2s ease",display:"flex",flexDirection:"column"},children:W?e(c,{sx:{justifyContent:"center",alignItems:"center",py:2,borderBottom:1,borderColor:"divider",flexShrink:0},children:e(d,{onClick:$,title:"Expand history",ariaLabel:"expand-history",sx:{width:36,height:36},children:e(n,{sx:{fontSize:18}})})}):t(c,{direction:"column",sx:[{flex:1,minHeight:0},...Array.isArray(L)?L:L?[L]:[]],children:[e(m,{newChatTitle:B,onNewConversation:u,onClose:b,onToggleCollapse:$,onSearchChange:Q,searchPlaceholder:N,searchDebounceMs:M}),t(c,{direction:"column",sx:{flex:1,minHeight:0},children:[q&&t(o,{children:[t(c,{sx:{flexShrink:0,px:1.5,pt:1,pb:.5},children:[e(s,{sx:{color:"text.secondary",py:.5},children:H}),w.map(t=>e(p,{agent:t,isActive:t.id===j,onSelect:k??(()=>{})},t.id))]}),e(h,{sx:{flexShrink:0}})]}),t(c,{direction:"column",sx:{flex:1,minHeight:0},children:[q&&t(c,{direction:"row",sx:{alignItems:"center",px:1.5,pt:1,pb:.5,flexShrink:0},children:[e(s,{sx:{flex:1,color:"text.secondary"},children:T}),z&&Y.length>0&&t(l,{sx:{color:"text.disabled"},children:[Y.length," ",1===Y.length?"result":"results"]})]}),e(a,{component:"nav","aria-label":A,sx:{flex:1,overflowY:"auto",px:1,pt:1,pb:1},children:0===Y.length?e(l,{sx:{display:"block",px:.5,py:2,color:"text.disabled"},children:z?`No results for "${z}"`:D}):Y.map(t=>e(x,{conversation:t,isActive:t.id===C,highlightQuery:z,onSelectConversation:v,onDeleteConversation:y,deleteConversationTitle:I,formatMessageCount:R},t.id))})]})]})]})})};export{f as ChatHistory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@mui/icons-material/ChatBubbleOutlined";import o from"@mui/icons-material/DeleteForeverOutlined";import{Tooltip as i}from"@mui/material";import{Body1 as n,Caption as a}from"../Typography.mjs";import{GhostButton as s}from"../Buttons/GhostButton.mjs";import
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@mui/icons-material/ChatBubbleOutlined";import o from"@mui/icons-material/DeleteForeverOutlined";import{Tooltip as i}from"@mui/material";import{Body1 as n,Caption as a}from"../Typography.mjs";import{GhostButton as s}from"../Buttons/GhostButton.mjs";import l from"@mui/material/Box";import{IconButton as m}from"../Buttons/IconButton.mjs";import{colours as p}from"../Theme/tokens.mjs";const d=(e,t)=>{const o=t?.trim();if(!o)return e;const i=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(o)})`,"ig");return e.split(i).map((e,t)=>{if(!e)return null;return e.toLowerCase()===o.toLowerCase()?r(l,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:e},`${e}-${t}`):e})},c=({conversation:c,isActive:u,highlightQuery:b,onSelectConversation:h,onDeleteConversation:g,deleteConversationTitle:x,formatMessageCount:f,showMessageCount:y=!1,sx:v})=>{const C=(e=>"number"==typeof e.messageCount?e.messageCount:Array.isArray(e.messages)?e.messages.length:0)(c);return e(l,{sx:[{position:"relative",mb:.5,"&:hover .delete-button":{visibility:"visible"}},...Array.isArray(v)?v:v?[v]:[]],children:[r(i,{title:c.agentName??"",placement:"right",disableInteractive:!0,children:r("span",{children:e(s,{onClick:()=>h(c.id),sx:{width:"100%",display:"flex",alignItems:"center",gap:1.25,borderRadius:1,px:1.5,py:.75,pr:4.5,backgroundColor:u?e=>e.palette.background.paper:"transparent",backgroundImage:"none",opacity:1,border:"1px solid",borderColor:u?p.primaryGreenActive:"transparent","&:hover":{backgroundColor:u?e=>e.palette.background.paper:"action.hover",backgroundImage:"none"},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`}},children:[r(t,{sx:{fontSize:14,color:u?p.primaryGreenActive:"text.disabled"}}),e(l,{sx:{flex:1,minWidth:0},children:[r(n,{component:"span",sx:{display:"block",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:u?"text.primary":"text.secondary"},children:d(c.title,b)}),y&&r(a,{noWrap:!0,sx:{display:"block"},children:f(C)})]})]})})}),r(l,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},children:r(m,{className:"delete-button",title:x,ariaLabel:x,onClick:e=>{e.stopPropagation(),g&&Promise.resolve(g(c.id))},disabled:!g,sx:{visibility:"hidden"},children:r(o,{sx:{fontSize:14,color:u?"error.main":"text.disabled"}})})})]})};export{c as ChatHistoryButtonBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useId as o,useState as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useId as o,useState as r}from"react";import i from"@mui/icons-material/Send";import l from"@mui/icons-material/Stop";import n from"@mui/material/Box";import{IconButton as a}from"../Buttons/IconButton.mjs";import{Paper as s}from"../_Primitives/Paper.mjs";import{TextField as m}from"../_Primitives/TextField.mjs";import{colours as d}from"../Theme/tokens.mjs";const p=({onSend:p,disabled:c=!1,placeholder:u="Ask about campaigns, performance…",maxRows:f=5,sendButtonTitle:h="Send message",isStreaming:b=!1,onStop:x,stopButtonTitle:g="Stop generating",actions:v,value:S,onChange:y,inputRef:j,label:k="Message"})=>{const w=o(),[z,B]=r(""),R=void 0!==S,I=R?S:z,T=e=>{R?y?.(e):B(e)},C=d.jadeLight,P=d.black,D=()=>{const e=I.trim();e&&!c&&(p(e),T(""))};return e(n,{component:"form",onSubmit:e=>{e.preventDefault(),b||D()},sx:{display:"flex",alignItems:"center",gap:1},children:[t("label",{htmlFor:w,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:k}),e(s,{variant:"outlined",sx:{display:"flex",flex:1,alignItems:"center",gap:1,px:1.5,py:.75,borderRadius:2,borderColor:"text.jades"},children:[t(m,{variant:"standard",fullWidth:!0,multiline:!0,minRows:1,maxRows:f,value:I,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),b||D())},placeholder:u,disabled:c,inputRef:j,slotProps:{htmlInput:{id:w,"aria-label":u},input:{disableUnderline:!0}},sx:{"& .MuiInputBase-input":{p:.5,fontSize:"0.875rem",color:"text.primary",resize:"none","&::placeholder":{color:"text.disabled",opacity:1}}}}),v,t(a,b&&x?{type:"button",title:g,onClick:x,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:"error.main",color:"error.contrastText","&:hover":{bgcolor:"error.dark"}},children:t(l,{sx:{fontSize:13}})}:{type:"submit",title:h,disabled:!I.trim()||c,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:C,color:P,"&:hover":{bgcolor:d.jade},"&.Mui-disabled":{bgcolor:C,color:P,opacity:.4}},children:t(i,{sx:{fontSize:13}})})]})]})};export{p as ChatInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import s from"@mui/material/Box";import{AiButton as i}from"../Buttons/AiButton.mjs";const m=({onOpen:m,fabLabel:o,placement:n="bottom-right"})=>t(s,{sx:{position:"fixed",bottom:{xs:16,sm:24},..."bottom-left"===n?{left:{xs:16,sm:24}}:{right:{xs:16,sm:24}},zIndex:t=>t.zIndex.appBar+50},children:t(i,{onClick:m,"aria-label":o,label:t(s,{component:"span",sx:{display:{xs:"none",sm:"inline"}},children:o}),sx:{"& .MuiButton-startIcon":{marginRight:{xs:0,sm:"8px"},marginLeft:{xs:0,sm:"-4px"}},minWidth:{xs:0,sm:64},width:{xs:"37px",sm:"auto"},height:{xs:"37px",sm:"auto"},padding:{xs:0,sm:"6px 16px"}}})});export{m as FABButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import i from"@mui/material/Box";import"react";import"@mui/icons-material/Check";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Download";import"@mui/icons-material/ArrowUpward";import"@mui/icons-material/ArrowDownward";import"@mui/material";import"@mui/material/styles";import"../../Theme/tokens.mjs";import"../ChatComponents/ChatAvatar.mjs";import"../ChatComponents/MarkdownContent.mjs";import"../../../node_modules/dompurify/dist/purify.es.mjs";import"../../Typography.mjs";import"../../MetricStat.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"../../Code.mjs";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import m from"../ChatComponents/MessageList.mjs";import o from"../ChatComponents/EmptyState.mjs";const e=({avatarIcon:e,isTyping:r,liveTraceEvents:a,messages:s,showActivity:n,streamingText:p,emptyTitle:c,emptyDescription:l,dataSources:u,suggestedPrompts:d,onSend:h})=>{const C=s.length>0||r;return t(i,{sx:{flex:"1 1 0",minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:C?t(m,{messages:s,isTyping:r,streamingText:p,liveTraceEvents:a,avatarIcon:e,showActivity:n,compact:!0}):t(o,{title:c,description:l,dataSources:u,prompts:d.slice(0,4),avatarIcon:e,onSelect:h})})};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import r from"@mui/material/Box";import{ChatInput as e}from"../ChatInput.mjs";const i=({placeholder:i,isStreaming:n,onStop:t,onSend:p})=>o(r,{sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",p:1.5,flexShrink:0},children:o(e,{onSend:p,isStreaming:n,onStop:t,placeholder:i})});export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as n,Fragment as r,jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as o,useCallback as d}from"react";import{Root as a,Trigger as i,Portal as
|
|
1
|
+
import{jsxs as n,Fragment as r,jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as o,useCallback as d}from"react";import{Root as a,Trigger as i,Portal as p,Content as s}from"../node_modules/@radix-ui/react-popover/dist/index.mjs";import{DayPicker as l}from"react-day-picker";import{startOfDay as m,isAfter as c,isBefore as b,subDays as h,format as y}from"date-fns";import u from"@mui/icons-material/CalendarToday";import g from"@mui/icons-material/ChevronLeft";import f from"@mui/icons-material/ChevronRight";import v from"@mui/material/GlobalStyles";import k from"@mui/material/Box";import{Caption as x}from"./Typography.mjs";import{Chip as w}from"./_Primitives/Chip.mjs";import{Divider as C}from"./_Primitives/Divider.mjs";import{Paper as j}from"./_Primitives/Paper.mjs";import{SecondaryButton as M}from"./Buttons/SecondaryButton.mjs";import{Stack as _}from"./_Primitives/Stack.mjs";import{useTheme as D,alpha as S}from"@mui/material";import{colours as R}from"./Theme/tokens.mjs";const z=[{label:"Last 7 days",days:7},{label:"Last 30 days",days:30},{label:"Last 90 days",days:90}],T=({startDate:T,endDate:I,onChange:L,dataAvailableThrough:P,earliestStartDate:G,className:O})=>{const[$,A]=t(!1),B="dark"===D().palette.mode,N=R.brilliantGreen,W=S(N,.2),F=B?R.white:R.black,Y=B?R.lightGrey:R.darkGrey,H=o(()=>P??m(new Date),[P]),q=o(()=>G?m(G):void 0,[G]),E=d(n=>{const r=m(n);return!!c(r,H)||!(!q||!b(r,q))},[H,q]),J=d(n=>{const r=H,e=h(r,n-1),t=q&&b(e,q)?q:e;L({startDate:t,endDate:r})},[H,q,L]),K=d(n=>{L({startDate:n?.from,endDate:n?.to})},[L]),Q=o(()=>{if(!T&&!I)return"Select dates";const n=n=>y(n,"MMM d, yyyy");return T&&I?T.getFullYear()===I.getFullYear()?`${r=T,y(r,"MMM d")} - ${n(I)}`:`${n(T)} - ${n(I)}`:T?n(T):I?n(I):"Select dates";var r},[T,I]),U=o(()=>T||h(H,30),[T,H]);return n(r,{children:[e(v,{styles:{".rdp-nn-root":{padding:16},".rdp-nn-months":{display:"flex",gap:16},"@media (max-width: 899px)":{".rdp-nn-months":{flexDirection:"column"}},".rdp-nn-month":{position:"relative"},".rdp-nn-month-caption":{display:"flex",justifyContent:"center",alignItems:"center",paddingTop:4,minHeight:28},".rdp-nn-caption-label":{fontSize:"0.875rem",fontWeight:500,color:F},".rdp-nn-nav":{display:"flex",alignItems:"center",gap:4},".rdp-nn-weekdays":{display:"flex"},".rdp-nn-weekday":{width:36,borderRadius:6,fontSize:"0.8rem",fontWeight:400,textAlign:"center"},".rdp-nn-week":{display:"flex",width:"100%",marginTop:8},".rdp-nn-day":{position:"relative",width:36,height:36,padding:0,textAlign:"center"},".rdp-nn-day-btn":{width:36,height:36,padding:0,border:0,borderRadius:999,backgroundColor:"transparent",color:F,cursor:"pointer",font:"inherit",transition:"background-color 150ms ease"},".rdp-nn-day-btn:hover":{backgroundColor:W},".rdp-nn-nav-btn":{position:"absolute",top:0,width:28,height:28,padding:0,border:0,backgroundColor:"transparent",color:Y,opacity:.5,cursor:"pointer",transition:"opacity 150ms ease"},".rdp-nn-nav-btn:hover":{opacity:1},".rdp-nn-button-previous":{left:4},".rdp-nn-button-next":{right:4},".rdp-nn-weekday, .rdp-nn-nav-btn":{color:Y},".rdp-nn-outside .rdp-nn-day-btn, .rdp-nn-disabled .rdp-nn-day-btn":{color:Y,opacity:.4},".rdp-nn-disabled .rdp-nn-day-btn:hover":{backgroundColor:"transparent",cursor:"not-allowed"},".rdp-nn-selected":{backgroundColor:N,borderRadius:"50%"},".rdp-nn-selected .rdp-nn-day-btn":{color:R.black},".rdp-nn-selected .rdp-nn-day-btn:hover":{backgroundColor:R.jade},".rdp-nn-range-start":{backgroundColor:N,borderRadius:"50% 0 0 50%"},".rdp-nn-range-start .rdp-nn-day-btn":{color:R.black},".rdp-nn-range-start .rdp-nn-day-btn:hover":{backgroundColor:R.jade},".rdp-nn-range-end":{backgroundColor:N,borderRadius:"0 50% 50% 0"},".rdp-nn-range-end .rdp-nn-day-btn":{color:R.black},".rdp-nn-range-end .rdp-nn-day-btn:hover":{backgroundColor:R.jade},".rdp-nn-range-middle":{backgroundColor:W,borderRadius:0},".rdp-nn-today .rdp-nn-day-btn":{fontWeight:700}}}),n(a,{open:$,onOpenChange:A,children:[e(i,{asChild:!0,children:e(M,{size:"small",startIcon:e(u,{sx:{fontSize:14}}),className:O,children:Q})}),e(p,{children:e(s,{align:"end",sideOffset:8,style:{zIndex:1300},children:n(j,{sx:{p:0,overflow:"hidden",borderRadius:1},children:[e(_,{direction:"row",spacing:1,sx:{p:2},children:z.map(n=>e(w,{label:n.label,size:"small",onClick:()=>J(n.days),variant:"outlined",clickable:!0},n.days))}),e(C,{}),n(_,{direction:"row",spacing:1,sx:{px:2,py:1,alignItems:"center"},children:[e(k,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"primary.main",flexShrink:0}}),n(x,{children:["Data available through ",y(H,"MMM d, yyyy")]})]}),e(l,{mode:"range",numberOfMonths:2,selected:T||I?{from:T,to:I}:void 0,onSelect:K,defaultMonth:U,startMonth:q,endMonth:H,disabled:E,navLayout:"around",showOutsideDays:!0,classNames:{root:"rdp-nn-root",months:"rdp-nn-months",month:"rdp-nn-month",month_caption:"rdp-nn-month-caption",caption_label:"rdp-nn-caption-label",nav:"rdp-nn-nav",button_previous:"rdp-nn-nav-btn rdp-nn-button-previous",button_next:"rdp-nn-nav-btn rdp-nn-button-next",weekdays:"rdp-nn-weekdays",weekday:"rdp-nn-weekday",week:"rdp-nn-week",day:"rdp-nn-day",day_button:"rdp-nn-day-btn",range_start:"rdp-nn-range-start",range_end:"rdp-nn-range-end",range_middle:"rdp-nn-range-middle",selected:"rdp-nn-selected",today:"rdp-nn-today",outside:"rdp-nn-outside",disabled:"rdp-nn-disabled"},components:{Chevron:({orientation:n,...r})=>e("left"===n?g:f,{sx:{fontSize:16},...r})}})]})})})]})]})};export{T as DateRangeFilter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as r,Fragment as e}from"react/jsx-runtime";import{useState as i,useMemo as o,useCallback as a}from"react";import{Popover as l}from"@mui/material";import{LocalizationProvider as m,DatePicker as n}from"@mui/x-date-pickers";import{AdapterDateFns as s}from"@mui/x-date-pickers/AdapterDateFns";import d from"@mui/icons-material/CalendarToday";import{startOfDay as c,isAfter as p,subDays as f,isBefore as h,format as u}from"date-fns";import
|
|
1
|
+
import{jsx as t,jsxs as r,Fragment as e}from"react/jsx-runtime";import{useState as i,useMemo as o,useCallback as a}from"react";import{Popover as l}from"@mui/material";import{LocalizationProvider as m,DatePicker as n}from"@mui/x-date-pickers";import{AdapterDateFns as s}from"@mui/x-date-pickers/AdapterDateFns";import d from"@mui/icons-material/CalendarToday";import{startOfDay as c,isAfter as p,subDays as f,isBefore as h,format as u}from"date-fns";import x from"@mui/material/Box";import{Caption as y}from"./Typography.mjs";import{Chip as v}from"./_Primitives/Chip.mjs";import{Divider as g}from"./_Primitives/Divider.mjs";import{Paper as b}from"./_Primitives/Paper.mjs";import{SecondaryButton as D}from"./Buttons/SecondaryButton.mjs";import{Stack as C}from"./_Primitives/Stack.mjs";const P=[{label:"Last 7 days",days:7},{label:"Last 30 days",days:30},{label:"Last 90 days",days:90}];function j(t){return t?c(t):void 0}function k(t,r,e){if(!t)return;const i=j(t);return i?r&&h(i,r)?r:e&&p(i,e)?e:i:void 0}const w=({value:w,onChange:z,presets:M=P,minDate:F,maxDate:L,className:S,emptyLabel:W="Select dates",availabilityLabel:B})=>{const[$,_]=i(null),T=o(()=>j(F),[F]),A=o(()=>c(L??new Date),[L]),E=o(()=>k(w.from,T,A),[w.from,T,A]),I=o(()=>k(w.to,T,A),[w.to,T,A]),N=o(()=>{if(!E&&!I)return W;const t=t=>u(t,"MMM d, yyyy");return E&&I?E.getFullYear()===I.getFullYear()?`${r=E,u(r,"MMM d")} - ${t(I)}`:`${t(E)} - ${t(I)}`:t(E||I);var r},[E,I,W]),O=a(t=>{const r=k(t.from,T,A),e=k(t.to,T,A);r&&e&&p(r,e)?z({from:r,to:r}):z({from:r,to:e})},[z,T,A]),Y=a(t=>{_(t.currentTarget)},[]),q=a(()=>{_(null)},[]),G=a(t=>{const r=A,e=f(r,t-1);O({from:T&&h(e,T)?T:e,to:r})},[A,T,O]);return t(m,{dateAdapter:s,children:r(e,{children:[t(D,{size:"small",startIcon:t(d,{sx:{fontSize:14}}),className:S,onClick:Y,children:N}),t(l,{open:Boolean($),anchorEl:$,onClose:q,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{mt:1}}},children:r(b,{sx:{p:0,minWidth:360,maxWidth:720,overflow:"hidden"},children:[M.length>0&&r(e,{children:[t(C,{direction:"row",spacing:1,sx:{p:2,flexWrap:"wrap"},children:M.map(r=>t(v,{label:r.label,size:"small",variant:"outlined",clickable:!0,onClick:()=>G(r.days)},r.label))}),t(g,{})]}),B&&r(e,{children:[t(y,{sx:{display:"block",px:2,py:1.25},children:B}),t(g,{})]}),r(C,{direction:{xs:"column",md:"row"},spacing:2,sx:{p:2,alignItems:"flex-start"},children:[t(x,{sx:{width:{xs:"100%",md:280}},children:t(n,{label:"Start date",value:E??null,onChange:t=>O({from:t??void 0,to:I}),minDate:T,maxDate:I??A,slotProps:{textField:{size:"small",fullWidth:!0}}})}),t(x,{sx:{width:{xs:"100%",md:280}},children:t(n,{label:"End date",value:I??null,onChange:t=>O({from:E,to:t??void 0}),minDate:E??T,maxDate:A,slotProps:{textField:{size:"small",fullWidth:!0}}})})]})]})})]})})};export{w as DateRangePicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{GlassPaper as i}from"./GlassPaper.mjs";import
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{GlassPaper as i}from"./GlassPaper.mjs";import n from"@mui/material/Box";import{H3 as l,Body2 as t}from"./Typography.mjs";import{LoadingSpinnerNexus as s}from"./LoadingSpinnerNexus.mjs";const o=({title:o,description:c,actions:m,isLoading:d,isError:x,errorMessage:h,children:a,...p})=>{if(d)return r(i,{...p,children:[r(n,{sx:{mb:2},children:[e(l,{children:o}),c&&e(t,{sx:{mt:.5},children:c})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(s,{})})]});if(x)return r(i,{...p,children:[r(n,{sx:{mb:2},children:[e(l,{children:o}),c&&e(t,{sx:{mt:.5},children:c})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(t,{color:"error",sx:{p:2},children:h??`Failed to load ${o}.`})})]});const f=o||c||m;return r(i,{...p,children:[f&&r(n,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1,mb:2.5},children:[r(n,{children:[e(l,{children:o}),c&&e(t,{sx:{mt:.5},children:c})]}),m&&e(n,{sx:{flexShrink:0},children:m})]}),a]})};export{o as GlassPaperAsync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"@mui/material/Box";import{NexusLogoNode as r}from"./Logo/NexusLogoNode.mjs";const a={small:40,large:140},n=({size:t})=>e("svg",{width:t,height:t,viewBox:"42 42 116 116",xmlns:"http://www.w3.org/2000/svg",children:e("g",{transform:"translate(100, 100)",children:e(r,{})})}),s=({variant:r="small"})=>{const s=a[r];return e(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"auto"},children:e(t,{sx:{width:s,height:s,"@keyframes snl-spin":{"0%":{transform:"rotate(0deg) scale(1)"},"25%":{transform:"rotate(90deg) scale(1.12)"},"50%":{transform:"rotate(180deg) scale(1)"},"75%":{transform:"rotate(270deg) scale(0.88)"},"100%":{transform:"rotate(360deg) scale(1)"}},animation:"snl-spin 2.4s linear infinite","@media (prefers-reduced-motion: reduce)":{animation:"none"}},children:e(n,{size:s})})})};export{s as LoadingSpinnerNexus};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{keyframes as o,alpha as t}from"@mui/material/styles";import a from"@mui/material/useMediaQuery";import i from"@mui/material/Box";import{Stack as n}from"./_Primitives/Stack.mjs";import{NexusNodeIcon as s}from"./Logo/NexusNodeIcon.mjs";import{colours as d}from"./Theme/tokens.mjs";import{useTokens as l}from"./Theme/useTokens.mjs";import{Caption as m}from"./Typography.mjs";const b=o`
|
|
2
|
+
from { transform: rotate(var(--orbit-angle)); }
|
|
3
|
+
to { transform: rotate(calc(var(--orbit-angle) + 360deg)); }
|
|
4
|
+
`,c=o`
|
|
5
|
+
from { transform: translate(-50%, -50%) rotate(calc(0deg - var(--orbit-angle))); }
|
|
6
|
+
to { transform: translate(-50%, -50%) rotate(calc(0deg - var(--orbit-angle) - 360deg)); }
|
|
7
|
+
`,p=({labels:o,core:p,"aria-label":u,sx:g})=>{const x=l(),f=a("(prefers-reduced-motion: reduce)",{noSsr:!0}),h=o.slice(0,6),y={position:"absolute",borderRadius:"50%",border:`1px solid ${x.border}`};return r(i,{...u?{role:"img","aria-label":`${u}: ${h.join(", ")}`}:{"aria-hidden":!0},sx:[{position:"relative",aspectRatio:"1",width:"100%",maxWidth:450},...Array.isArray(g)?g:g?[g]:[]],children:[e(i,{"data-testid":"nexus-orbit-halo",sx:{position:"absolute",inset:"18%",borderRadius:"50%",backgroundColor:t(d.brilliantGreen,.07),filter:"blur(26px)"}}),e(i,{"data-testid":"nexus-orbit-ring",sx:{...y,inset:"8%"}}),e(i,{"data-testid":"nexus-orbit-ring",sx:{...y,inset:"22%",borderStyle:"dashed"}}),e(i,{"data-testid":"nexus-orbit-ring",sx:{...y,inset:"36%",borderColor:d.jade}}),e(i,{"data-testid":"nexus-orbit-core",sx:{position:"absolute",inset:"41%",display:"grid",placeItems:"center",border:`1px solid ${d.jade}`,borderRadius:"24%",backgroundColor:x.background.paper,boxShadow:x.shadow,transform:"rotate(45deg)"},children:e(i,{sx:{display:"grid",placeItems:"center",transform:"rotate(-45deg)"},children:p??e(s,{size:"lg",tone:"brand"})})}),h.map((o,t)=>{const a=360*t/h.length-35;return e(i,{"data-testid":"nexus-orbit-track",sx:{"--orbit-angle":`${a}deg`,position:"absolute",inset:"8%",transform:"rotate(var(--orbit-angle))",animation:f?"none":`${b} 46s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},children:e(i,{sx:{position:"absolute",left:"50%",top:0},children:r(n,{direction:"row","data-testid":"nexus-orbit-label",sx:{position:"absolute",alignItems:"center",gap:1,px:1.875,py:1.25,border:`1px solid ${x.border}`,borderRadius:"30px",backgroundColor:x.background.paper,boxShadow:x.shadow,whiteSpace:"nowrap",transform:"translate(-50%, -50%) rotate(calc(0deg - var(--orbit-angle)))",animation:f?"none":`${c} 46s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},children:[e(i,{sx:{width:6,height:6,borderRadius:"50%",backgroundColor:d.jade}}),e(m,{sx:{fontSize:11,letterSpacing:"0.05em"},children:o})]})})},`${t}-${o}`)})]})};p.displayName="NexusOrbit";export{p as NexusOrbit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Paper as i}from"./_Primitives/Paper.mjs";import
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Paper as i}from"./_Primitives/Paper.mjs";import n from"@mui/material/Box";import{H2 as t,H4 as l,H3 as s,Body2 as o}from"./Typography.mjs";import{LoadingSpinnerNexus as c}from"./LoadingSpinnerNexus.mjs";const m=({title:m,titleComponent:d="h3",titleSx:x,description:h,actions:a,isLoading:p,isError:f,errorMessage:u,children:g,...y})=>{const j="h2"===d?t:"h4"===d?l:s;if(p)return r(i,{...y,children:[r(n,{sx:{mb:2},children:[e(j,{sx:x,children:m}),h&&e(o,{sx:{mt:.5},children:h})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(c,{})})]});if(f)return r(i,{...y,children:[r(n,{sx:{mb:2},children:[e(j,{sx:x,children:m}),h&&e(o,{sx:{mt:.5},children:h})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(o,{color:"error",sx:{p:2},children:u??`Failed to load ${m}.`})})]});const b=m||h||a;return r(i,{...y,children:[b&&r(n,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1,mb:1},children:[r(n,{children:[e(j,{sx:x,children:m}),h&&e(o,{sx:{mt:.5},children:h})]}),a&&e(n,{sx:{flexShrink:0},children:a})]}),g]})};export{m as PaperAsync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{alpha as i}from"@mui/material/styles";import t from"@mui/icons-material/ArrowDownwardRounded";import a from"@mui/icons-material/ArrowForwardRounded";import o from"@mui/material/Box";import{Stack as s}from"./_Primitives/Stack.mjs";import{Caption as n,H3 as m,Body2 as d}from"./Typography.mjs";const l=({steps:l,"aria-label":p,headingLevel:c=3,sx:h})=>e(o,{component:"ol","aria-label":p,sx:[e=>({listStyle:"none",m:0,p:0,width:"100%",maxWidth:1100,mx:"auto",display:"grid",gridTemplateColumns:{xs:"minmax(0, 1fr)",md:`repeat(${l.length}, minmax(0, 1fr))`},columnGap:e.spacing(10),rowGap:{xs:e.spacing(6),md:0},alignItems:"start",textAlign:"left"}),...Array.isArray(h)?h:h?[h]:[]],children:l.map(({icon:p,title:h,description:x},g)=>r(o,{component:"li",sx:{position:"relative",minWidth:0},children:[r(s,{sx:{gap:1},children:[r(s,{direction:"row",sx:{gap:1.25,alignItems:"center"},children:[e(o,{"aria-hidden":"true",sx:e=>({width:40,height:40,display:"grid",placeItems:"center",borderRadius:1.75,flexShrink:0,backgroundColor:i(e.palette.primary.main,"dark"===e.palette.mode?.22:.12)}),children:e(p,{sx:{fontSize:22,color:"primary.main"}})}),r(s,{sx:{minWidth:0},children:[r(n,{children:["Step ",g+1]}),e(m,{component:`h${c}`,sx:{overflowWrap:"anywhere"},children:h})]})]}),e(d,{sx:{overflowWrap:"anywhere"},children:x})]}),g<l.length-1&&r(o,{"aria-hidden":"true","data-testid":"process-steps-connector",sx:e=>({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",color:"primary.main",top:{xs:"100%",md:0},left:{xs:0,md:"100%"},width:{xs:"100%",md:e.spacing(10)},height:{xs:e.spacing(6),md:40}}),children:[e(a,{"data-testid":"process-steps-arrow-right",sx:{display:{xs:"none",md:"block"}}}),e(t,{"data-testid":"process-steps-arrow-down",sx:{display:{xs:"block",md:"none"}}})]})]},g))});l.displayName="ProcessSteps";export{l as ProcessSteps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.9.
|
|
1
|
+
const o="2.9.13";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, Ref, ReactElement, FormEventHandler, RefObject, ComponentType, CSSProperties, PropsWithChildren } from 'react';
|
|
3
|
-
import { AlertProps,
|
|
4
|
-
export { AlertProps, AlertTitle,
|
|
3
|
+
import { AlertProps, SxProps as SxProps$1, Theme as Theme$1, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, ToggleButtonGroupProps, SwitchProps, SliderProps as SliderProps$1, AccordionSummaryProps, ButtonProps, ChipProps, CardProps as CardProps$1, PaperProps, CircularProgressProps, CollapseProps, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormGroupProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, TableProps, TableBodyProps, TableCellProps, TableHeadProps, TableRowProps, BoxProps as BoxProps$1, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
|
|
4
|
+
export { AlertProps, AlertTitle, ButtonBaseProps, CheckboxProps, ChipProps, CircularProgressProps, CollapseProps, ContainerProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, FormControlLabelProps, FormGroupProps, GridProps, MenuItem, PaperProps, StackProps, SwitchProps, TabProps, TableBodyProps, TableCellProps, TableHeadProps, TableProps, TableRowProps, TabsProps, TextFieldProps, Theme, alpha, useMediaQuery, useTheme } from '@mui/material';
|
|
5
|
+
import { BoxProps } from '@mui/material/Box';
|
|
6
|
+
export { default as Box, BoxProps } from '@mui/material/Box';
|
|
5
7
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
6
8
|
import { Components } from 'react-markdown';
|
|
7
9
|
import SvgIcon from '@mui/material/SvgIcon';
|
|
@@ -159,8 +161,6 @@ interface AgentChatWidgetProps {
|
|
|
159
161
|
}
|
|
160
162
|
declare function AgentChatWidget({ title, subtitle, fabLabel, avatarIcon, placeholder, emptyTitle, emptyDescription, dataSources, suggestedPrompts, isOpen, isTyping, messages, streamingText, liveTraceEvents, showActivity, onOpen, onClose, onSend, onStop, onExpandToFullPage, hideFab, placement, }: AgentChatWidgetProps): react.JSX.Element | null;
|
|
161
163
|
|
|
162
|
-
declare const Box: ({ children, ...rest }: BoxProps) => react.JSX.Element;
|
|
163
|
-
|
|
164
164
|
interface ChatHistoryConversation {
|
|
165
165
|
id: string;
|
|
166
166
|
title: string;
|
|
@@ -330,9 +330,26 @@ declare const chatHistoryMatchesQuery: (conversation: ChatHistoryConversation, q
|
|
|
330
330
|
declare const filterChatHistoryConversations: <TConversation extends ChatHistoryConversation>(conversations: TConversation[], query: string) => TConversation[];
|
|
331
331
|
|
|
332
332
|
interface CopyableTableContainerProps {
|
|
333
|
-
children
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
children?: ReactNode;
|
|
334
|
+
table?: ChatTableData;
|
|
335
|
+
/** HTML must be sanitized by the caller before it reaches this prop. */
|
|
336
|
+
sanitizedHtml?: string;
|
|
337
|
+
}
|
|
338
|
+
interface ChatTableCell {
|
|
339
|
+
content: ReactNode;
|
|
340
|
+
sortText: string;
|
|
341
|
+
colSpan?: number;
|
|
342
|
+
rowSpan?: number;
|
|
343
|
+
scope?: string;
|
|
344
|
+
header?: boolean;
|
|
345
|
+
}
|
|
346
|
+
interface ChatTableData {
|
|
347
|
+
headers: ChatTableCell[];
|
|
348
|
+
rows: ChatTableCell[][];
|
|
349
|
+
footer?: ChatTableCell[][];
|
|
350
|
+
caption?: ReactNode;
|
|
351
|
+
}
|
|
352
|
+
declare const CopyableTableContainer: ({ children, table, sanitizedHtml, }: CopyableTableContainerProps) => react.JSX.Element;
|
|
336
353
|
|
|
337
354
|
interface ChatAvatarProps {
|
|
338
355
|
size?: "sm" | "md" | "lg";
|
|
@@ -351,6 +368,61 @@ interface MarkdownContentProps {
|
|
|
351
368
|
declare const chatWindowMarkdownComponents: Partial<Components>;
|
|
352
369
|
declare const MarkdownContent: ({ content, highlightQuery, compact, components: extraComponents, }: MarkdownContentProps) => react.JSX.Element;
|
|
353
370
|
|
|
371
|
+
interface ChatResponseMarkdownProps {
|
|
372
|
+
content: string;
|
|
373
|
+
highlightQuery?: string;
|
|
374
|
+
compact?: boolean;
|
|
375
|
+
components?: Partial<Components>;
|
|
376
|
+
}
|
|
377
|
+
declare const safeChatMarkdownComponents: Partial<Components>;
|
|
378
|
+
declare const ChatResponseMarkdown: ({ content, highlightQuery, compact, components, }: ChatResponseMarkdownProps) => react.JSX.Element;
|
|
379
|
+
|
|
380
|
+
type ChatDatapointValueFormat = "number" | "currency" | "percentage" | "duration";
|
|
381
|
+
type ChatDatapointPolarity = "higher_is_better" | "lower_is_better" | "neutral";
|
|
382
|
+
interface ChatDatapointDelta {
|
|
383
|
+
value: number;
|
|
384
|
+
valueFormat: ChatDatapointValueFormat;
|
|
385
|
+
comparison?: string | null;
|
|
386
|
+
}
|
|
387
|
+
interface ChatDatapointItem {
|
|
388
|
+
label: string;
|
|
389
|
+
value: number;
|
|
390
|
+
valueFormat: ChatDatapointValueFormat;
|
|
391
|
+
currency?: string | null;
|
|
392
|
+
unit?: string | null;
|
|
393
|
+
delta?: ChatDatapointDelta | null;
|
|
394
|
+
polarity?: ChatDatapointPolarity | null;
|
|
395
|
+
period?: string | null;
|
|
396
|
+
source?: string | null;
|
|
397
|
+
}
|
|
398
|
+
interface ChatDatapointsData {
|
|
399
|
+
schemaVersion?: string;
|
|
400
|
+
title?: string | null;
|
|
401
|
+
items: ChatDatapointItem[];
|
|
402
|
+
}
|
|
403
|
+
declare const columnsForItemCount: (count: number, maxColumns?: number) => number;
|
|
404
|
+
declare const formatDatapointValue: (value: unknown, valueFormat: ChatDatapointValueFormat, { currency, unit }?: Pick<ChatDatapointItem, "currency" | "unit">) => string;
|
|
405
|
+
declare const formatDatapointDelta: (delta: ChatDatapointDelta | null | undefined, item?: Pick<ChatDatapointItem, "currency" | "unit">) => string | null;
|
|
406
|
+
declare const deltaColorForPolarity: (delta: {
|
|
407
|
+
value: number;
|
|
408
|
+
} | null | undefined, polarity: ChatDatapointPolarity | null | undefined) => string | undefined;
|
|
409
|
+
|
|
410
|
+
interface ChatDatapointsProps {
|
|
411
|
+
datapoints: ChatDatapointsData | null;
|
|
412
|
+
}
|
|
413
|
+
declare const ChatDatapoints: ({ datapoints }: ChatDatapointsProps) => react.JSX.Element | null;
|
|
414
|
+
|
|
415
|
+
type ChatContentFallbackProps = {
|
|
416
|
+
variant: "notice";
|
|
417
|
+
kind?: "chart" | "mermaid";
|
|
418
|
+
} | {
|
|
419
|
+
variant: "diagnostic";
|
|
420
|
+
reason?: string | null;
|
|
421
|
+
rawSource: string;
|
|
422
|
+
defaultReason?: string;
|
|
423
|
+
};
|
|
424
|
+
declare const ChatContentFallback: (props: ChatContentFallbackProps) => react.JSX.Element;
|
|
425
|
+
|
|
354
426
|
interface MessageBubbleProps {
|
|
355
427
|
message: ChatMessage;
|
|
356
428
|
highlightQuery?: string;
|
|
@@ -359,7 +431,7 @@ interface MessageBubbleProps {
|
|
|
359
431
|
onFeedback?: (messageId: string, rating: "positive" | "negative", comment?: string) => void;
|
|
360
432
|
/** Called when the user clicks a file download button */
|
|
361
433
|
onDownloadFile?: (file: FileArtifact) => Promise<void>;
|
|
362
|
-
/** Replaces the default
|
|
434
|
+
/** Replaces the default ChatResponseMarkdown renderer — use for custom chart/rich content */
|
|
363
435
|
contentRenderer?: (content: string) => React.ReactNode;
|
|
364
436
|
/** Override or extend individual markdown element renderers */
|
|
365
437
|
markdownComponents?: Partial<Components>;
|
|
@@ -684,6 +756,7 @@ interface ActionBarProps {
|
|
|
684
756
|
title?: ReactNode;
|
|
685
757
|
extraLeft?: ReactNode;
|
|
686
758
|
extraRight?: ReactNode;
|
|
759
|
+
rightActions?: ReactNode;
|
|
687
760
|
homeHref?: string;
|
|
688
761
|
showHome?: boolean;
|
|
689
762
|
logo?: ReactNode;
|
|
@@ -693,7 +766,7 @@ interface ActionBarProps {
|
|
|
693
766
|
buttonRef?: Ref<HTMLButtonElement>;
|
|
694
767
|
};
|
|
695
768
|
}
|
|
696
|
-
declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, showHome, logo, mobileNavigation, }: ActionBarProps) => ReactElement;
|
|
769
|
+
declare const ActionBar: ({ title, extraLeft, extraRight, rightActions, homeHref, showHome, logo, mobileNavigation, }: ActionBarProps) => ReactElement;
|
|
697
770
|
|
|
698
771
|
interface AccordionGroupProps {
|
|
699
772
|
children: ReactNode;
|
|
@@ -975,7 +1048,7 @@ type PaperAsyncProps = Omit<PaperProps, "children"> & {
|
|
|
975
1048
|
};
|
|
976
1049
|
declare const PaperAsync: ({ title, titleComponent, titleSx, description, actions, isLoading, isError, errorMessage, children, ...rest }: PaperAsyncProps) => react.JSX.Element;
|
|
977
1050
|
|
|
978
|
-
type GreenWaveBackgroundProps = BoxProps;
|
|
1051
|
+
type GreenWaveBackgroundProps = BoxProps$1;
|
|
979
1052
|
declare const GreenWaveBackground: ({ sx, children, ...rest }: GreenWaveBackgroundProps) => react.JSX.Element;
|
|
980
1053
|
|
|
981
1054
|
type IconButtonVariant = "standard" | "filled" | "outlined";
|
|
@@ -1005,7 +1078,7 @@ interface AvatarProps {
|
|
|
1005
1078
|
/** Icon or initials to render inside the circle */
|
|
1006
1079
|
children?: React.ReactNode;
|
|
1007
1080
|
/** Additional MUI sx overrides — use for layout only (e.g. margins), not visual design */
|
|
1008
|
-
sx?: BoxProps["sx"];
|
|
1081
|
+
sx?: BoxProps$1["sx"];
|
|
1009
1082
|
}
|
|
1010
1083
|
/**
|
|
1011
1084
|
* Circular container for an icon or initials.
|
|
@@ -1410,6 +1483,69 @@ declare namespace NexusHeatmap {
|
|
|
1410
1483
|
var displayName: string;
|
|
1411
1484
|
}
|
|
1412
1485
|
|
|
1486
|
+
interface ProcessStep {
|
|
1487
|
+
/** Icon component (e.g. an `@mui/icons-material` icon), rendered in a tinted tile. */
|
|
1488
|
+
icon: typeof SvgIcon;
|
|
1489
|
+
title: string;
|
|
1490
|
+
description: string;
|
|
1491
|
+
}
|
|
1492
|
+
interface ProcessStepsProps {
|
|
1493
|
+
steps: ProcessStep[];
|
|
1494
|
+
/** Accessible name for the list, e.g. "How citizen developers build on Nexus". */
|
|
1495
|
+
"aria-label": string;
|
|
1496
|
+
/** Heading level of each step title, so the list fits the host page outline. Defaults to 3. */
|
|
1497
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
1498
|
+
sx?: SxProps<Theme>;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* A static, numbered sequence of process steps joined by arrow connectors.
|
|
1502
|
+
* Not a progress control: there is no active or completed state and nothing is
|
|
1503
|
+
* interactive. For stepping through a flow use `Stepper`.
|
|
1504
|
+
*
|
|
1505
|
+
* Steps sit in one row with right arrows from `md` up and stack with down
|
|
1506
|
+
* arrows below it. Connectors live inside each `<li>` (so the `<ol>` holds only
|
|
1507
|
+
* list items), are `aria-hidden`, and are absolutely positioned in the grid gap.
|
|
1508
|
+
*
|
|
1509
|
+
* ```tsx
|
|
1510
|
+
* <ProcessSteps
|
|
1511
|
+
* aria-label="How it works"
|
|
1512
|
+
* steps={[{ icon: SearchIcon, title: "Discover", description: "Find a use case." }]}
|
|
1513
|
+
* />
|
|
1514
|
+
* ```
|
|
1515
|
+
*/
|
|
1516
|
+
declare const ProcessSteps: {
|
|
1517
|
+
({ steps, "aria-label": ariaLabel, headingLevel, sx, }: ProcessStepsProps): react.JSX.Element;
|
|
1518
|
+
displayName: string;
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1521
|
+
interface NexusOrbitProps {
|
|
1522
|
+
/** Node labels in order, spaced evenly around the orbit. Designed for 3 to 6; anything past 6 is ignored. */
|
|
1523
|
+
labels: string[];
|
|
1524
|
+
/** Replaces the centre graphic. Defaults to `NexusNodeIcon` (lg, brand). */
|
|
1525
|
+
core?: ReactNode;
|
|
1526
|
+
/**
|
|
1527
|
+
* Makes the orbit meaningful to assistive tech: the root becomes an image named
|
|
1528
|
+
* `<aria-label>: <label>, <label>, ...`. Omit it and the orbit is decorative (`aria-hidden`).
|
|
1529
|
+
*/
|
|
1530
|
+
"aria-label"?: string;
|
|
1531
|
+
sx?: SxProps<Theme>;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* A square, container-scaled orbit graphic: a soft halo and three concentric rings around a
|
|
1535
|
+
* rotated rounded-square core, with labelled nodes that circle slowly while their text stays upright.
|
|
1536
|
+
*
|
|
1537
|
+
* Under `prefers-reduced-motion: reduce` nothing animates; nodes sit at their angles.
|
|
1538
|
+
* There is no pause control, so keep it to a single decorative hero use.
|
|
1539
|
+
*
|
|
1540
|
+
* ```tsx
|
|
1541
|
+
* <NexusOrbit labels={["DATA", "AGENTS", "TRUST", "VALUE"]} />
|
|
1542
|
+
* ```
|
|
1543
|
+
*/
|
|
1544
|
+
declare const NexusOrbit: {
|
|
1545
|
+
({ labels, core, "aria-label": ariaLabel, sx, }: NexusOrbitProps): react.JSX.Element;
|
|
1546
|
+
displayName: string;
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1413
1549
|
declare const getFaviconUrls: (versioned?: boolean) => {
|
|
1414
1550
|
svg: string;
|
|
1415
1551
|
ico: string;
|
|
@@ -1521,6 +1657,36 @@ type ThemeModeProviderProps = PropsWithChildren<{
|
|
|
1521
1657
|
}>;
|
|
1522
1658
|
declare const ThemeModeProvider: ({ children, defaultMode, mode: legacyInitialMode, storageKey, onModeChange, }: ThemeModeProviderProps) => react.JSX.Element;
|
|
1523
1659
|
|
|
1660
|
+
type ChatTablePart = {
|
|
1661
|
+
type: "markdown";
|
|
1662
|
+
content: string;
|
|
1663
|
+
key: string;
|
|
1664
|
+
} | {
|
|
1665
|
+
type: "html-table";
|
|
1666
|
+
html: string;
|
|
1667
|
+
key: string;
|
|
1668
|
+
} | {
|
|
1669
|
+
type: "fallback";
|
|
1670
|
+
rawSource: string;
|
|
1671
|
+
reason: string;
|
|
1672
|
+
key: string;
|
|
1673
|
+
};
|
|
1674
|
+
interface TableSanitizerConfig {
|
|
1675
|
+
ALLOWED_TAGS: string[];
|
|
1676
|
+
ALLOWED_ATTR: string[];
|
|
1677
|
+
ALLOW_ARIA_ATTR: false;
|
|
1678
|
+
ALLOW_DATA_ATTR: false;
|
|
1679
|
+
}
|
|
1680
|
+
interface TableHtmlPurifier {
|
|
1681
|
+
sanitize: (html: string, config: TableSanitizerConfig) => string;
|
|
1682
|
+
}
|
|
1683
|
+
declare const sanitizeRawHtmlTable: (html: string, { purifier }?: {
|
|
1684
|
+
purifier?: TableHtmlPurifier;
|
|
1685
|
+
}) => string;
|
|
1686
|
+
declare const splitRawHtmlTables: (text: string) => ChatTablePart[];
|
|
1687
|
+
|
|
1688
|
+
declare const safeMarkdownUrl: (href: unknown) => string | null;
|
|
1689
|
+
|
|
1524
1690
|
declare function formatSurnameFirstname(name: string | null): string | null;
|
|
1525
1691
|
|
|
1526
1692
|
declare const getFiscalPeriod: (date: Date) => {
|
|
@@ -1556,5 +1722,5 @@ declare const getGradientBorderStyles: (theme: Theme, options?: GradientBorderOp
|
|
|
1556
1722
|
declare const leftPipe: SxProps<Theme>;
|
|
1557
1723
|
declare const expandableText: (isExpanded: boolean) => SxProps<Theme>;
|
|
1558
1724
|
|
|
1559
|
-
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatDialog, AgentChatWidget, AgentChatWindow, AgentChatWindowHeader, AiButton, AiButtonTile, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2,
|
|
1560
|
-
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, ActivitySummary, AgentChatDialogProps, AgentChatWidgetProps, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiButtonTileProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, BreadcrumbItem, BreadcrumbsProps, ButtonTileProps, CardProps, CardTrend, ChartAsyncProps, ChatAvatarProps, ChatHistoryAgent, ChatHistoryAgentItemProps, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, CodeBlock, CopyableTableContainerProps, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, DeltaChipProps, DeltaChipTone, EmptyStateProps, FABButtonProps, FileArtifact, FormDialogProps, GhostButtonProps, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LatencyMetrics, LinkProps, LoadingSpinnerNexusProps, MarkdownContentProps, MessageBubbleProps, MessageFeedbackBarProps, MessageListProps, MetricCardProps, MetricStatProps, MetricValueSize, ModeTokens, NexusBarChartProps, NexusHeatmapAxisItem, NexusHeatmapCell, NexusHeatmapProps, NexusHeatmapStatus, NexusLineChartProps, NexusNodeIconProps, NexusNodeIconSize, NexusNodeIconTone, NexusPieChartProps, NexusScatterChartProps, NexusiFrameProps, NotificationBellProps, NotificationListItemProps, PaperAsyncProps, ParsedActivity, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectProps, SelectableListItem, SelectableListProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, SliderMarkOption, SliderProps, SourceCitationsProps, StatusBadgeProps, StatusBadgeVariant, StreamingBubbleProps, SuggestedPromptsProps, ThemeMode, ThemeModeContextValue, ThemeModeProviderProps, TooltipProps, TraceEvent, TypingIndicatorProps };
|
|
1725
|
+
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatDialog, AgentChatWidget, AgentChatWindow, AgentChatWindowHeader, AiButton, AiButtonTile, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2, Breadcrumbs, ButtonBase, ButtonTile, Caption, Card, ChatAvatar, ChatContentFallback, ChatDatapoints, ChatHistory, ChatHistoryAgentItem, ChatHistoryButtonBase, ChatHistoryHeader, ChatInput, ChatResponseMarkdown, ChatWindowBody, Checkbox, CheckboxGroup, Chip, CircularProgress, Code, Collapse, Container, CopyableTableContainer, DateRangeFilter, DateRangePicker, DeltaChip, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, EmptyState, FABButton, FaviconLinks, FormControlLabel, FormDialog, FormGroup, GhostButton, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MarkdownContent, MessageBubble, MessageFeedbackBar, MessageList, MetricCard, MetricStat, MetricValue, MuiAppThemeProvider, NEXUS_THEME_STORAGE_KEY, NexusBarChart, NexusDataGrid, NexusHeatmap, NexusHome, NexusLineChart, NexusLogo, NexusNodeIcon, NexusOrbit, NexusPieChart, NexusScatterChart, NexusiFrame, NotificationBell, NotificationListItem, Paper, PaperAsync, PrimaryButton, PrimaryButtonLink, ProcessSteps, RagChip, RagDot, SageLogoSvg, SearchInput, SecondaryButton, SecondaryButtonLink, SegmentedControl, Select, SelectableList, SideBlade, SideBladeNavList, SideBladeNavListItem, Skeleton, SkillChip, SkipLink, Slider, SourceCitations, Span, Stack, StatusBadge, StatusChip, StreamingBubble, SuggestedPrompts, Switch, Tab, Table, TableBody, TableCell, TableHead, TableRow, Tabs, TextField, ThemeModeContext, ThemeModeProvider, ThemeToggle, Tooltip, TypingIndicator, chatHistoryMatchesQuery, chatWindowMarkdownComponents, colours, columnsForItemCount, createSageTheme, deltaColorForPolarity, expandableText, filterChatHistoryConversations, fontSageHeadline, fontSageText, fontSageUI, formatDatapointDelta, formatDatapointValue, formatDate, formatSurnameFirstname, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, latestTraceLabel, leftPipe, ragColorForDelta, safeChatMarkdownComponents, safeMarkdownUrl, sanitizeRawHtmlTable, splitRawHtmlTables, useThemeMode, useTokens };
|
|
1726
|
+
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, ActivitySummary, AgentChatDialogProps, AgentChatWidgetProps, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiButtonTileProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, BreadcrumbItem, BreadcrumbsProps, ButtonTileProps, CardProps, CardTrend, ChartAsyncProps, ChatAvatarProps, ChatContentFallbackProps, ChatDatapointDelta, ChatDatapointItem, ChatDatapointPolarity, ChatDatapointValueFormat, ChatDatapointsData, ChatDatapointsProps, ChatHistoryAgent, ChatHistoryAgentItemProps, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, ChatResponseMarkdownProps, ChatTableCell, ChatTableData, ChatTablePart, CodeBlock, CopyableTableContainerProps, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, DeltaChipProps, DeltaChipTone, EmptyStateProps, FABButtonProps, FileArtifact, FormDialogProps, GhostButtonProps, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LatencyMetrics, LinkProps, LoadingSpinnerNexusProps, MarkdownContentProps, MessageBubbleProps, MessageFeedbackBarProps, MessageListProps, MetricCardProps, MetricStatProps, MetricValueSize, ModeTokens, NexusBarChartProps, NexusHeatmapAxisItem, NexusHeatmapCell, NexusHeatmapProps, NexusHeatmapStatus, NexusLineChartProps, NexusNodeIconProps, NexusNodeIconSize, NexusNodeIconTone, NexusOrbitProps, NexusPieChartProps, NexusScatterChartProps, NexusiFrameProps, NotificationBellProps, NotificationListItemProps, PaperAsyncProps, ParsedActivity, PrimaryButtonLinkProps, PrimaryButtonProps, ProcessStep, ProcessStepsProps, SecondaryButtonLinkProps, SecondaryButtonProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectProps, SelectableListItem, SelectableListProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, SliderMarkOption, SliderProps, SourceCitationsProps, StatusBadgeProps, StatusBadgeVariant, StreamingBubbleProps, SuggestedPromptsProps, ThemeMode, ThemeModeContextValue, ThemeModeProviderProps, TooltipProps, TraceEvent, TypingIndicatorProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/_Primitives/Alert.mjs";export{AgentChatWidget}from"./components/AgentChat/AgentChatWidget.mjs";export{AgentChatDialog}from"./components/AgentChat/AgentChatDialog.mjs";export{FABButton}from"./components/AgentChat/FABButton.mjs";export{AgentChatWindow}from"./components/AgentChat/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/AgentChat/AgentChatWindowHeader.mjs";export{ChatInput}from"./components/AgentChat/ChatInput.mjs";export{ChatHistory}from"./components/AgentChat/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/AgentChat/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/AgentChat/ChatHistoryButtonBase.mjs";export{ChatHistoryAgentItem}from"./components/AgentChat/ChatHistoryAgentItem.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/AgentChat/ChatHistorySearch.mjs";export{CopyableTableContainer}from"./components/AgentChat/ChatComponents/CopyableTableContainer.mjs";export{default as ChatAvatar}from"./components/AgentChat/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent,chatWindowMarkdownComponents}from"./components/AgentChat/ChatComponents/MarkdownContent.mjs";export{default as MessageBubble}from"./components/AgentChat/ChatComponents/MessageBubble.mjs";export{default as MessageFeedbackBar}from"./components/AgentChat/ChatComponents/MessageFeedbackBar.mjs";export{default as StreamingBubble}from"./components/AgentChat/ChatComponents/StreamingBubble.mjs";export{default as TypingIndicator}from"./components/AgentChat/ChatComponents/TypingIndicator.mjs";export{default as SuggestedPrompts}from"./components/AgentChat/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/AgentChat/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/AgentChat/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/AgentChat/ChatComponents/SourceCitations.mjs";export{latestTraceLabel}from"./components/AgentChat/ChatComponents/latestTraceLabel.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/_Primitives/Container.mjs";export{Grid}from"./components/_Primitives/Grid.mjs";export{Link}from"./components/_Primitives/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{SegmentedControl}from"./components/SegmentedControl.mjs";export{Breadcrumbs}from"./components/Breadcrumbs.mjs";export{Switch}from"./components/_Primitives/Switch.mjs";export{Slider}from"./components/Slider.mjs";export{NotificationBell}from"./components/NotificationBell.mjs";export{NotificationListItem}from"./components/NotificationListItem.mjs";export{ActionBarTitle,Body1,Body2,Caption,ChatWindowBody,H1,H2,H3,H4,MetricValue,Span}from"./components/Typography.mjs";export{MetricStat}from"./components/MetricStat.mjs";export{MetricCard}from"./components/MetricCard.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/Buttons/AiButton.mjs";export{AiChip}from"./components/AiChip.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"
|
|
1
|
+
export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/_Primitives/Alert.mjs";export{AgentChatWidget}from"./components/AgentChat/AgentChatWidget.mjs";export{AgentChatDialog}from"./components/AgentChat/AgentChatDialog.mjs";export{FABButton}from"./components/AgentChat/FABButton.mjs";export{AgentChatWindow}from"./components/AgentChat/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/AgentChat/AgentChatWindowHeader.mjs";export{ChatInput}from"./components/AgentChat/ChatInput.mjs";export{ChatHistory}from"./components/AgentChat/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/AgentChat/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/AgentChat/ChatHistoryButtonBase.mjs";export{ChatHistoryAgentItem}from"./components/AgentChat/ChatHistoryAgentItem.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/AgentChat/ChatHistorySearch.mjs";export{CopyableTableContainer}from"./components/AgentChat/ChatComponents/CopyableTableContainer.mjs";export{default as ChatAvatar}from"./components/AgentChat/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent,chatWindowMarkdownComponents}from"./components/AgentChat/ChatComponents/MarkdownContent.mjs";export{default as ChatResponseMarkdown,safeChatMarkdownComponents}from"./components/AgentChat/ChatComponents/ChatResponseMarkdown.mjs";export{default as ChatDatapoints}from"./components/AgentChat/ChatComponents/ChatDatapoints.mjs";export{default as ChatContentFallback}from"./components/AgentChat/ChatComponents/ChatContentFallback.mjs";export{default as MessageBubble}from"./components/AgentChat/ChatComponents/MessageBubble.mjs";export{default as MessageFeedbackBar}from"./components/AgentChat/ChatComponents/MessageFeedbackBar.mjs";export{default as StreamingBubble}from"./components/AgentChat/ChatComponents/StreamingBubble.mjs";export{default as TypingIndicator}from"./components/AgentChat/ChatComponents/TypingIndicator.mjs";export{default as SuggestedPrompts}from"./components/AgentChat/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/AgentChat/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/AgentChat/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/AgentChat/ChatComponents/SourceCitations.mjs";export{latestTraceLabel}from"./components/AgentChat/ChatComponents/latestTraceLabel.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/_Primitives/Container.mjs";export{Grid}from"./components/_Primitives/Grid.mjs";export{Link}from"./components/_Primitives/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{SegmentedControl}from"./components/SegmentedControl.mjs";export{Breadcrumbs}from"./components/Breadcrumbs.mjs";export{Switch}from"./components/_Primitives/Switch.mjs";export{Slider}from"./components/Slider.mjs";export{NotificationBell}from"./components/NotificationBell.mjs";export{NotificationListItem}from"./components/NotificationListItem.mjs";export{ActionBarTitle,Body1,Body2,Caption,ChatWindowBody,H1,H2,H3,H4,MetricValue,Span}from"./components/Typography.mjs";export{MetricStat}from"./components/MetricStat.mjs";export{MetricCard}from"./components/MetricCard.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/Buttons/AiButton.mjs";export{AiChip}from"./components/AiChip.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{default as Box}from"@mui/material/Box";export{CircularProgress}from"./components/_Primitives/CircularProgress.mjs";export{Collapse}from"./components/_Primitives/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/Buttons/ButtonBase.mjs";export{AiButtonTile,ButtonTile}from"./components/ButtonTile.mjs";export{GhostButton}from"./components/Buttons/GhostButton.mjs";export{SelectableList}from"./components/Buttons/SelectableList.mjs";export{Card}from"./components/Card.mjs";export{Checkbox}from"./components/Forms/Checkbox.mjs";export{FormControlLabel}from"./components/Forms/FormControlLabel.mjs";export{FormGroup}from"./components/Forms/FormGroup.mjs";export{CheckboxGroup}from"./components/Forms/CheckboxGroup.mjs";export{FormDialog}from"./components/Forms/FormDialog.mjs";export{Chip}from"./components/_Primitives/Chip.mjs";export{DeltaChip}from"./components/DeltaChip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/_Primitives/Dialog.mjs";export{Divider}from"./components/_Primitives/Divider.mjs";export{Table,TableBody,TableCell,TableHead,TableRow}from"./components/_Primitives/Table.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{PaperAsync}from"./components/PaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/Buttons/IconButton.mjs";export{Avatar}from"./components/Avatar.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/Logo/LogoOptions/index.mjs";export{NexusHome}from"./components/Logo/NexusHome.mjs";export{default as NexusLogo}from"./components/Logo/NexusLogo.mjs";export{NexusNodeIcon}from"./components/Logo/NexusNodeIcon.mjs";export{SageLogoSvg}from"./components/Logo/LogoOptions/SageLogo.mjs";export{Paper}from"./components/_Primitives/Paper.mjs";export{PrimaryButton}from"./components/Buttons/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/Buttons/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/Buttons/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{ragColorForDelta}from"./components/ragColorForDelta.mjs";export{SecondaryButtonLink}from"./components/Buttons/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade/SideBlade.mjs";export{SideBladeNavList}from"./components/SideBlade/SideBladeNavList.mjs";export{SideBladeNavListItem}from"./components/SideBlade/SideBladeNavListItem.mjs";export{Skeleton}from"./components/_Primitives/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/_Primitives/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/_Primitives/Tab.mjs";export{Tabs}from"./components/_Primitives/Tabs.mjs";export{TextField}from"./components/_Primitives/TextField.mjs";export{ThemeToggle}from"./components/Theme/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{NexusiFrame}from"./components/NexusiFrame.mjs";export{NexusLineChart}from"./components/Charts/NexusLineChart.mjs";export{NexusBarChart}from"./components/Charts/NexusBarChart.mjs";export{NexusPieChart}from"./components/Charts/NexusPieChart.mjs";export{NexusScatterChart}from"./components/Charts/NexusScatterChart.mjs";export{NexusHeatmap}from"./components/Charts/NexusHeatmap.mjs";export{ProcessSteps}from"./components/ProcessSteps.mjs";export{NexusOrbit}from"./components/NexusOrbit.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{default as nexusLogoIco}from"./assets/images/favicon.ico.mjs";export{getFaviconUrls}from"./assets/images/urls.mjs";export{FaviconLinks}from"./components/FaviconLinks.mjs";export{createSageTheme}from"./components/Theme/sageTheme.mjs";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./components/Theme/tokens.mjs";export{useTokens}from"./components/Theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./components/Theme/MuiAppThemeProvider.mjs";export{NEXUS_THEME_STORAGE_KEY,ThemeModeContext,ThemeModeProvider,useThemeMode}from"./components/Theme/ThemeContext.mjs";export{AlertTitle,MenuItem,alpha,useMediaQuery,useTheme}from"@mui/material";export{sanitizeRawHtmlTable,splitRawHtmlTables}from"./utils/chatTableHtml.mjs";export{safeMarkdownUrl}from"./utils/safeMarkdownUrl.mjs";export{columnsForItemCount,deltaColorForPolarity,formatDatapointDelta,formatDatapointValue}from"./utils/chatDatapoints.mjs";export{formatSurnameFirstname}from"./utils/nameFormats.mjs";export{formatDate,getFiscalPeriod}from"./utils/dateFormats.mjs";export{expandableText,getGradientBorderStyles,leftPipe}from"./components/Theme/sxHelpers.mjs";export{ChartsReferenceLine}from"./node_modules/@mui/x-charts/ChartsReferenceLine/ChartsReferenceLine.mjs";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
|
|
2
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return l}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(t,n):void 0}}(t,n)||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.")}()}const n=Object.entries,o=Object.setPrototypeOf,r=Object.isFrozen,i=Object.getPrototypeOf,a=Object.getOwnPropertyDescriptor;let l=Object.freeze,c=Object.seal,s=Object.create,u="undefined"!=typeof Reflect&&Reflect,f=u.apply,p=u.construct;l||(l=function(e){return e}),c||(c=function(e){return e}),f||(f=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return e.apply(t,o)}),p||(p=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const m=L(Array.prototype.forEach),d=L(Array.prototype.lastIndexOf),h=L(Array.prototype.pop),g=L(Array.prototype.push),y=L(Array.prototype.splice),b=Array.isArray,T=L(String.prototype.toLowerCase),S=L(String.prototype.toString),E=L(String.prototype.match),A=L(String.prototype.replace),N=L(String.prototype.indexOf),_=L(String.prototype.trim),w=L(Number.prototype.toString),O=L(Boolean.prototype.toString),v="undefined"==typeof BigInt?null:L(BigInt.prototype.toString),D="undefined"==typeof Symbol?null:L(Symbol.prototype.toString),R=L(Object.prototype.hasOwnProperty),C=L(Object.prototype.toString),I=L(RegExp.prototype.test),k=(x=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(x,t)});var x;function L(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return f(e,t,o)}}function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;if(o&&o(e,null),!b(t))return e;let i=t.length;for(;i--;){let o=t[i];if("string"==typeof o){const e=n(o);e!==o&&(r(t)||(t[i]=e),o=e)}e[o]=!0}return e}function z(e){for(let t=0;t<e.length;t++){R(e,t)||(e[t]=null)}return e}function P(e){const o=s(null);for(const i of n(e)){var r=t(i,2);const n=r[0],a=r[1];R(e,n)&&(b(a)?o[n]=z(a):a&&"object"==typeof a&&a.constructor===Object?o[n]=P(a):o[n]=a)}return o}function U(e,t){for(;null!==e;){const n=a(e,t);if(n){if(n.get)return L(n.get);if("function"==typeof n.value)return L(n.value)}e=i(e)}return function(){return null}}const F=l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),H=l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j=l(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B=l(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),G=l(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),W=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y=l(["#text"]),q=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),X=l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=l(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=c(/{{[\w\W]*|^[\w\W]*}}/g),Z=c(/<%[\w\W]*|^[\w\W]*%>/g),J=c(/\${[\w\W]*/g),Q=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),ee=c(/^aria-[\-\w]+$/),te=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ne=c(/^(?:\w+script|data):/i),oe=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=c(/^html$/i),ie=c(/^[a-z][.\w]*(-[.\w]+)+$/i),ae=c(/<[/\w!]/g),le=c(/<[/\w]/g),ce=c(/<\/no(script|embed|frames)/i),se=c(/\/>/i),ue=1,fe=3,pe=7,me=8,de=9,he=11,ge=function(){return"undefined"==typeof window?null:window},ye=function(e,t,n,o){return R(e,t)&&b(e[t])?M(o.base?P(o.base):{},e[t],o.transform):n};var be=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge();const o=t=>e(t);if(o.version="3.4.13",o.removed=[],!t||!t.document||t.document.nodeType!==de||!t.Element)return o.isSupported=!1,o;let r=t.document;const i=r,a=i.currentScript;t.DocumentFragment;const u=t.HTMLTemplateElement,f=t.Node,p=t.Element,x=t.NodeFilter,L=t.NamedNodeMap;void 0===L&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const z=t.DOMParser,be=t.trustedTypes,Te=p.prototype,Se=U(Te,"cloneNode"),Ee=U(Te,"remove"),Ae=U(Te,"nextSibling"),Ne=U(Te,"childNodes"),_e=U(Te,"parentNode"),we=U(Te,"shadowRoot"),Oe=U(Te,"attributes"),ve=f&&f.prototype?U(f.prototype,"nodeType"):null,De=f&&f.prototype?U(f.prototype,"nodeName"):null,Re=f&&f.prototype?U(f.prototype,"ownerDocument"):null;if("function"==typeof u){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Ce,Ie,ke="",xe=!1,Le=0;const Me=function(){if(Le>0)throw k('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ze=function(e){Me(),Le++;try{return Ce.createHTML(e)}finally{Le--}},Pe=function(){return xe||(Ie=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(be,a),xe=!0),Ie},Ue=r,Fe=Ue.implementation,He=Ue.createNodeIterator,je=Ue.createDocumentFragment,Be=Ue.getElementsByTagName,Ge=i.importNode;let We={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof n&&"function"==typeof _e&&Fe&&void 0!==Fe.createHTMLDocument;const Ye=V,qe=Z,Xe=J,$e=Q,Ke=ee,Ve=ne,Ze=oe,Je=ie;let Qe=te,et=null;const tt=M({},[...F,...H,...j,...G,...Y]);let nt=null;const ot=M({},[...q,...X,...$,...K]);let rt=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),it=null,at=null;const lt=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ct=!0,st=!0,ut=!1,ft=!0,pt=!1,mt=!0,dt=!1,ht=!1,gt=null,yt=null,bt=!1,Tt=!1,St=!1,Et=!1,At=!0,Nt=!1;const _t="user-content-";let wt=!0,Ot=!1,vt={},Dt=null;const Rt=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ct=null;const It=M({},["audio","video","img","source","image","track"]);let kt=null;const xt=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lt="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml";let Pt=zt,Ut=!1,Ft=null;const Ht=M({},[Lt,Mt,zt],S),jt=l(["mi","mo","mn","ms","mtext"]);let Bt=M({},jt);const Gt=l(["annotation-xml"]);let Wt=M({},Gt);const Yt=M({},["title","style","font","a","script"]);let qt=null;const Xt=["application/xhtml+xml","text/html"];let $t=null,Kt=null;const Vt=r.createElement("form"),Zt=function(e){return e instanceof RegExp||e instanceof Function},Jt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kt&&Kt===e)return;e&&"object"==typeof e||(e={}),e=P(e),qt=-1===Xt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,$t="application/xhtml+xml"===qt?S:T,et=ye(e,"ALLOWED_TAGS",tt,{transform:$t}),nt=ye(e,"ALLOWED_ATTR",ot,{transform:$t}),Ft=ye(e,"ALLOWED_NAMESPACES",Ht,{transform:S}),kt=ye(e,"ADD_URI_SAFE_ATTR",xt,{transform:$t,base:xt}),Ct=ye(e,"ADD_DATA_URI_TAGS",It,{transform:$t,base:It}),Dt=ye(e,"FORBID_CONTENTS",Rt,{transform:$t}),it=ye(e,"FORBID_TAGS",P({}),{transform:$t}),at=ye(e,"FORBID_ATTR",P({}),{transform:$t}),vt=!!R(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?P(e.USE_PROFILES):e.USE_PROFILES),ct=!1!==e.ALLOW_ARIA_ATTR,st=!1!==e.ALLOW_DATA_ATTR,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,pt=e.SAFE_FOR_TEMPLATES||!1,mt=!1!==e.SAFE_FOR_XML,dt=e.WHOLE_DOCUMENT||!1,Tt=e.RETURN_DOM||!1,St=e.RETURN_DOM_FRAGMENT||!1,Et=e.RETURN_TRUSTED_TYPE||!1,bt=e.FORCE_BODY||!1,At=!1!==e.SANITIZE_DOM,Nt=e.SANITIZE_NAMED_PROPS||!1,wt=!1!==e.KEEP_CONTENT,Ot=e.IN_PLACE||!1,Qe=function(e){try{return I(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:te,Pt="string"==typeof e.NAMESPACE?e.NAMESPACE:zt,Bt=R(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?P(e.MATHML_TEXT_INTEGRATION_POINTS):M({},jt),Wt=R(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?P(e.HTML_INTEGRATION_POINTS):M({},Gt);const t=R(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?P(e.CUSTOM_ELEMENT_HANDLING):s(null);if(rt=s(null),R(t,"tagNameCheck")&&Zt(t.tagNameCheck)&&(rt.tagNameCheck=t.tagNameCheck),R(t,"attributeNameCheck")&&Zt(t.attributeNameCheck)&&(rt.attributeNameCheck=t.attributeNameCheck),R(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(rt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),c(rt),pt&&(st=!1),St&&(Tt=!0),vt&&(et=M({},Y),nt=s(null),!0===vt.html&&(M(et,F),M(nt,q)),!0===vt.svg&&(M(et,H),M(nt,X),M(nt,K)),!0===vt.svgFilters&&(M(et,j),M(nt,X),M(nt,K)),!0===vt.mathMl&&(M(et,G),M(nt,$),M(nt,K))),lt.tagCheck=null,lt.attributeCheck=null,R(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?lt.tagCheck=e.ADD_TAGS:b(e.ADD_TAGS)&&(et===tt&&(et=P(et)),M(et,e.ADD_TAGS,$t))),R(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?lt.attributeCheck=e.ADD_ATTR:b(e.ADD_ATTR)&&(nt===ot&&(nt=P(nt)),M(nt,e.ADD_ATTR,$t))),R(e,"ADD_URI_SAFE_ATTR")&&b(e.ADD_URI_SAFE_ATTR)&&M(kt,e.ADD_URI_SAFE_ATTR,$t),R(e,"FORBID_CONTENTS")&&b(e.FORBID_CONTENTS)&&(Dt===Rt&&(Dt=P(Dt)),M(Dt,e.FORBID_CONTENTS,$t)),R(e,"ADD_FORBID_CONTENTS")&&b(e.ADD_FORBID_CONTENTS)&&(Dt===Rt&&(Dt=P(Dt)),M(Dt,e.ADD_FORBID_CONTENTS,$t)),wt&&(et["#text"]=!0),dt&&M(et,["html","head","body"]),et.table&&(M(et,["tbody"]),delete it.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=Ce;Ce=e.TRUSTED_TYPES_POLICY;try{ke=ze("")}catch(e){throw Ce=t,e}}else null===e.TRUSTED_TYPES_POLICY?(Ce=void 0,ke=""):(void 0===Ce&&(Ce=Pe()),Ce&&"string"==typeof ke&&(ke=ze("")));l&&l(e),Kt=e},Qt=M({},[...H,...j,...B]),en=M({},[...G,...W]),tn=function(e){let t=_e(e);t&&t.tagName||(t={namespaceURI:Pt,tagName:"template"});const n=T(e.tagName),o=T(t.tagName);return!!Ft[e.namespaceURI]&&(e.namespaceURI===Mt?function(e,t,n){return t.namespaceURI===zt?"svg"===e:t.namespaceURI===Lt?"svg"===e&&("annotation-xml"===n||Bt[n]):Boolean(Qt[e])}(n,t,o):e.namespaceURI===Lt?function(e,t,n){return t.namespaceURI===zt?"math"===e:t.namespaceURI===Mt?"math"===e&&Wt[n]:Boolean(en[e])}(n,t,o):e.namespaceURI===zt?function(e,t,n){return!(t.namespaceURI===Mt&&!Wt[n])&&!(t.namespaceURI===Lt&&!Bt[n])&&!en[e]&&(Yt[e]||!Qt[e])}(n,t,o):!("application/xhtml+xml"!==qt||!Ft[e.namespaceURI]))},nn=function(e){g(o.removed,{element:e});try{_e(e).removeChild(e)}catch(t){if(Ee(e),!_e(e))throw k("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},on=function(e){ln(e);const t=Ne(e);if(t){const e=[];m(t,t=>{g(e,t)}),m(e,e=>{try{Ee(e)}catch(e){}})}const n=Oe(e);if(n)for(let t=n.length-1;t>=0;--t){const o=n[t],r=o&&o.name;if("string"==typeof r)try{e.removeAttribute(r)}catch(e){}}},rn=function(e,t){try{g(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Tt||St)try{nn(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},an=function(e){const t=Oe(e);if(t)for(let n=t.length-1;n>=0;--n){const o=t[n],r=o&&o.name;if("string"==typeof r&&!nt[$t(r)])try{e.removeAttribute(r)}catch(e){}}},ln=function(e){const t=[e];for(;t.length>0;){const e=t.pop();(ve?ve(e):e.nodeType)===ue&&an(e);const n=Ne(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},cn=function(e){let t=null,n=null;if(bt)e="<remove></remove>"+e;else{const t=E(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===qt&&Pt===zt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Ce?ze(e):e;if(Pt===zt)try{t=(new z).parseFromString(o,qt)}catch(e){}if(!t||!t.documentElement){t=Fe.createDocument(Pt,"template",null);try{t.documentElement.innerHTML=Ut?ke:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Pt===zt?Be.call(t,dt?"html":"body")[0]:dt?t.documentElement:i},sn=function(e){const t=Re?Re(e):e.ownerDocument;return He.call(t||e,e,x.SHOW_ELEMENT|x.SHOW_COMMENT|x.SHOW_TEXT|x.SHOW_PROCESSING_INSTRUCTION|x.SHOW_CDATA_SECTION,null)},un=function(e){return e=A(e,Ye," "),e=A(e,qe," "),e=A(e,Xe," ")},fn=function(e){var t;e.normalize();const n=Re?Re(e):e.ownerDocument,o=He.call(n||e,e,x.SHOW_TEXT|x.SHOW_COMMENT|x.SHOW_CDATA_SECTION|x.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=un(r.data),r=o.nextNode();const i=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");i&&m(i,e=>{mn(e.content)&&fn(e.content)})},pn=function(e){const t=De?De(e):null;return"string"==typeof t&&("form"===$t(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==Oe(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==ve(e)||e.childNodes!==Ne(e)))},mn=function(e){if(!ve||"object"!=typeof e||null===e)return!1;try{return ve(e)===he}catch(e){return!1}},dn=function(e){if(!ve||"object"!=typeof e||null===e)return!1;try{return"number"==typeof ve(e)}catch(e){return!1}};function hn(e,t,n){0!==e.length&&m(e,e=>{e.call(o,t,n,Kt)})}const gn=function(e,t,n,o){return 0===e.length?t:t===n||t===o?P(t):t},yn=function(e,t){if(hn(We.beforeSanitizeElements,e,null),e!==t&&null===_e(e))return Ot&&ln(e),!0;if(pn(e))return nn(e),!0;const n=$t(De?De(e):e.nodeName);if(et=gn(We.uponSanitizeElement,et,tt,gt),hn(We.uponSanitizeElement,e,{tagName:n,allowedTags:et}),e!==t&&null===_e(e))return Ot&&ln(e),!0;if(function(e,t){return!!(mt&&e.hasChildNodes()&&!dn(e.firstElementChild)&&I(ae,e.textContent)&&I(ae,e.innerHTML))||!(!mt||e.namespaceURI!==zt||"style"!==t||!dn(e.firstElementChild))||e.nodeType===pe||!(!mt||e.nodeType!==me||!I(le,e.data))}(e,n))return nn(e),!0;if(it[n]||!(lt.tagCheck instanceof Function&<.tagCheck(n))&&!et[n]){const o=function(e,t,n){if(!it[t]&&Sn(t)){if(rt.tagNameCheck instanceof RegExp&&I(rt.tagNameCheck,t))return!1;if(rt.tagNameCheck instanceof Function&&rt.tagNameCheck(t))return!1}if(wt&&!Dt[t]){const t=_e(e),o=Ne(e);if(o&&t)for(let r=o.length-1;r>=0;--r){const i=e===n?Se(o[r],!0):o[r];t.insertBefore(i,Ae(e))}}return nn(e),!0}(e,n,t);return!1===o&&hn(We.afterSanitizeElements,e,null),o}if((ve?ve(e):e.nodeType)===ue&&!tn(e))return nn(e),!0;if(("noscript"===n||"noembed"===n||"noframes"===n)&&I(ce,e.innerHTML))return nn(e),!0;if(pt&&e.nodeType===fe){const t=un(e.textContent);e.textContent!==t&&(g(o.removed,{element:e.cloneNode()}),e.textContent=t)}return hn(We.afterSanitizeElements,e,null),!1},bn=function(e,t,n){if(at[t])return!1;if(mt&&"patchsrc"===t)return!1;if(mt&&"for"===t&&"label"!==e&&"output"!==e)return!1;if(At&&("id"===t||"name"===t)&&(n in r||n in Vt))return!1;const o=nt[t]||lt.attributeCheck instanceof Function&<.attributeCheck(t,e);if(st&&I($e,t));else if(ct&&I(Ke,t));else if(o)if(kt[t]);else if(I(Qe,A(n,Ze,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==N(n,"data:")||!Ct[e]){if(ut&&!I(Ve,A(n,Ze,"")));else if(n)return!1}else;else if(!(Sn(e)&&(rt.tagNameCheck instanceof RegExp&&I(rt.tagNameCheck,e)||rt.tagNameCheck instanceof Function&&rt.tagNameCheck(e))&&(rt.attributeNameCheck instanceof RegExp&&I(rt.attributeNameCheck,t)||rt.attributeNameCheck instanceof Function&&rt.attributeNameCheck(t,e))||"is"===t&&rt.allowCustomizedBuiltInElements&&(rt.tagNameCheck instanceof RegExp&&I(rt.tagNameCheck,n)||rt.tagNameCheck instanceof Function&&rt.tagNameCheck(n))))return!1;return!0},Tn=M({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sn=function(e){return!Tn[T(e)]&&I(Je,e)},En=function(e,t,n,o){if(Ce&&"object"==typeof be&&"function"==typeof be.getAttributeType&&!n)switch(be.getAttributeType(e,t)){case"TrustedHTML":return ze(o);case"TrustedScriptURL":return function(e){Me(),Le++;try{return Ce.createScriptURL(e)}finally{Le--}}(o)}return o},An=function(e,t,n,r){try{n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),pn(e)?nn(e):h(o.removed)}catch(n){rn(t,e)}},Nn=function(e){hn(We.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||pn(e))return;nt=gn(We.uponSanitizeAttribute,nt,ot,yt);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:nt,forceKeepAttr:void 0};let o=t.length;const r=$t(e.nodeName);for(;o--;){const i=t[o],a=i.name,l=i.namespaceURI,c=i.value,s=$t(a),u=c;let f="value"===a?u:_(u);n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,hn(We.uponSanitizeAttribute,e,n),f=n.attrValue,!Nt||"id"!==s&&"name"!==s||0===N(f,_t)||(rn(a,e),f=_t+f),mt&&I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)?rn(a,e):"attributename"===s&&E(f,"href")?rn(a,e):n.forceKeepAttr||(n.keepAttr&&(ft||!I(se,f))?(pt&&(f=un(f)),bn(r,s,f)?(f=En(r,s,l,f),f!==u&&An(e,a,l,f)):rn(a,e)):rn(a,e))}hn(We.afterSanitizeAttributes,e,null)},_n=function(e){let t=null;const n=sn(e);for(hn(We.beforeSanitizeShadowDOM,e,null);t=n.nextNode();){hn(We.uponSanitizeShadowNode,t,null),yn(t,e),Nn(t),mn(t.content)&&_n(t.content);if((ve?ve(t):t.nodeType)===ue){const e=we(t);mn(e)&&(wn(e),_n(e))}}hn(We.afterSanitizeShadowDOM,e,null)},wn=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){_n(e.shadow);continue}const n=e.node,o=(ve?ve(n):n.nodeType)===ue,r=Ne(n);if(r)for(let e=r.length-1;e>=0;--e)t.push({node:r[e],shadow:null});if(o){const e=De?De(n):null;if("string"==typeof e&&"template"===$t(e)){const e=n.content;mn(e)&&t.push({node:e,shadow:null})}}if(o){const e=we(n);mn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,a=null,l=null;if(Ut=!e,Ut&&(e="\x3c!--\x3e"),"string"!=typeof e&&!dn(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return w(e);case"boolean":return O(e);case"bigint":return v?v(e):"0";case"symbol":return D?D(e):"Symbol()";case"undefined":default:return C(e);case"function":case"object":{if(null===e)return C(e);const t=e,n=U(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:C(e)}return C(e)}}}(e)))throw k("dirty is not a string, aborting");if(!o.isSupported)return e;ht?(et=gt,nt=yt):Jt(t),(We.uponSanitizeElement.length>0||We.uponSanitizeAttribute.length>0)&&(et=P(et)),We.uponSanitizeAttribute.length>0&&(nt=P(nt)),o.removed=[];const c=Ot&&"string"!=typeof e&&dn(e);if(c){!function(e){if(!mt)return;const t=[e];for(;t.length>0;){const e=t.pop(),n=ve?ve(e):e.nodeType;if(n===pe||n===me&&I(le,e.data)){try{Ee(e)}catch(e){}continue}if(n===ue){const t=e,n=$t(De?De(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&"label"!==n&&"output"!==n&&t.removeAttribute("for")}catch(e){}}const o=Ne(e);if(o)for(let e=o.length-1;e>=0;--e)t.push(o[e])}}(e);const t=De?De(e):e.nodeName;if("string"==typeof t){const n=$t(t);if(!et[n]||it[n])throw on(e),k("root node is forbidden and cannot be sanitized in-place")}if(pn(e))throw on(e),k("root node is clobbered and cannot be sanitized in-place");try{wn(e)}catch(t){throw on(e),t}}else if(dn(e))n=cn("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===ue&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r),wn(r);else{if(!Tt&&!pt&&!dt&&-1===e.indexOf("<"))return Ce&&Et?ze(e):e;if(n=cn(e),!n)return Tt?null:Et?ke:""}n&&bt&&nn(n.firstChild);const s=c?e:n;try{const e=sn(s);for(;a=e.nextNode();)yn(a,s),Nn(a),mn(a.content)&&_n(a.content)}catch(t){throw c&&(on(e),m(o.removed,e=>{e.element&&ln(e.element)})),t}if(c)return m(o.removed,e=>{e.element&&ln(e.element)}),pt&&fn(e),e;if(Tt){if(pt&&fn(n),St)for(l=je.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(nt.shadowroot||nt.shadowrootmode)&&(l=Ge.call(i,l,!0)),l}let u=dt?n.outerHTML:n.innerHTML;return dt&&et["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&I(re,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),pt&&(u=un(u)),Ce&&Et?ze(u):u},o.setConfig=function(){Jt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ht=!0,gt=et,yt=nt},o.clearConfig=function(){Kt=null,ht=!1,gt=null,yt=null,Ce=Ie,ke=""},o.isValidAttribute=function(e,t,n){Kt||Jt({});const o=$t(e),r=$t(t);return bn(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&R(We,e)&&g(We[e],t)},o.removeHook=function(e,t){if(R(We,e)){if(void 0!==t){const n=d(We[e],t);return-1===n?void 0:y(We[e],n,1)[0]}return h(We[e])}},o.removeHooks=function(e){R(We,e)&&(We[e]=[])},o.removeAllHooks=function(){We={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();export{be as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=r=>"number"==typeof r&&Number.isFinite(r),i={k:"K",m:"M",bn:"B",tn:"T"},t=/(\d)(bn|tn|k|m)$/i,e=r=>r.replace(t,(r,t,e)=>`${t}${i[e.toLowerCase()]}`),n=(i,t=4)=>{if(!r(i)||i<=0)return 0;const e=Math.ceil(i/t);return Math.ceil(i/e)},a=(i,t,{currency:n,unit:a}={})=>{if(!r(i))return String(i);switch("currency"!==t||n?t:"number"){case"currency":return e(new Intl.NumberFormat("en-GB",{style:"currency",currency:n??void 0,currencyDisplay:"narrowSymbol",notation:"compact",minimumFractionDigits:0,maximumFractionDigits:1}).format(i));case"percentage":return`${new Intl.NumberFormat("en-GB",{minimumFractionDigits:0,maximumFractionDigits:1}).format(i)}%`;case"duration":{const r=new Intl.NumberFormat("en-GB",{minimumFractionDigits:0,maximumFractionDigits:1}).format(i);return a?`${r} ${a}`:r}default:return e(new Intl.NumberFormat("en-GB",{notation:"compact",minimumFractionDigits:0,maximumFractionDigits:1}).format(i))}},m=(i,t={})=>{if(!i||!r(i.value))return null;const{valueFormat:n}=i,{currency:a,unit:m}=t;let c;switch("currency"!==n||a?n:"number"){case"currency":c=e(new Intl.NumberFormat("en-GB",{style:"currency",currency:a??void 0,currencyDisplay:"narrowSymbol",notation:"compact",minimumFractionDigits:0,maximumFractionDigits:1,signDisplay:"exceptZero"}).format(i.value));break;case"percentage":c=`${new Intl.NumberFormat("en-GB",{minimumFractionDigits:0,maximumFractionDigits:1,signDisplay:"exceptZero"}).format(i.value)}%`;break;case"duration":{const r=new Intl.NumberFormat("en-GB",{minimumFractionDigits:0,maximumFractionDigits:1,signDisplay:"exceptZero"}).format(i.value);c=m?`${r} ${m}`:r;break}default:c=e(new Intl.NumberFormat("en-GB",{notation:"compact",minimumFractionDigits:0,maximumFractionDigits:1,signDisplay:"exceptZero"}).format(i.value))}return i.comparison?`${c} ${i.comparison}`:c},c=(i,t)=>{if(i&&r(i.value)&&0!==i.value&&t&&"neutral"!==t)return"higher_is_better"===t?i.value>0?"success.main":"error.main":"lower_is_better"===t?i.value>0?"error.main":"success.main":void 0};export{n as columnsForItemCount,c as deltaColorForPolarity,m as formatDatapointDelta,a as formatDatapointValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../node_modules/dompurify/dist/purify.es.mjs";const t=["table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","br","strong","em","code"],n=["abbr","colspan","headers","rowspan","scope","span"],i=(i,{purifier:l}={})=>{const o=l||e,s="function"==typeof o.sanitize?o:"undefined"!=typeof window?e(window):null;if(!s)throw new Error("DOM sanitisation is unavailable");const a=s.sanitize(i,{ALLOWED_TAGS:t,ALLOWED_ATTR:n,ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1});if(!/<table\b/i.test(a))throw new Error("The raw HTML table could not be sanitised safely");return a},l=(e,t,n)=>({type:"markdown",content:e,key:`markdown-${t}-${n}`}),o=e=>{if("string"!=typeof e||!/<table\b/i.test(e))return[l("string"==typeof e?e:"",0,e?.length||0)];const t=[],n=/<table\b[^>]*>/gi,i=/<\/table\s*>/gi;let o,s=0;for(;null!==(o=n.exec(e));){if(o.index<s)continue;o.index>s&&t.push(l(e.slice(s,o.index),s,o.index)),i.lastIndex=n.lastIndex;const a=i.exec(e);if(!a){t.push({type:"fallback",rawSource:e.slice(o.index),reason:"The raw HTML table is incomplete.",key:`table-fallback-${o.index}-${e.length}`}),s=e.length;break}const r=a.index+a[0].length;t.push({type:"html-table",html:e.slice(o.index,r),key:`html-table-${o.index}-${r}`}),s=r,n.lastIndex=r}return s<e.length&&t.push(l(e.slice(s),s,e.length)),t.length>0?t:[l(e,0,e.length)]};export{i as sanitizeRawHtmlTable,o as splitRawHtmlTables};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=t=>{if("string"!=typeof t)return null;const r=t.trim();if(/^#[A-Za-z][A-Za-z0-9_.:-]*$/.test(r))return r;try{const t=new URL(r);return"http:"===t.protocol||"https:"===t.protocol?t.href:null}catch{return null}};export{t as safeMarkdownUrl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "it-data-nexus-ui-library",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.13",
|
|
4
4
|
"description": "Nexus core components",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "emsmart-sage",
|
|
@@ -30,11 +30,13 @@
|
|
|
30
30
|
"lint": "eslint \"src/**/*.{ts,tsx,js,jsx}\"",
|
|
31
31
|
"prepublishOnly": "npm run lint && npm run build",
|
|
32
32
|
"storybook": "storybook dev -p 6006",
|
|
33
|
+
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
33
34
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@mui/x-charts": "^9.4.0",
|
|
37
|
-
"@radix-ui/react-popover": "^1.1.15"
|
|
38
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
39
|
+
"dompurify": "3.4.13"
|
|
38
40
|
},
|
|
39
41
|
"peerDependencies": {
|
|
40
42
|
"@emotion/react": "^11.14.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Box as i}from"@mui/material";const m=({children:m,...o})=>r(i,{...o,children:m});export{m as Box};
|