@rustic-ai/ui-components 0.0.20 → 0.0.21
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/calendar/index.js +1 -1
- package/dist/components/codeSnippet/index.js +1 -1
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -2
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/elementRenderer/index.js +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
- package/dist/components/input/multimodal/uploader/index.js +1 -1
- package/dist/components/input/textInput/index.js +1 -1
- package/dist/components/map/index.js +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/media/audio/index.js +1 -1
- package/dist/components/media/video/index.js +1 -1
- package/dist/components/messageCanvas/actions/action.d.ts +3 -3
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts +2 -2
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/index.js +1 -1
- package/dist/components/messageCanvas/actions/index.js +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts +2 -2
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
- package/dist/components/messageCanvas/messageCanvas.d.ts +5 -5
- package/dist/components/messageCanvas/messageCanvas.d.ts.map +1 -1
- package/dist/components/messageSpace/index.js +1 -1
- package/dist/components/messageSpace/messageSpace.d.ts +6 -3
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/{promptBuilder/mockWebSocket.d.ts → mockWebSocket.d.ts} +1 -1
- package/dist/components/mockWebSocket.d.ts.map +1 -0
- package/dist/components/multipart/index.js +1 -1
- package/dist/components/multipart/multipart.d.ts +2 -2
- package/dist/components/multipart/multipart.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.d.ts +2 -1
- package/dist/components/participantsContainer/index.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.js +1 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts +14 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
- package/dist/components/pdfViewer/index.js +1 -1
- package/dist/components/promptBuilder/index.js +1 -1
- package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -1
- package/dist/components/question/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/timestamp/index.d.ts.map +1 -1
- package/dist/components/timestamp/index.js +1 -0
- package/dist/components/types.d.ts +4 -20
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/visualization/perspectiveViz/index.js +1 -1
- package/dist/components/weather/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/promptBuilder/mockWebSocket.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e,t,r={986:(e,t,r)=>{r.d(t,{default:()=>c});var n=r(997),i=r(934),a=r.n(i),o=r(229),s=r.n(o);r(689),r(265);const c=function(e){return(0,n.jsx)(s(),{title:e.label,children:(0,n.jsx)(a(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},265:(e,t,r)=>{var n,i;r.d(t,{A:()=>i,_:()=>n}),function(e){e.Owner="owner",e.Member="member"}(n||(n={})),function(e){e.Human="human",e.Agent="agent"}(i||(i={}))},470:(e,t,r)=>{r.d(t,{rusticDarkTheme:()=>J,rusticLightTheme:()=>R});var n=r(442);const i=require("@mui/utils");var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)},o="#000000",s="#FFFFFF",c="#FF6928",l="#E54500",u="#FF692899",d="#FF69284D",p=(0,n.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"none"}},palette:{common:{black:o,white:s},error:{main:"#F82A43",dark:"#C82639",light:"#FF9BA7"},warning:{main:"#FFB800",dark:"#DC8400",light:"#FFDB7D"},info:{main:"#0094FF",dark:"#005A9B",light:"#8CCFFF"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,n.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0)}),m={fontSize:"12px",lineHeight:1.5,letterSpacing:"0.5px",padding:"0 12px",minHeight:"26px"},f={fontSize:"14px",lineHeight:1.43,letterSpacing:"0.25px",padding:"0 16px",minHeight:"40px"},h={fontSize:"16px",lineHeight:1.75,letterSpacing:"0.15px",padding:"0 24px",minHeight:"64px"},x="#E1D9D5",v="#0000001F",g="#2D2825",b="#2D282599",y="#1E0C04",j="#9C9795",S="#00000061",w="#2D282514",k="#2D28251F",F="#2D28254D",C="#2D282580",E={fontWeight:700},N={"&.Mui-disabled":{background:s,color:j,border:"1px solid ".concat(S)}},T=a(a(a({},E),{background:g,color:s,"&:hover":{background:b},"&:focus":{border:"4px solid ".concat(b)}}),N),O=a(a(a({},E),{background:s,color:y,border:"1px solid ".concat(b),"&:focus":{border:"4px solid ".concat(b)}}),N),P={fontWeight:400,"& .MuiChip-label":{padding:0,display:"flex",alignItems:"center",gap:"8px"}},D=a({background:F,color:y,border:"1px solid ".concat(C),"&:hover":{border:"1px solid ".concat(C),background:w},"&:focus":{border:"3px solid ".concat(C),background:k},"&.Mui-disabled":{background:S,opacity:100,border:"none",color:s,"& .MuiChip-icon":{color:s}},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:y}},P),M=a({background:s,color:y,border:"1px solid ".concat(u),"&:focus":{border:"4px solid ".concat(u)},"&.Mui-disabled":{border:"1px solid ".concat(u),background:s,color:u,opacity:100},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:y}},P),R=(0,n.createTheme)((0,i.deepmerge)(p,{palette:{mode:"light",divider:x,text:{primary:y,secondary:"#4E443F",disabled:j},primary:{main:g,dark:o,light:b,contrastText:s,focus:k,focusVisible:F,hover:w,selected:"#2D282529",border:C},secondary:{main:c,light:u,dark:l,contrastText:s,focus:"#FF69281F",focusVisible:d,hover:"#FF692814",selected:"#FF692829",border:"#FF692880"},background:{default:"#F7F6F5",paper:s},action:{active:"#0000008F",hover:"#00000014",selected:"#00000029",disabledBackground:v,focus:v,disabled:S},success:{main:"#007F51",dark:"#014F33",light:"#00D788",contrastText:s},error:{contrastText:s},warning:{contrastText:s},info:{contrastText:s}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:g,color:s}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:v},root:{borderBottom:"1px solid ".concat(x),padding:"8px 16px"}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{"& .MuiTableSortLabel-icon":{color:y}}}}},MuiPopover:{styleOverrides:{paper:{border:"1px solid ".concat(x),backgroundImage:"none"}}},MuiButton:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"8px"},m),T)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"12px"},f),T)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"16px"},h),T)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"8px","&:hover":{border:"1px solid ".concat(o),background:s}},m),O)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"12px","&:hover":{border:"2px solid ".concat(o),background:s}},f),O)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"16px","&:hover":{border:"2px solid ".concat(o),background:s}},h),O)}]},MuiChip:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"24px"},m),D)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"32px"},f),D)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"48px"},h),D)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"24px","&:hover":{border:"1px solid ".concat(c),background:s}},m),M)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"32px","&:hover":{border:"2px solid ".concat(c),background:s}},f),M)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"48px","&:hover":{border:"2px solid ".concat(c),background:s}},h),M)}]}}})),q="#FFFFFF61",z="#FFFFFF1F",I="#E1D9D5",L="#202020",B="#FFFCFB",_="#FFFCFB99",A="#000000DE",H="#FFFFFF61",W="#FF692880",V="#FFFCFB1F",U="#FFFCFB4D",G="#FFFCFB14",K="#FFFFFF4D",Q={"&.Mui-disabled":{background:K,color:q,border:"1px solid ".concat(H)}},Y=a(a(a({},E),{background:B,color:o,"&:hover":{background:_},"&:focus":{border:"4px solid ".concat(_)}}),Q),X=a(a(a({},E),{background:L,color:s,border:"1px solid ".concat(_),"&:focus":{border:"4px solid ".concat(_)}}),Q),$=a(a({background:U,color:s,border:"1px solid ".concat(W),"&:hover":{border:"1px solid ".concat(W),background:G},"&:focus":{border:"4px solid ".concat(_),background:V},"&.Mui-disabled":{background:H,opacity:100,border:"none",color:A,"& .MuiChip-icon":{color:A}}},P),{"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:s}}),Z=a({background:L,color:s,border:"1px solid ".concat(u),"&:focus":{border:"4px solid ".concat(u)},"&.Mui-disabled":{background:L,color:u,border:"1px solid ".concat(u),opacity:100},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:s}},P),J=(0,n.createTheme)((0,i.deepmerge)(p,{palette:{mode:"dark",divider:I,primary:{main:B,dark:s,light:_,contrastText:A,hover:G,selected:"#FFFCFB29",focus:V,focusVisible:U,border:W},secondary:{main:c,light:u,dark:l,contrastText:A,hover:"#FF692814",selected:"#FF692829",focus:"#FF69281F",focusVisible:d,border:"#FF692880"},background:{default:"#2C2C2C",paper:L},text:{primary:s,secondary:"#FFFFFFB2",disabled:q},action:{active:K,hover:K,selected:"#FFFFFF29",focus:z,disabledBackground:z,disabled:H},success:{main:"#00B775",dark:"#01784D",light:"#00E390",contrastText:A},error:{contrastText:A},warning:{contrastText:A},info:{contrastText:A}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:B,color:o}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{"& .MuiTableSortLabel-icon":{color:s}}}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:z},root:{borderBottom:"1px solid ".concat(I),padding:"8px 16px"}}},MuiPopover:{styleOverrides:{paper:{border:"1px solid ".concat(I),backgroundImage:"none"}}},MuiChip:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"24px"},m),$)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"32px"},f),$)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"48px"},h),$)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"24px","&:hover":{background:L,border:"1px solid ".concat(c)}},m),Z)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"32px","&:hover":{background:L,border:"2px solid ".concat(c)}},f),Z)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"48px","&:hover":{background:L,border:"2px solid ".concat(c)}},h),Z)}]},MuiButton:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"8px"},m),Y)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"12px"},f),Y)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"16px"},h),Y)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"8px","&:hover":{background:L,border:"1px solid ".concat(s)}},m),X)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"12px","&:hover":{background:L,border:"2px solid ".concat(s)}},f),X)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"16px","&:hover":{background:L,border:"2px solid ".concat(s)}},h),X)}]}}}));R=(0,n.responsiveFontSizes)(R),J=(0,n.responsiveFontSizes)(J)},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},442:e=>{e.exports=require("@mui/material/styles")},13:e=>{e.exports=require("emoji-picker-element")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);i.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>r[e]));return o.default=()=>r,i.d(a,o),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{i.r(a),i.d(a,{Action:()=>Pt.default,CodeSnippet:()=>w,CopyText:()=>Dt,ElementRenderer:()=>F,FCCalendar:()=>h,Image:()=>B,MarkedMarkdown:()=>et,MarkedStreamingMarkdown:()=>tt,MermaidViz:()=>Qr,MessageCanvas:()=>It,MessageSpace:()=>Ht,MultimodalInput:()=>De,Multipart:()=>Vt,OpenLayersMap:()=>Ye,PDFViewer:()=>we,ParticipantRole:()=>tr._,ParticipantType:()=>tr.A,ParticipantsContainer:()=>nr,PerspectiveViz:()=>Jr,PopoverMenu:()=>Ot,PromptBuilder:()=>pr,Question:()=>mr,RechartsTimeSeries:()=>Vr,Sound:()=>bt,StreamingText:()=>Rr,Table:()=>Mr,Text:()=>Wt,TextInput:()=>qe,TextToSpeech:()=>Mt,Timestamp:()=>zt,Uploader:()=>Te,VegaLiteViz:()=>on,Video:()=>St,Weather:()=>sn,YoutubeVideo:()=>zr,rusticDarkTheme:()=>cn.rusticDarkTheme,rusticLightTheme:()=>cn.rusticLightTheme});var e=i(997);const t=require("@fullcalendar/daygrid");var r=i.n(t);const n=require("@fullcalendar/react");var o=i.n(n);const s=require("@mui/material/Box");var c=i.n(s),l=i(442);const u=require("@mui/material/useMediaQuery");var d=i.n(u),p=i(689),m=i.n(p);function f(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function h(t){var n=(0,l.useTheme)(),i=d()(n.breakpoints.up("md"));return(0,e.jsx)(c(),{className:"rustic-fc-calendar",children:(0,e.jsx)(o(),{plugins:[r()],initialView:i?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(f),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const x=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),y=require("@mui/material/Typography");var j=i.n(y);const S=require("@mui/system");function w(t){var r=(0,p.useRef)(null),n=(0,p.useRef)(),i=new g.Compartment,a=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,x.syntaxHighlighting)(x.defaultHighlightStyle,{fallback:!0}),i.of([])],o=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,p.useEffect)((function(){if(r.current&&!n.current){var e=r.current,s=g.EditorState.create({doc:t.code,extensions:a});n.current=new b.EditorView({state:s,parent:e}),o&&n.current&&o.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(S.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(j(),{variant:"body2","aria-label":"language type",children:t.language})})})}var k=function(){return k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},k.apply(this,arguments)};const F=function(t){var r=t.supportedElements[t.message.format];return(0,e.jsx)(e.Fragment,{children:r?m().createElement(r,k(k({sender:t.sender,ws:t.ws,messageId:t.message.id,conversationId:t.message.conversationId},t.message.data),t.message.threadMessagesData&&{updatedData:t.message.threadMessagesData})):(0,e.jsxs)(j(),{variant:"body2",children:["Unsupported element format: ",t.message.format]})})},C=require("@mui/material/CircularProgress");var E=i.n(C);const N=require("pluralize");var T=i.n(N),O=function(){return O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},O.apply(this,arguments)};function P(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function R(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function q(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",a="".concat(t>0?r.toString().padStart(2,"0"):r),o=n.toString().padStart(2,"0");return"".concat(i).concat(a,":").concat(o)}function z(e,t){var r={};return e&&(r={width:e}),t&&(r=O(O({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var I=function(e){var t=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:t,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[t]}},L=function(){return L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function B(t){var r=(0,p.useState)(!0),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return o.length>0?(0,e.jsx)(j(),{variant:"body2",children:o}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(E(),{}),(0,e.jsx)("img",L({},z(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){s("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(j(),{variant:"body2",children:t.description})})]})}B.defaultProps={alt:"An image is displayed"};const _=require("uuid");var A=i(934),H=i.n(A);const W=require("@mui/material/InputAdornment");var V=i.n(W);const U=require("@mui/material/MenuItem");var G=i.n(U);const K=require("@mui/material/MenuList");var Q=i.n(K);const Y=require("@mui/material/Popover");var X=i.n(Y);const $=require("@mui/material/TextField");var Z=i.n($),J=i(229),ee=i.n(J),te=i(13);function re(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}const ne=function(t){var r=(0,l.useTheme)(),n=(0,p.useRef)(null),a=(0,p.useRef)(null),o=(0,p.useState)(!1),s=o[0],c=o[1],u={"--indicator-color":r.palette.divider,"--background":r.palette.background.paper,"--input-border-color":r.palette.divider,"--outline-color":r.palette.secondary.main};function d(){c(!1)}function m(e){e.detail.unicode&&t.onEmojiClick(e.detail.unicode),d()}return(0,p.useEffect)((function(){a.current||"undefined"==typeof window||Promise.resolve().then(i.t.bind(i,13,23)).then((function(e){var t=new(0,e.Picker),n="dark"===r.palette.mode?"dark":"light";t.classList.add(n),Object.keys(u).forEach((function(e){t.style.setProperty(e,u[e])})),a.current=t})).catch((function(e){console.error("Failed to load emoji picker",e)}))}),[]),(0,p.useEffect)((function(){return a.current&&a.current.addEventListener("emoji-click",m),function(){var e;null===(e=a.current)||void 0===e||e.removeEventListener("emoji-click",m)}}),[s,t.onEmojiClick]),(0,e.jsxs)("div",{children:[(0,e.jsx)(ee(),{title:"Emoji",children:(0,e.jsx)(H(),{size:"small",ref:n,onClick:function(){c((function(e){return!e}))},sx:{color:t.buttonColor},children:(0,e.jsx)(re,{name:"Mood"})})}),a.current&&(0,e.jsx)(X(),{open:s,anchorEl:n.current,onClose:d,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,e.jsx)("div",{className:"rustic-emoji-picker",ref:function(e){e&&a.current&&!e.contains(a.current)&&e.appendChild(a.current)}})})]})};var ie={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."};function ae(e){if("unicode"in e&&"annotation"in e)return"".concat(e.unicode," ").concat(e.annotation)}var oe=(0,p.forwardRef)((function(t,r){var n=(0,p.useState)(""),i=n[0],a=n[1],o=(0,p.useState)(!1),s=o[0],l=o[1],u=(0,p.useState)(!1),d=u[0],m=u[1],f=(0,p.useState)(!1),h=f[0],x=f[1],v=(0,p.useState)(""),g=v[0],b=v[1],y=(0,p.useState)([]),S=y[0],w=y[1],k=(0,p.useState)(!1),F=k[0],C=k[1],N=(0,p.useRef)(null),T=!i.trim().length&&!t.isSendEnabled,O="".concat(s?"Stop":"Start"," speech to text"),P=d?"primary.main":"primary.light",D=s?"error.main":P,M=s?"stop_circle":"speech_to_text";function R(e,t){if(void 0===t&&(t=!1),N.current){var r=N.current,n=r.selectionStart,o=r.selectionEnd;if("number"==typeof n&&"number"==typeof o){var s,c=i||"",l=c.substring(0,n),u=c.substring(o);s=t?l.replace(/:(\w+)$/,e)+u:l+e+u,a(s);var d=t?l.replace(/:(\w+)$/,e).length:n+e.length;setTimeout((function(){var e,t;null===(e=N.current)||void 0===e||e.focus(),null===(t=N.current)||void 0===t||t.setSelectionRange(d,d)}),0)}}C(!1)}var q=new te.Database,z=h?(0,e.jsx)(E(),{size:24}):(0,e.jsx)(ee(),{title:O,children:(0,e.jsx)(H(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,s?(e.stop(),x(!0),l(!1)):(e.start(),b(""),l(!0)),e.onstart=function(){l(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?a(i+" "+r):a(r),null===(t=N.current)||void 0===t||t.focus(),l(!1)},e.onerror=function(e){var t=ie[e.error];b(t),l(!1)},e.onend=function(){x(!1),l(!1)}},size:"small",sx:{color:D},children:(0,e.jsx)(re,{name:M})})});function I(){var e=(new Date).toISOString(),r={id:(0,_.v4)(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),a(""),b("")}return(0,e.jsxs)(c(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(c(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(c(),{className:"rustic-error-container",children:(0,e.jsx)(j(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(c(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:d?"secondary.main":"action.disabled"},children:[S.length>0&&(0,e.jsx)(X(),{open:F,anchorEl:N.current,onClose:function(){return C(!1)},disableAutoFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:(0,e.jsx)(Q(),{children:S.map((function(t,r){return"unicode"in t&&(0,e.jsx)(G(),{onClick:function(){return R(t.unicode,!0)},children:ae(t)},r)}))})}),(0,e.jsx)(Z(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!T&&I())},onChange:function(e){b("");var r=e.target.value;a(r);var n,i=r.match(/:(\w{2,}):/g),o=r.match(/:(\w{2,})/g);if(i){var s=i[0].replace(/:/g,"");q.getEmojiByShortcode(s).then((function(e){if(e&&"unicode"in e){var t=r.replace(i[0],e.unicode);a(t)}else a(r)})).catch((function(){a(r)})),C(!1)}else o?(n=o[0].replace(":",""),q.getEmojiBySearchQuery(n).then((function(e){e.length?(w(e.slice(0,t.maximumEmojiSearchResults)),C(!0)):(w([]),C(!1))})).catch((function(){w([]),C(!1)}))):C(!1)},onFocus:function(){return m(!0)},onBlur:function(){return m(!1)},inputRef:N,color:"secondary",size:"small",InputProps:{endAdornment:(0,e.jsxs)(V(),{position:"end",children:[(0,e.jsx)(ne,{onEmojiClick:R,buttonColor:P}),t.enableSpeechToText&&z]})},InputLabelProps:{className:d?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(c(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(ee(),{title:"Send",children:(0,e.jsx)("span",{className:"rustic-send-button",children:(0,e.jsx)(H(),{"aria-label":"send message",onClick:I,disabled:T,color:"primary",children:(0,e.jsx)(re,{name:"send"})})})})]})]})}));oe.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1,maximumEmojiSearchResults:5};const se=oe,ce=require("@mui/material/LinearProgress");var le=i.n(ce);const ue=require("axios");var de=i.n(ue);const pe=require("react-dom"),me=require("@mui/material/Card");var fe=i.n(me);const he=require("@mui/material/Modal");var xe=i.n(he);const ve=require("@mui/system/Stack");var ge=i.n(ve);const be=require("@mui/system/useTheme");var ye=i.n(be);const je=require("pdfjs-dist"),Se=function(t){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[t.action].label.replaceAll(" ","-").toLowerCase(),r[t.action]);return(0,e.jsx)(ee(),{title:n.label,children:(0,e.jsx)("span",{children:(0,e.jsx)(H(),{onClick:t.onClick,className:t.className,disabled:t.isDisabled,children:(0,e.jsx)(re,{name:n.symbol})})})})},we=function(t){var r,n=(0,p.useRef)(null),i=(0,p.useState)(1),a=i[0],o=i[1],s=(0,p.useState)(1),l=s[0],u=s[1],m=(0,p.useState)(1),f=m[0],h=m[1],x=(0,p.useState)(!1),v=x[0],g=x[1],b=(0,p.useState)(),y=b[0],S=b[1],w=ye()(),k=d()(w.breakpoints.down("sm")),F=d()(w.breakpoints.between("sm","md"));if(r=t.url,!/\/[^/]+\.pdf$/.test(r))return(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(j(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var C=(0,p.useState)((function(){return k?.5:F?1:1.5})),E=C[0],N=C[1];return(0,p.useEffect)((function(){je.GlobalWorkerOptions.workerSrc||(je.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(je.version,"/pdf.worker.mjs")),je.getDocument({url:"".concat(t.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(a).then((function(e){var t=e.getViewport({scale:E}),r=n.current;if(r){var i=r.getContext("2d");if(i){var a=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*a,r.height=t.height*a;var o={canvasContext:i,viewport:t,transform:[a,0,0,a,0,0]};y&&y.cancel();var s=e.render(o);S(s),s.promise.then((function(){S(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){g(!0)}))}),[t.url,a,E]),v?(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(j(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,e.jsxs)(c(),{className:"rustic-pdf-viewer-header",children:[(0,e.jsx)(Se,{action:"zoomOut",onClick:function(){N((function(e){return Math.max(e-.2,.2)}))}}),(0,e.jsx)(Se,{action:"zoomIn",onClick:function(){N((function(e){return e+.2}))}})]}),(0,e.jsx)(c(),{className:"rustic-pdf-viewer-body",children:(0,e.jsx)(c(),{className:"rustic-pdf-viewer-body-inner",children:(0,e.jsx)("canvas",{ref:n})})}),(0,e.jsxs)(ge(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,e.jsx)(Se,{action:"previousPage",onClick:function(){a>1&&(o(a-1),h(a-1))},isDisabled:1===a}),(0,e.jsx)(j(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,e.jsx)(Z(),{type:"number",value:f,onChange:function(e){var t=parseInt(e.target.value);h(t),!isNaN(t)&&t>=1&&t<=l&&o(t)},size:"small",className:"rustic-pdf-page-input"}),(0,e.jsxs)(j(),{variant:"body1",className:"rustic-page-indicator",children:["of ",l]}),(0,e.jsx)(Se,{action:"nextPage",onClick:function(){a<l&&(o(a+1),h(a+1))},isDisabled:a===l})]})]})};var ke={pdf:we};function Fe(t){var r=(0,l.useTheme)(),n=(0,p.useState)(!1),i=n[0],a=n[1];function o(){a(!1)}var s,c,u=t.file.url&&(s=t.file.url.split("."))[s.length-1].toLowerCase(),d=u&&t.supportedViewers?t.supportedViewers[u]:null,m=!!d;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(fe(),{className:"rustic-file-preview".concat(m?" rustic-cursor-pointer":""),variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){a(!0)},children:[(0,e.jsx)(j(),{variant:"subtitle2",children:(c=t.file.name,15,c.length<=15?c:c.substring(0,12)+"...")}),(0,e.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:t.children})]}),m&&(0,e.jsx)(xe(),{open:i,onClose:o,className:"rustic-file-preview-modal",children:(0,e.jsxs)("div",{className:"rustic-modal-content",children:[(0,e.jsx)(ee(),{title:"Close",children:(0,e.jsx)(H(),{onClick:o,className:"rustic-close-button",children:(0,e.jsx)(re,{name:"close"})})}),t.file.url&&(0,e.jsx)(d,{url:t.file.url})]})})]})}Fe.defaultProps={supportedViewers:ke};var Ce=function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ce.apply(this,arguments)},Ee=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function Ne(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const Te=function(t){var r=(0,p.useState)([]),n=r[0],i=r[1],a=(0,p.useState)([]),o=a[0],s=a[1],l=(0,p.useRef)({}),u=(0,_.v4)();(0,p.useEffect)((function(){i([]),s([]),l.current={}}),[t.messageId]);var d=(0,e.jsx)(c(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(Fe,{file:{name:r.name},children:(0,e.jsxs)(c(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(le(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(ee(),{title:"Delete",children:(0,e.jsx)(H(),{color:"primary",onClick:function(){return function(e,r){var n,a;s([]);var o=e.name;if(l.current=Ce(Ce({},l.current),((n={})[o]=l.current[o]--,n)),t.onFileUpdate("remove",o),100===e.loadingProgress){var c="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);de().delete(c).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",o),s((function(e){return Ee(Ee([],e,!0),["Failed to delete ".concat(o,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),l.current=Ce(Ce({},l.current),((a={})[o]=l.current[o]++,a))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),m=(0,e.jsx)(c(),{children:o.map((function(t,r){return(0,e.jsx)(j(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function f(e,t){return t?(0,pe.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(ee(),{title:"Upload",children:(0,e.jsx)(H(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){s([]);var r=e.target.files&&Array.from(e.target.files),a=n.length+(r?r.length:0);t.maxFileCount&&a>t.maxFileCount&&s((function(e){return Ee(Ee([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var o=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,a,t.maxFileCount);o&&o.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,s((function(e){return Ee(Ee([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&Ne(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,a=function(e){var t,r,n=e.name,i=l.current[n];if(i){var a=i+1,o=n.lastIndexOf("."),s=n.substring(0,o),c=n.substring(o);n="".concat(s,"(").concat(i,")").concat(c),l.current=Ce(Ce({},l.current),((t={})[e.name]=a,t))}else l.current=Ce(Ce({},l.current),((r={})[e.name]=1,r));return n}(e),o=new File([e],a,{type:e.type});r.append("file",o);var c=(0,_.v4)(),u={name:a,loadingProgress:0,abortController:n,id:c};i((function(e){return Ee(Ee([],e,!0),[u],!1)})),t.onFileUpdate("add",a);var d="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);de().post(d,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?Ce(Ce({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=Ee([],e,!0);return i[n]=Ce(Ce({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,o;t.onFileUpdate("remove",a),l.current=Ce(Ce({},l.current),((n={})[a]=l.current[e.name]--,n)),function(e,t,r){s((function(t){return Ee(Ee([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(o=r.response)||void 0===o?void 0:o.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),o.length>0&&f(m,t.errorMessagesContainer),n.length>0&&f(d,t.filePreviewsContainer)]})};var Oe=function(){return Oe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oe.apply(this,arguments)},Pe=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function De(t){var r=(0,p.useState)([]),n=r[0],i=r[1],a=(0,p.useState)((0,_.v4)()),o=a[0],s=a[1],l=(0,p.useState)(),u=l[0],d=l[1],m=(0,p.useState)(),f=m[0],h=m[1],x=(0,p.useRef)(null),v=n.length>0;return(0,p.useEffect)((function(){x.current&&(h(x.current.querySelector(".rustic-error-container")),d(x.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(c(),{className:"rustic-multimodal-input",children:(0,e.jsx)(se,Oe({},t,{send:function(e){v&&(e.id=o,e.format="multipart",e.data.files=n),t.ws.send(e),s((0,_.v4)()),i([])},isSendEnabled:v,ref:x,children:(0,e.jsx)(c(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(Te,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return Pe(Pe([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:o,filePreviewsContainer:u,errorMessagesContainer:f})})}))})}De.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var Me=function(){return Me=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Me.apply(this,arguments)},Re=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function qe(t){var r=t.ws,n=Re(t,["ws"]);return(0,e.jsx)(se,Me({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const ze=require("@mui/material/Alert");var Ie=i.n(ze);const Le=require("ol/layer/Tile.js");var Be=i.n(Le);const _e=require("ol/Map.js");var Ae=i.n(_e);const He=require("ol/Overlay.js");var We=i.n(He);const Ve=require("ol/proj.js"),Ue=require("ol/source/OSM.js");var Ge=i.n(Ue);const Ke=require("ol/View.js");var Qe=i.n(Ke);function Ye(t){var r=(0,p.useState)(""),n=r[0],i=r[1],a=(0,p.useRef)(null),o=(0,p.useRef)(null);return(0,p.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(a.current&&o.current){var e=new(Ae())({layers:[new(Be())({source:new(Ge())})],view:new(Qe())({center:(0,Ve.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:a.current}),r=new(We())({element:o.current,position:(0,Ve.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=a.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(Ie(),{severity:"error",children:n}):(0,e.jsxs)(c(),{children:[(0,e.jsx)(c(),{ref:o,children:(0,e.jsx)(re,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:a,className:"rustic-open-layers-map-canvas"})]})})}const Xe=require("dompurify");var $e=i.n(Xe);const Ze=require("marked");function Je(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=Ze.marked.parse(t);return $e().sanitize(r)}const et=function(t){var r=(0,p.useState)(Je(t.text)),n=r[0],i=r[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(Je(e))}}),[t.text,t.updatedData]),(0,e.jsx)(j(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},tt=function(t){var r=(0,p.useState)(Je(t.text)),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var a=n[r];"string"!=typeof a.text?(e+=" [MISSING TEXT]",s("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=a.text}i(Je(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),o&&(0,e.jsx)(Ie(),{severity:"error",children:o})]})},rt=require("@mui/material"),nt=require("@mui/material/Button");var it=i.n(nt);const at=require("@mui/material/Slider");var ot=i.n(at);function st(t){var r,n={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return n[t.action].label.replaceAll(" ","-").toLowerCase(),(0,e.jsx)(ee(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(H(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(re,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var ct=100;function lt(t){var r="dark"===(0,rt.useTheme)().palette.mode,n=q(t.mediaElement.currentTime);return(0,e.jsxs)(c(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,a=n.length-1;a>=0;--a){var o=n.start(a),s=n.end(a);if(o<t.mediaElement.currentTime){i=s;break}}var c=i/t.mediaElement.duration*ct;return(0,e.jsx)(le(),{className:"rustic-progress-buffered",variant:"determinate",value:c,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(ot(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return q(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function ut(t){var r=(0,p.useState)(t.mediaElement.volume),n=r[0],i=r[1],a=(0,p.useState)(t.mediaElement.volume),o=a[0],s=a[1],l=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(c(),{className:"rustic-volume-settings",children:[(0,e.jsx)(st,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(s(t.mediaElement.volume),i(0)):i(o)},className:"rustic-mute-button",action:l}),(0,e.jsx)(ot(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*ct,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function dt(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(it(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(re,{name:r}),children:(0,e.jsx)(j(),{variant:"overline",children:n})})}function pt(t){var r=(0,p.useState)(!t.mediaElement.paused),n=r[0],i=r[1],a=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(st,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:a,className:"rustic-pause-play-icon"})}function mt(t){var r,n=(0,p.useState)(t.mediaElement.playbackRate),i=n[0],a=n[1];return(0,e.jsx)(ee(),{title:"Playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(it(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,a(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(j(),{variant:"body1",children:[i,"X"]})})})}function ft(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(st,{onClick:n,action:i})}function ht(t){var r=q(t.elapsedTimeInSeconds),n=q(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(c(),{className:"rustic-time-container",children:[(0,e.jsx)(j(),{variant:"overline",children:r}),(0,e.jsx)(j(),{variant:"overline",children:n})]}):(0,e.jsx)(j(),{variant:"overline",className:"rustic-time-display",children:i})}ht.defaultProps={style:"condensed"};const xt=require("@mui/material/Divider");var vt=i.n(xt);function gt(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(S.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(vt(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(j(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function bt(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!0),l=c[0],u=c[1],d=(0,p.useState)(0),m=d[0],f=d[1],h=(0,p.useState)(""),x=h[0],v=h[1],g=(0,p.useState)(""),b=g[0],y=g[1],w=(0,rt.useTheme)(),k=(0,p.useRef)(null),F=(0,rt.useMediaQuery)(w.breakpoints.down("md"));function C(){return(0,e.jsx)(j(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function N(){if(t.captions&&t.captions.length>0){var r=o?"captionsOff":"captionsOn";return(0,e.jsx)(st,{action:r,onClick:function(){return s(!o)}})}}function T(){if(k.current)return(0,e.jsxs)(S.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(ft,{mediaElement:k.current,movement:"replay"}),(0,e.jsx)(pt,{mediaElement:k.current,onError:y}),(0,e.jsx)(ft,{mediaElement:k.current,movement:"forward"})]})}function O(){if(t.transcript&&n)return(0,e.jsx)(gt,{transcript:t.transcript})}function P(){if(t.transcript)return(0,e.jsx)(dt,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:k,className:o?"rustic-has-captions":"",children:o&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,p.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=k.current)||void 0===e||e.addEventListener("timeupdate",(function(){k.current&&f(k.current.currentTime)})),null===(t=k.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=k.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=k.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=F?function(){if(k.current)return(0,e.jsxs)(S.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(ht,{elapsedTimeInSeconds:m,durationTimeInSeconds:k.current.duration,style:"wide"}),(0,e.jsx)(lt,{mediaElement:k.current}),C(),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(S.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(ut,{mediaElement:k.current}),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls-right",children:[P(),(0,e.jsxs)(S.Box,{children:[N(),(0,e.jsx)(mt,{mediaElement:k.current})]})]})]}),O()]})}:function(){if(k.current)return(0,e.jsxs)(e.Fragment,{children:[C(),(0,e.jsxs)(S.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(lt,{mediaElement:k.current}),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),N(),(0,e.jsx)(mt,{mediaElement:k.current}),(0,e.jsx)(ut,{mediaElement:k.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:m,durationTimeInSeconds:k.current.duration,style:"condensed"})]}),(0,e.jsx)(S.Box,{className:"rustic-sound-bottom-controls-right",children:P()})]}),O()]})]})};return x.length>0?(0,e.jsx)(Ie(),{severity:"error",children:x}):l?(0,e.jsxs)(S.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(E(),{})]}):(0,e.jsxs)(S.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(Ie(),{severity:"error",className:"rustic-control-error",onClose:function(){return y("")},children:b})]})}function yt(t){var r=(0,p.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],a=t.mediaElement,o=n?"miniPlayerExit":"miniPlayer";return a.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(st,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):a.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:o})}function jt(t){var r=(0,p.useState)(!!document.fullscreenElement),n=r[0],i=r[1],a=t.element,o=n?"fullscreenExit":"fullscreen";return a.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(st,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):a.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:o})}function St(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!0),l=c[0],u=c[1],d=(0,p.useState)(!!document.fullscreenElement),m=d[0],f=d[1],h=(0,p.useState)(!1),x=h[0],v=h[1],g=(0,p.useState)(""),b=g[0],y=g[1],w=(0,p.useState)(""),k=w[0],F=w[1],C=(0,p.useState)(0),N=C[0],T=C[1],O=(0,p.useRef)(null),P=(0,p.useRef)(null),D=(0,rt.useTheme)(),M=(0,rt.useMediaQuery)(D.breakpoints.down("md"));(0,p.useEffect)((function(){var e,t,r,n,i,a,o,s;function c(e){F(e),u(!1)}function l(){clearTimeout(s),s=setTimeout((function(){return v(!1)}),3e3)}null===(e=P.current)||void 0===e||e.addEventListener("timeupdate",(function(){P.current&&T(P.current.currentTime)})),null===(t=P.current)||void 0===t||t.addEventListener("canplay",(function(){F(""),u(!1)})),null===(r=P.current)||void 0===r||r.addEventListener("error",(function(){return c("Failed to load the video.")})),null===(n=P.current)||void 0===n||n.addEventListener("stalled",(function(){return c("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){f(!!document.fullscreenElement)})),null===(i=O.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),l()})),null===(a=O.current)||void 0===a||a.addEventListener("mouseleave",(function(){v(!1)})),null===(o=O.current)||void 0===o||o.addEventListener("keydown",(function(){v(!0),l()}))}),[]);var R={backgroundColor:D.palette.background.paper,opacity:x?1:0};function q(){if(t.transcript&&n)return(0,e.jsx)(gt,{transcript:t.transcript})}function z(){if(t.captions&&t.captions.length>0){var r=o?"captionsOff":"captionsOn";return(0,e.jsx)(st,{action:r,onClick:function(){return s(!o)}})}}function I(){if(t.transcript)return(0,e.jsx)(dt,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var L=M?function(){return m?(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls",sx:R,children:[(0,e.jsxs)(S.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsx)(lt,{mediaElement:P.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:N,durationTimeInSeconds:P.current.duration})]}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(ft,{mediaElement:P.current,movement:"replay"}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"forward"}),z(),(0,e.jsx)(mt,{mediaElement:P.current})]}),I()]}),q()]})}):(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsxs)(S.Box,{className:"rustic-video-controls-right",children:[I(),(0,e.jsx)(jt,{element:O.current,onError:y})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls",sx:R,children:[(0,e.jsx)(lt,{mediaElement:P.current}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"replay"}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"forward"}),z(),(0,e.jsx)(mt,{mediaElement:P.current}),(0,e.jsx)(ut,{mediaElement:P.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:N,durationTimeInSeconds:P.current.duration,style:"condensed"})]}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls-right",children:[I(),(0,e.jsx)(yt,{mediaElement:P.current,onError:y}),(0,e.jsx)(jt,{element:O.current,onError:y})]})]}),m&&q()]})})};return k.length>0?(0,e.jsx)(Ie(),{severity:"error",children:k}):(0,e.jsxs)(S.Box,{className:"rustic-video",children:[l&&(0,e.jsx)(E(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(S.Box,{ref:O,className:"rustic-video-screen",sx:{visibility:l?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(Ie(),{severity:"error",className:"rustic-control-error",onClose:function(){return y("")},children:b}),(!M||m)&&function(){if(P.current&&O.current)return(0,e.jsxs)(S.Box,{className:"rustic-video-title",sx:R,children:[(0,e.jsx)(j(),{variant:"body2",children:t.title}),m&&M&&(0,e.jsxs)(S.Box,{children:[(0,e.jsx)(yt,{mediaElement:P.current,onError:y}),(0,e.jsx)(jt,{element:O.current,onError:y})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:P,src:t.src,poster:t.poster,children:o&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),L()]}),!m&&q()]})}const wt=require("@mui/material/Drawer");var kt=i.n(wt);const Ft=require("@mui/material/ListItemText");var Ct=i.n(Ft);const Et=require("@mui/material/Menu");var Nt=i.n(Et),Tt=function(){return Tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tt.apply(this,arguments)};function Ot(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useRef)(null),o=(0,l.useTheme)(),s=(0,rt.useMediaQuery)(o.breakpoints.down("md")),c=s?kt():Nt(),u={borderRadius:"".concat(o.shape.borderRadius,"px"),border:"1px solid ".concat(o.palette.divider)};function d(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(S.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Ct(),{children:(0,e.jsx)(j(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(S.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:t.endDecorator})]})}s&&(u=Tt(Tt({},u),{borderRadius:"".concat(o.shape.borderRadius,"px ").concat(o.shape.borderRadius,"px 0 0"),borderBottom:0}));var m=t.menuItems.map((function(t){return t.href?(0,e.jsx)(G(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:d(t)},t.label):(0,e.jsx)(G(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:d(t)},t.label)}));var f,h,x=s?{}:{anchorEl:a.current};return(0,e.jsxs)(e.Fragment,{children:[(f={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:a,className:"rustic-popover-menu-button"},h=(0,e.jsx)(re,{name:"more_vert"}),t.buttonText?(0,e.jsx)(it(),Tt({},f,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(ee(),{title:t.ariaLabel,children:(0,e.jsx)(H(),Tt({},f,{children:t.icon?t.icon:h}))})),(0,e.jsx)(c,Tt({open:n,onClose:function(){return i(!1)}},x,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Tt(Tt({},u),{backgroundImage:"none",boxShadow:o.shadows[2]})},children:m}))]})}var Pt=i(986);function Dt(t){var r=(0,p.useState)("Copy text"),n=r[0],i=r[1];return(0,e.jsx)(Pt.default,{message:t.message,icon:(0,e.jsx)(re,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}function Mt(t){var r=(0,p.useState)("Start reading aloud"),n=r[0],i=r[1],a=[t.message.data.title,t.message.data.description,t.message.data.alt,t.message.data.text,t.message.data.transcript].filter(Boolean).join(" "),o=new SpeechSynthesisUtterance(a);return(0,e.jsx)(Pt.default,{message:t.message,icon:(0,e.jsx)(re,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),i("Start reading aloud")):(o.onend=function(){i("Start reading aloud")},window.speechSynthesis.speak(o),i("Stop reading aloud"))},label:n})}const Rt=require("@mui/material/Stack");var qt=i.n(Rt);const zt=function(t){return(0,e.jsx)(j(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,P(r)<86400?function(e){var t=P(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,a={month:"short",day:"numeric"},o=new Date,c=(s=n.getFullYear()!==o.getFullYear())?" at ":", ",s&&(a.year="numeric"),n.toLocaleDateString(i,a)+c+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,a,o,s,c},It=(0,p.forwardRef)((function(t,r){var n=(0,rt.useTheme)();return(0,e.jsxs)(qt(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(qt(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(zt,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),Lt=require("@mui/material/Chip");var Bt=i.n(Lt);const _t=require("@mui/system/Box");var At=i.n(_t);function Ht(t){var r,n,i,a,o=(0,p.useRef)(null),s=(0,p.useRef)(null),c=(0,p.useRef)(),l=(0,p.useState)(!0),u=l[0],d=l[1],m=(0,p.useState)(!0),f=m[0],h=m[1],x=(0,p.useState)(!1),v=x[0],g=x[1],b=(null===(r=t.messages)||void 0===r?void 0:r.length)||0,y=(i=b,a=(0,p.useRef)(0),(0,p.useEffect)((function(){a.current=i})),a.current),j=2e3;function S(){h(!0),c.current&&clearTimeout(c.current),c.current=setTimeout((function(){h(!1)}),j)}function w(){var e,t=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function k(){var e=s.current,t=o.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;d(n-1<=r)}}function C(){if(w()){var e=s.current;g(!0),e&&setTimeout((function(){S(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(C,1)}function E(){if(w()){var e=o.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(E,1)}return(0,p.useEffect)((function(){var e=s.current;if(k(),e)return e.addEventListener("scroll",k),window.addEventListener("resize",k),function(){e.removeEventListener("scroll",k),window.removeEventListener("resize",k)}}),[u]),(0,p.useEffect)((function(){C()}),[v]),(0,p.useEffect)((function(){u&&0!==y&&b>y&&(S(),E())}),[u,null===(n=t.messages)||void 0===n?void 0:n.length]),(0,e.jsxs)(At(),{ref:s,className:"rustic-message-space",children:[t.messages&&t.messages.length>0&&t.messages.map((function(r,n){return(0,e.jsx)(It,{message:r,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===b-1?o:null,children:(0,e.jsx)(F,{ws:t.ws,sender:t.sender,message:r,supportedElements:t.supportedElements})},r.id)})),!u&&!f&&(0,e.jsx)(Bt(),{variant:"rusticSecondary",className:"rustic-scroll-down-button",size:"medium",onClick:function(){var e;null===(e=o.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),S()},label:(0,e.jsxs)(e.Fragment,{children:[t.scrollDownLabel,(0,e.jsx)(re,{name:"arrow_downward"})]})})]})}Ht.defaultProps={scrollDownLabel:"Scroll down"};const Wt=function(t){return(0,e.jsx)(j(),{variant:"body2",className:"rustic-text",children:$e().sanitize(t.text)})};function Vt(t){return(0,e.jsxs)(At(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(Wt,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(Fe,{file:t,children:t.url&&(0,e.jsx)(ee(),{title:"Download",children:(0,e.jsx)(H(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(re,{name:"download"})})})},r)})),(0,e.jsx)(At(),{className:"rustic-files",children:r}))]});var r}const Ut=require("@mui/material/Dialog");var Gt=i.n(Ut);const Kt=require("@mui/material/DialogTitle");var Qt=i.n(Kt);const Yt=require("@mui/material/List");var Xt=i.n(Yt);const $t=require("@mui/material/ListItem");var Zt=i.n($t);const Jt=require("@mui/material/ListSubheader");var er=i.n(Jt),tr=i(265);function rr(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=t.participants.length,o=n?t.participants:t.participants.slice(0,3),s="".concat(T()(t.participantType,a)," (").concat(a,")"),c=n?"Show Less":"Show All ".concat(a);return 0===a?(0,e.jsx)(j(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(Xt(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(er(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(S.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(j(),{variant:"subtitle2",color:"text.secondary",children:s})]}),a>3&&(0,e.jsx)(it(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(re,{name:"keyboard_arrow_down"}),children:c})]}),children:o.map((function(t){return(0,e.jsxs)(Zt(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(j(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(j(),{variant:t.participantRole===tr._.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})}const nr=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===tr._.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,tr.A.Human),i=r(t.participants,tr.A.Agent),a="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(Gt(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(Qt(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:a}),(0,e.jsx)(rr,{participantType:"Human",participantTypeIcon:(0,e.jsx)(re,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(vt(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(rr,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(re,{name:"smart_toy"}),participants:i})]})]})},ir=require("@mui/material/DialogActions");var ar=i.n(ir);const or=require("@mui/material/DialogContent");var sr=i.n(or);const cr=require("@mui/material/DialogContentText");var lr=i.n(cr),ur=function(){return ur=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ur.apply(this,arguments)},dr=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function pr(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!1),l=c[0],u=c[1],d=(0,p.useState)(!1),m=d[0],f=d[1],h=(0,p.useState)([]),x=h[0],v=h[1],g=(0,p.useState)(null),b=g[0],y=g[1],w=(0,S.useTheme)(),k=x[x.length-1],C=ur(ur({},t.ws),{send:function(e){y(e)}});function N(e){var t=JSON.parse(e.data);v((function(e){return dr(dr([],e,!0),[t],!1)}))}function T(){if(b){var e=ur(ur({},b),{threadId:t.messageId});t.ws.send(e)}}if((0,p.useEffect)((function(){t.ws.onReceive&&t.ws.onReceive(N)}),[t.ws]),(0,p.useEffect)((function(){x.length>0&&(k&&k.sender.id!==t.sender.id&&s(!1),"promptBuilder"===k.format&&k.data.isLastQuestion&&i(!0))}),[x.length]),0!==x.length)return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,e.jsxs)(Gt(),{open:l,onClose:function(){return u(!1)},"aria-labelledby":"quit-dialog-title","aria-describedby":"quit-dialog-description",sx:{"& .MuiPaper-root":{width:"clamp(320px,50vw,600px)",border:"1px solid ".concat(w.palette.divider)}},children:[(0,e.jsx)(Qt(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,e.jsx)(vt(),{}),(0,e.jsx)(sr(),{children:(0,e.jsx)(lr(),{id:"quit-dialog-description",className:"rustic-align-self-center",children:"All progress will be lost."})}),(0,e.jsxs)(ar(),{className:"rustic-prompt-builder-dialog-buttons",disableSpacing:!0,children:[(0,e.jsx)(it(),{variant:"rusticSecondary",startIcon:(0,e.jsx)(re,{name:"close"}),onClick:function(){u(!1),t.onCancel()},children:"Quit"}),(0,e.jsx)(it(),{variant:"rusticPrimary",onClick:function(){return u(!1)},children:"Continue build"})]})]}),t.getProfileComponent?t.getProfileComponent(x[0]):(0,e.jsx)(j(),{color:"text.secondary",children:"Prompt Builder"}),(0,e.jsx)(vt(),{className:"rustic-prompt-builder-divider"}),(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!m&&x.length>0)return x.map((function(r){if(r.sender.id!==t.sender.id&&"promptBuilder"!==r.format)return(0,e.jsx)(F,{ws:C,sender:t.sender,message:r,supportedElements:t.supportedElements},r.id)}))}(),o&&(0,e.jsx)(E(),{color:"secondary",className:"rustic-align-self-center"})]}),(0,e.jsx)(e.Fragment,{children:!m&&(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons",children:[(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons-left",children:[(0,e.jsx)(it(),{variant:"rusticSecondary",startIcon:(0,e.jsx)(re,{name:"close"}),onClick:function(){return u(!0)},children:"Quit"}),(0,e.jsx)(it(),{variant:"rusticSecondary",endIcon:(0,e.jsx)(re,{name:"chevron_right"}),onClick:function(){T(),y(null),s(!0)},disabled:!b,"aria-disabled":!b,children:"Next question"})]}),n&&(0,e.jsx)(S.Box,{className:"rustic-prompt-builder-buttons-right",children:(0,e.jsx)(it(),{variant:"rusticPrimary",onClick:function(){T(),f(!0),s(!0),t.onSubmit()},disabled:o,"aria-disabled":o,children:"Generate"})})]})})]})}function mr(t){var r=(0,p.useState)(""),n=r[0],i=r[1],a=(0,rt.useTheme)(),o=(0,rt.useMediaQuery)(a.breakpoints.down("md"))?"column":"row",s=t.options.map((function(r,a){return(0,e.jsx)(Bt(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:(0,_.v4)(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"rusticSecondary",size:"small",sx:n===r?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!n,"aria-disabled":!!n,label:r},a)}));return(0,e.jsxs)(c(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(c(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",children:t.description})]}),(0,e.jsx)(qt(),{direction:o,className:"rustic-options-container",children:s})]})}const fr=require("@mui/material/Table");var hr=i.n(fr);const xr=require("@mui/material/TableBody");var vr=i.n(xr);const gr=require("@mui/material/TableCell");var br=i.n(gr);const yr=require("@mui/material/TableContainer");var jr=i.n(yr);const Sr=require("@mui/material/TableHead");var wr=i.n(Sr);const kr=require("@mui/material/TablePagination");var Fr=i.n(kr);const Cr=require("@mui/material/TableRow");var Er=i.n(Cr);const Nr=require("@mui/material/TableSortLabel");var Tr,Or=i.n(Nr),Pr=10;function Dr(){return(0,e.jsx)(re,{name:"expand_all"})}function Mr(t){if(0===t.data.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available"});var r,n,i,a=t.data.length>Pr,o=(0,p.useState)({}),s=o[0],c=o[1],l=(0,p.useState)(a?Pr:-1),u=l[0],d=l[1],m=(0,p.useState)(0),f=m[0],h=m[1],x=(0,rt.useTheme)(),v=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),g=t.headers||v.map((function(e){return{dataKey:e}})),b=(r=t.data,n=Object.keys(s)[0],i=s[n],n&&i?r.slice().sort((function(e,t){var r=Object.keys(s)[0],n=s[r];return e[r]<t[r]?n===Tr.Descending?1:-1:e[r]>t[r]?n===Tr.Descending?-1:1:0})):r),y=b.slice(f*u,f*u+u),S=u>0?y:b;function w(e){if(!s[e])return Dr}return(0,e.jsxs)(qt(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(j(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsx)(jr(),{className:"rustic-table-container",children:(0,e.jsxs)(hr(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[g.length>0&&(0,e.jsx)(wr(),{children:(0,e.jsx)(Er(),{children:g.map((function(t,r){return(0,e.jsx)(br(),{sortDirection:s[t.dataKey]||!1,children:(0,e.jsx)(ee(),{title:(n=t.dataKey,i=s[n],i?Object.keys(Tr)[Object.values(Tr).indexOf(i)]:"Sort"),children:(0,e.jsx)(Or(),{active:!0,direction:s[t.dataKey],onClick:function(){return function(e){c((function(t){var r,n,i={};switch(t[e]){case Tr.Ascending:(r={})[e]=Tr.Descending,i=r;break;case Tr.Descending:i={};break;default:(n={})[e]=Tr.Ascending,i=n}return i}))}(t.dataKey)},className:"rustic-table-header",IconComponent:w(t.dataKey),children:t.label||M(t.dataKey)})})},"header-".concat(r));var n,i}))})}),(0,e.jsx)(vr(),{children:S.map((function(t,r){return(0,e.jsx)(Er(),{children:g.map((function(n,i){return(0,e.jsx)(br(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),a&&(0,e.jsx)(Fr(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:u,labelRowsPerPage:"Rows:",page:f,onPageChange:function(e,t){return h(t)},onRowsPerPageChange:function(e){d(+e.target.value),h(0)},sx:{"& .MuiTablePagination-selectLabel":{color:x.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}!function(e){e.Ascending="asc",e.Descending="desc"}(Tr||(Tr={}));const Rr=function(t){var r=(0,p.useState)($e().sanitize(t.text)),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var a=n[r];"string"!=typeof a.text&&(e+=" [MISSING TEXT]",s("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=a.text}i($e().sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j(),{variant:"body2",children:n}),o&&(0,e.jsx)(Ie(),{severity:"error",children:o})]})};var qr=function(){return qr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qr.apply(this,arguments)};function zr(t){var r=$e().sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",qr({},z(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}zr.defaultProps={title:"Embedded video"};const Ir=require("@mui/material/FormControl");var Lr=i.n(Ir);const Br=require("recharts");var _r=function(){return _r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_r.apply(this,arguments)},Ar={line:Br.LineChart,bar:Br.BarChart,area:Br.AreaChart};function Hr(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function Wr(t){var r=(0,p.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],a=(0,p.useState)(null),o=a[0],s=a[1],c=(0,p.useState)(t.timeSeries),l=c[0],u=c[1],d=ye()(),m=l.length>0?Object.keys(l[0]):[],f=m[0],h=m.slice(1),x=(0,p.useState)(Hr(h)),v=x[0],g=x[1];(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Ar[n];function y(e){o?s(null):e&&s(e.currentTarget)}function S(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function w(e){return v[e]?"none":"line-through"}if(0===l.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available"});var k,F,C,E,N=t.timeSeries[t.timeSeries.length-1],T=(k=t.timeSeries[0][f],F=N[f],C=new Date(k),E=new Date(F),Math.round(Math.abs((E.getTime()-C.getTime())/864e5)));return(0,e.jsxs)(At(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Lr(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(H(),{"aria-label":"chart options","aria-expanded":Boolean(o),"aria-haspopup":"true",onClick:y,color:"primary",children:(0,e.jsx)(re,{name:"more_vert"})}),(0,e.jsxs)(Nt(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:o,open:Boolean(o),onClose:function(e){return y(e)},children:[(0,e.jsx)(j(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Ar).map((function(t){return(0,e.jsxs)(G(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),y()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(At(),{children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Br.ResponsiveContainer,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:l,margin:t.chartContainerMargin,children:[(0,e.jsx)(Br.XAxis,{dataKey:f,tickFormatter:function(e){return R(e,T)},stroke:d.palette.text.primary}),(0,e.jsx)(Br.YAxis,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:d.palette.text.primary}),(0,e.jsx)(Br.Tooltip,{labelFormatter:function(e){return[R(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:d.palette.common.black}}),(0,e.jsx)(Br.Legend,{content:function(){return(0,e.jsx)(At(),{className:"rustic-recharts-time-series-legend",children:h.map((function(t,r){return(0,e.jsxs)(At(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!h.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,a=h;i<a.length;i++){var o=a[i],s=o===e;n[o]=s}g(n)}else g(r?Hr(h):_r(_r({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:S(t,r)},children:[(0,e.jsx)(re,{name:"crop_16_9"}),(0,e.jsx)(j(),{variant:"body2",display:"inline",sx:{textDecorationLine:w(t)},children:t})]},r)}))})}}),h.map((function(r,i){return v[r]?function(r,i){var a=i%t.chartColors.length,o=v[r]?t.chartColors[a]:"transparent",s={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(Br.Line,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:o,activeDot:t.onClick&&s},r);case"bar":return(0,e.jsx)(Br.Bar,{dataKey:r,fill:o,onClick:t.onClick&&s.onClick,cursor:t.onClick&&s.cursor},r);case"area":return(0,e.jsxs)(p.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),(0,e.jsx)(Br.Area,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:o,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&s},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(Br.ReferenceLine,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}Wr.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const Vr=Wr,Ur=require("mermaid");var Gr=i.n(Ur),Kr=function(){return Kr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kr.apply(this,arguments)};const Qr=function(t){var r=(0,p.useRef)(null),n=(0,p.useState)(),i=n[0],a=n[1],o=ye()(),s=(0,_.v4)();return(0,p.useEffect)((function(){var e="dark"===o.palette.mode?"dark":"neutral",n=o.typography.fontFamily;r.current&&(Gr().initialize(Kr({theme:e,themeVariables:{fontFamily:n}},t.config)),Gr().render("mermaid-svg-".concat(s),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),a("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),a("Failed to render the diagram.")})))})),(0,e.jsxs)(qt(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(j(),{variant:"body2",children:i})]})},Yr=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var Xr=i.n(Yr),$r=function(){return $r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$r.apply(this,arguments)};function Zr(e){return e?e.reduce((function(e,t){var r=t.dataKey,n=t.label;return e[r]=n||r,e}),{}):{}}const Jr=function(t){if(0===t.data.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available."});var r=(0,p.useRef)(null),n=(0,l.useTheme)(),i=(0,p.useState)(!1),a=i[0],o=i[1],s=n.palette.mode,c="dark"===s?"Pro Dark":"Pro Light",u=Zr(t.headers),d="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(n.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(n.palette.primary.light," !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ").concat("dark"===s?"dark":"white"," !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n span.button {\n color: ").concat(n.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(n.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(n.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n ");var m,f,h,x,v,g,b,y,S,w=t.config&&(f=(m=t.config).groupBy,h=m.splitBy,x=m.aggregates,v=m.sort,g=m.filter,b=m.columns,y=null==v?void 0:v.map((function(e){return[u[e[0]]||e[0],e[1]]})),S=x&&Object.fromEntries(Object.entries(x).map((function(e){var t=e[0],r=e[1];return[u[t]||t,r]}))),{group_by:null==f?void 0:f.map((function(e){return u[e]||e})),split_by:null==h?void 0:h.map((function(e){return u[e]||e})),aggregates:S,sort:y,filter:g&&function(e){return e.map((function(e){return[u[e[0]]||e[0],e[1],e[e.length-1]]}))}(g),columns:null==b?void 0:b.map((function(e){return u[e]||e}))});return(0,p.useEffect)((function(){Xr().worker().table(function(e,t){var r=Zr(t);return e.map((function(e){for(var t={},n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],o=a[0],s=a[1];t[r[o]||o]=[s]}return t}))}(t.data,t.headers)).then((function(e){var n=r.current;n&&n.load(e).then((function(){if(n.restore($r($r({},w),{theme:c,title:t.title,settings:!1})),n.shadowRoot){var e=new CSSStyleSheet;e.replaceSync(d),n.shadowRoot.adoptedStyleSheets.push(e)}})).catch((function(){o(!0)}))})).catch((function(){o(!0)}))}),[t.data,c]),a?(0,e.jsx)(j(),{variant:"body2",children:"Failed to create table from data."}):(0,e.jsxs)(ge(),{direction:"column",className:"rustic-perspective-viz",children:[t.title&&(0,e.jsx)(j(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsx)("perspective-viewer",{ref:r,style:{fontFamily:n.typography.fontFamily}})]})},en=require("react-dom/server"),tn=require("vega-embed");var rn=i.n(tn),nn=function(){return nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nn.apply(this,arguments)};function an(t){var r=(0,p.useRef)(null),n=(0,p.useState)(!1),i=n[0],a=n[1],o=ye()(),s="dark"===o.palette.mode,c=o.typography.fontFamily,l={backgroundColor:o.palette.primary.main,color:o.palette.background.paper,borderRadius:o.shape.borderRadius+"px",padding:"4px 8px",fontSize:o.typography.caption.fontSize,fontFamily:c,fontWeight:o.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,en.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:l,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},d=[{label:"Save as SVG"},{label:"Save as PNG"}];function m(){var e,n,i,o;if(r.current&&t.spec){var l=nn(nn({config:{font:c}},t.options),{theme:s?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(o=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===o?void 0:o.font)||(l.config.font=c);var p=nn({},t.spec);delete p.title,rn()(r.current,p,l).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var a="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,a).then((function(e){d[i].href=e,d[i].downloadFileName="".concat(r,".").concat(n)}))})),a(!1)})).catch((function(){a(!0)}))}}return(0,p.useEffect)((function(){function e(){m()}return m(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,s]),i?(0,e.jsx)(j(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(ge(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(At(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(Ot,{menuItems:d,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(j(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsxs)(At(),{textAlign:"center",mt:1,children:["string"==typeof t.spec.title&&(0,e.jsx)(j(),{variant:"subtitle2",children:t.spec.title}),t.spec.description&&(0,e.jsx)(j(),{variant:"caption",children:t.spec.description})]}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const on=an;function sn(t){var r=(0,p.useState)(t.units),n=r[0],i=r[1];function a(e){return"metric"===t.units&&"imperial"===n?Math.round(1.8*e+32):"imperial"===t.units&&"metric"===n?Math.round(e*(5/9)-32):Math.round(e)}var o=new Date(1e3*t.weather[0].timestamp),s=I(t.weather[0].timestamp).shortName,l=o.getDate(),u=o.getFullYear().toString().slice(2),d="".concat(s," ").concat(l,"/").concat(u," TODAY"),m="HIGH: ".concat(a(t.weather[0].temp.high)," / LOW: ").concat(a(t.weather[0].temp.high)),f=t.weather.map((function(t,r){if(0!==r)return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,e.jsx)(j(),{variant:"h5",component:"span",color:"text.secondary","aria-label":I(t.timestamp).fullName,children:I(t.timestamp).shortName}),(0,e.jsx)("img",{src:t.weatherIcon.icon,alt:t.weatherIcon.description}),(0,e.jsxs)(j(),{variant:"body2",color:"text.secondary",children:["High: ",a(t.temp.high),"°"]}),(0,e.jsxs)(j(),{variant:"body2",color:"text.secondary",children:["Low: ",a(t.temp.low),"°"]})]},r)}));return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-weather",children:[(0,e.jsx)(Ot,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,e.jsxs)(qt(),{alignItems:"center",children:[(0,e.jsx)(j(),{variant:"h4",component:"span",children:t.location}),(0,e.jsxs)(qt(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,e.jsx)("img",{src:t.weather[0].weatherIcon.icon,alt:""}),(0,e.jsx)(j(),{variant:"body2",children:t.weather[0].weatherIcon.description})]}),t.weather[0].temp.current&&(0,e.jsxs)(j(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[a(t.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,e.jsxs)(qt(),{direction:"row",spacing:2,children:[(0,e.jsx)(j(),{variant:"overline",children:d}),(0,e.jsx)(j(),{variant:"overline",children:m})]})]}),(0,e.jsx)(c(),{className:"rustic-daily-weather-container",children:f}),t.weatherProvider&&(0,e.jsxs)(qt(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,e.jsx)(re,{name:"cloud"}),(0,e.jsx)(j(),{variant:"body2",children:"Weather data provided by ".concat(t.weatherProvider)})]})]})}an.defaultProps={theme:{dark:"dark"}};var cn=i(470)})(),a})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e,t,r={986:(e,t,r)=>{r.d(t,{default:()=>c});var n=r(997),i=r(934),a=r.n(i),o=r(229),s=r.n(o);r(689);const c=function(e){return(0,n.jsx)(s(),{title:e.label,children:(0,n.jsx)(a(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},470:(e,t,r)=>{r.d(t,{rusticDarkTheme:()=>J,rusticLightTheme:()=>R});var n=r(442);const i=require("@mui/utils");var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)},o="#000000",s="#FFFFFF",c="#FF6928",l="#E54500",u="#FF692899",d="#FF69284D",p=(0,n.createTheme)({shape:{borderRadius:16},typography:{fontFamily:"Inter",h1:{fontStyle:"normal",fontWeight:300,fontSize:"94px",lineHeight:1.167,letterSpacing:"-1.5px"},h2:{fontStyle:"normal",fontWeight:300,fontSize:"59px",letterSpacing:"-0.5px",lineHeight:1.2},h3:{fontStyle:"normal",fontWeight:400,fontSize:"47px",letterSpacing:"0px",lineHeight:1.167},h4:{fontStyle:"normal",fontWeight:400,fontSize:"33px",letterSpacing:"0.25px",lineHeight:1.235},h5:{fontStyle:"normal",fontWeight:400,fontSize:"24px",letterSpacing:"0px",lineHeight:1.334},h6:{fontStyle:"normal",fontWeight:500,fontSize:"20px",letterSpacing:"0.15px",lineHeight:1.6},body1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.5px",lineHeight:1.5},body2:{fontStyle:"normal",fontWeight:400,fontSize:"14px",letterSpacing:"0.25px",lineHeight:1.43},subtitle1:{fontStyle:"normal",fontWeight:400,fontSize:"16px",letterSpacing:"0.15px",lineHeight:1.75},subtitle2:{fontStyle:"normal",fontWeight:500,fontSize:"14px",letterSpacing:"0.1px",lineHeight:1.57},overline:{fontStyle:"normal",fontWeight:400,fontSize:"10px",letterSpacing:"1.5px",lineHeight:1.5,textTransform:"uppercase"},caption:{fontStyle:"normal",fontWeight:400,fontSize:"12px",letterSpacing:"0.4px",lineHeight:1.66},button:{textTransform:"none"}},palette:{common:{black:o,white:s},error:{main:"#F82A43",dark:"#C82639",light:"#FF9BA7"},warning:{main:"#FFB800",dark:"#DC8400",light:"#FFDB7D"},info:{main:"#0094FF",dark:"#005A9B",light:"#8CCFFF"}},shadows:function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],(0,n.createTheme)({}).shadows.map((function(e,t){return 1===t?"0 4px 5px rgba(0, 0, 0, 0.05)":2===t?"0 4px 10px rgba(0, 0, 0, 0.1)":3===t?"0 4px 15px rgba(0, 0, 0, 0.15)":"none"})),!0)}),m={fontSize:"12px",lineHeight:1.5,letterSpacing:"0.5px",padding:"0 12px",minHeight:"26px"},f={fontSize:"14px",lineHeight:1.43,letterSpacing:"0.25px",padding:"0 16px",minHeight:"40px"},h={fontSize:"16px",lineHeight:1.75,letterSpacing:"0.15px",padding:"0 24px",minHeight:"64px"},x="#E1D9D5",v="#0000001F",g="#2D2825",b="#2D282599",y="#1E0C04",j="#9C9795",S="#00000061",w="#2D282514",k="#2D28251F",F="#2D28254D",C="#2D282580",E={fontWeight:700},N={"&.Mui-disabled":{background:s,color:j,border:"1px solid ".concat(S)}},T=a(a(a({},E),{background:g,color:s,"&:hover":{background:b},"&:focus":{border:"4px solid ".concat(b)}}),N),O=a(a(a({},E),{background:s,color:y,border:"1px solid ".concat(b),"&:focus":{border:"4px solid ".concat(b)}}),N),P={fontWeight:400,"& .MuiChip-label":{padding:0,display:"flex",alignItems:"center",gap:"8px"}},D=a({background:F,color:y,border:"1px solid ".concat(C),"&:hover":{border:"1px solid ".concat(C),background:w},"&:focus":{border:"3px solid ".concat(C),background:k},"&.Mui-disabled":{background:S,opacity:100,border:"none",color:s,"& .MuiChip-icon":{color:s}},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:y}},P),M=a({background:s,color:y,border:"1px solid ".concat(u),"&:focus":{border:"4px solid ".concat(u)},"&.Mui-disabled":{border:"1px solid ".concat(u),background:s,color:u,opacity:100},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:y}},P),R=(0,n.createTheme)((0,i.deepmerge)(p,{palette:{mode:"light",divider:x,text:{primary:y,secondary:"#4E443F",disabled:j},primary:{main:g,dark:o,light:b,contrastText:s,focus:k,focusVisible:F,hover:w,selected:"#2D282529",border:C},secondary:{main:c,light:u,dark:l,contrastText:s,focus:"#FF69281F",focusVisible:d,hover:"#FF692814",selected:"#FF692829",border:"#FF692880"},background:{default:"#F7F6F5",paper:s},action:{active:"#0000008F",hover:"#00000014",selected:"#00000029",disabledBackground:v,focus:v,disabled:S},success:{main:"#007F51",dark:"#014F33",light:"#00D788",contrastText:s},error:{contrastText:s},warning:{contrastText:s},info:{contrastText:s}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:g,color:s}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:v},root:{borderBottom:"1px solid ".concat(x),padding:"8px 16px"}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{"& .MuiTableSortLabel-icon":{color:y}}}}},MuiPopover:{styleOverrides:{paper:{border:"1px solid ".concat(x),backgroundImage:"none"}}},MuiButton:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"8px"},m),T)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"12px"},f),T)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"16px"},h),T)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"8px","&:hover":{border:"1px solid ".concat(o),background:s}},m),O)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"12px","&:hover":{border:"2px solid ".concat(o),background:s}},f),O)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"16px","&:hover":{border:"2px solid ".concat(o),background:s}},h),O)}]},MuiChip:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"24px"},m),D)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"32px"},f),D)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"48px"},h),D)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"24px","&:hover":{border:"1px solid ".concat(c),background:s}},m),M)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"32px","&:hover":{border:"2px solid ".concat(c),background:s}},f),M)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"48px","&:hover":{border:"2px solid ".concat(c),background:s}},h),M)}]}}})),q="#FFFFFF61",z="#FFFFFF1F",I="#E1D9D5",L="#202020",B="#FFFCFB",_="#FFFCFB99",A="#000000DE",H="#FFFFFF61",W="#FF692880",V="#FFFCFB1F",U="#FFFCFB4D",G="#FFFCFB14",K="#FFFFFF4D",Q={"&.Mui-disabled":{background:K,color:q,border:"1px solid ".concat(H)}},Y=a(a(a({},E),{background:B,color:o,"&:hover":{background:_},"&:focus":{border:"4px solid ".concat(_)}}),Q),X=a(a(a({},E),{background:L,color:s,border:"1px solid ".concat(_),"&:focus":{border:"4px solid ".concat(_)}}),Q),$=a(a({background:U,color:s,border:"1px solid ".concat(W),"&:hover":{border:"1px solid ".concat(W),background:G},"&:focus":{border:"4px solid ".concat(_),background:V},"&.Mui-disabled":{background:H,opacity:100,border:"none",color:A,"& .MuiChip-icon":{color:A}}},P),{"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:s}}),Z=a({background:L,color:s,border:"1px solid ".concat(u),"&:focus":{border:"4px solid ".concat(u)},"&.Mui-disabled":{background:L,color:u,border:"1px solid ".concat(u),opacity:100},"& .MuiChip-icon":{margin:"0px 8px 0px 0px",color:s}},P),J=(0,n.createTheme)((0,i.deepmerge)(p,{palette:{mode:"dark",divider:I,primary:{main:B,dark:s,light:_,contrastText:A,hover:G,selected:"#FFFCFB29",focus:V,focusVisible:U,border:W},secondary:{main:c,light:u,dark:l,contrastText:A,hover:"#FF692814",selected:"#FF692829",focus:"#FF69281F",focusVisible:d,border:"#FF692880"},background:{default:"#2C2C2C",paper:L},text:{primary:s,secondary:"#FFFFFFB2",disabled:q},action:{active:K,hover:K,selected:"#FFFFFF29",focus:z,disabledBackground:z,disabled:H},success:{main:"#00B775",dark:"#01784D",light:"#00E390",contrastText:A},error:{contrastText:A},warning:{contrastText:A},info:{contrastText:A}},components:{MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:B,color:o}}},MuiTableSortLabel:{styleOverrides:{root:{"&.Mui-active":{"& .MuiTableSortLabel-icon":{color:s}}}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:z},root:{borderBottom:"1px solid ".concat(I),padding:"8px 16px"}}},MuiPopover:{styleOverrides:{paper:{border:"1px solid ".concat(I),backgroundImage:"none"}}},MuiChip:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"24px"},m),$)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"32px"},f),$)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"48px"},h),$)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"24px","&:hover":{background:L,border:"1px solid ".concat(c)}},m),Z)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"32px","&:hover":{background:L,border:"2px solid ".concat(c)}},f),Z)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"48px","&:hover":{background:L,border:"2px solid ".concat(c)}},h),Z)}]},MuiButton:{variants:[{props:{variant:"rusticPrimary",size:"small"},style:a(a({borderRadius:"8px"},m),Y)},{props:{variant:"rusticPrimary",size:"medium"},style:a(a({borderRadius:"12px"},f),Y)},{props:{variant:"rusticPrimary",size:"large"},style:a(a({borderRadius:"16px"},h),Y)},{props:{variant:"rusticSecondary",size:"small"},style:a(a({borderRadius:"8px","&:hover":{background:L,border:"1px solid ".concat(s)}},m),X)},{props:{variant:"rusticSecondary",size:"medium"},style:a(a({borderRadius:"12px","&:hover":{background:L,border:"2px solid ".concat(s)}},f),X)},{props:{variant:"rusticSecondary",size:"large"},style:a(a({borderRadius:"16px","&:hover":{background:L,border:"2px solid ".concat(s)}},h),X)}]}}}));R=(0,n.responsiveFontSizes)(R),J=(0,n.responsiveFontSizes)(J)},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},442:e=>{e.exports=require("@mui/material/styles")},13:e=>{e.exports=require("emoji-picker-element")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);i.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>r[e]));return o.default=()=>r,i.d(a,o),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{i.r(a),i.d(a,{Action:()=>Pt.default,CodeSnippet:()=>w,CopyText:()=>Dt,ElementRenderer:()=>F,FCCalendar:()=>h,Image:()=>B,MarkedMarkdown:()=>et,MarkedStreamingMarkdown:()=>tt,MermaidViz:()=>$r,MessageCanvas:()=>It,MessageSpace:()=>Vt,MultimodalInput:()=>De,Multipart:()=>Gt,OpenLayersMap:()=>Ye,PDFViewer:()=>we,ParticipantsContainer:()=>or,PerspectiveViz:()=>rn,PopoverMenu:()=>Ot,PromptBuilder:()=>hr,Question:()=>xr,RechartsTimeSeries:()=>Kr,Sound:()=>bt,StreamingText:()=>Ir,Table:()=>zr,Text:()=>Ut,TextInput:()=>qe,TextToSpeech:()=>Mt,Timestamp:()=>zt,Uploader:()=>Te,VegaLiteViz:()=>ln,Video:()=>St,Weather:()=>un,YoutubeVideo:()=>Br,rusticDarkTheme:()=>dn.rusticDarkTheme,rusticLightTheme:()=>dn.rusticLightTheme});var e=i(997);const t=require("@fullcalendar/daygrid");var r=i.n(t);const n=require("@fullcalendar/react");var o=i.n(n);const s=require("@mui/material/Box");var c=i.n(s),l=i(442);const u=require("@mui/material/useMediaQuery");var d=i.n(u),p=i(689),m=i.n(p);function f(e){return{title:e.title?e.title:"",start:e.start,end:e.end,allDay:e.isAllDay}}function h(t){var n=(0,l.useTheme)(),i=d()(n.breakpoints.up("md"));return(0,e.jsx)(c(),{className:"rustic-fc-calendar",children:(0,e.jsx)(o(),{plugins:[r()],initialView:i?"dayGridMonth":"dayGridDay",headerToolbar:{left:"prev,next",center:"title",right:"dayGridMonth,dayGridWeek,dayGridDay"},eventTimeFormat:{hour:"2-digit",minute:"2-digit"},initialDate:t.events[0].start,events:t.events.map(f),views:{dayGridMonth:{titleFormat:{year:"numeric",month:"short"}},dayGridWeek:{},dayGridDay:{titleFormat:{year:"numeric",month:"short",day:"numeric"}}}})})}const x=require("@codemirror/language"),v=require("@codemirror/language-data"),g=require("@codemirror/state"),b=require("@codemirror/view"),y=require("@mui/material/Typography");var j=i.n(y);const S=require("@mui/system");function w(t){var r=(0,p.useRef)(null),n=(0,p.useRef)(),i=new g.Compartment,a=[g.EditorState.readOnly.of(!0),(0,b.highlightSpecialChars)(),(0,x.syntaxHighlighting)(x.defaultHighlightStyle,{fallback:!0}),i.of([])],o=v.languages.find((function(e){return e.name.toLowerCase()===t.language.toLowerCase()}));return(0,p.useEffect)((function(){if(r.current&&!n.current){var e=r.current,s=g.EditorState.create({doc:t.code,extensions:a});n.current=new b.EditorView({state:s,parent:e}),o&&n.current&&o.load().then((function(e){var t;null===(t=n.current)||void 0===t||t.dispatch({effects:i.reconfigure(e.extension)})}))}}),[]),(0,e.jsx)(S.Box,{sx:{backgroundColor:"background.default"},className:"rustic-code-snippet",children:(0,e.jsx)("div",{"aria-label":"code snippet",ref:r,children:(0,e.jsx)(j(),{variant:"body2","aria-label":"language type",children:t.language})})})}var k=function(){return k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},k.apply(this,arguments)};const F=function(t){var r=t.messages[0],n=t.messages.slice(1),i=t.supportedElements[r.format];return(0,e.jsx)(e.Fragment,{children:i?m().createElement(i,k(k({sender:t.sender,ws:t.ws,messageId:r.id,conversationId:r.conversationId},r.data),n.length>0&&{updatedData:n.map((function(e){return e.data}))})):(0,e.jsxs)(j(),{variant:"body2",children:["Unsupported element format: ",r.format]})})},C=require("@mui/material/CircularProgress");var E=i.n(C);const N=require("pluralize");var T=i.n(N),O=function(){return O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},O.apply(this,arguments)};function P(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}var D,M=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function R(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===D.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?D.HOUR:D.MONTH_DATE)}function q(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),i=t>0?"".concat(t,":"):"",a="".concat(t>0?r.toString().padStart(2,"0"):r),o=n.toString().padStart(2,"0");return"".concat(i).concat(a,":").concat(o)}function z(e,t){var r={};return e&&(r={width:e}),t&&(r=O(O({},r),{height:t})),e||t||(r={className:"rustic-fit-container"}),r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(D||(D={}));var I=function(e){var t=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:t,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[t]}},L=function(){return L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function B(t){var r=(0,p.useState)(!0),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return o.length>0?(0,e.jsx)(j(),{variant:"body2",children:o}):(0,e.jsxs)("figure",{children:[n&&(0,e.jsx)(E(),{}),(0,e.jsx)("img",L({},z(t.width,t.height),{src:t.src,alt:t.alt,onError:function(){s("Image failed to load"),i(!1)},onLoad:function(){i(!1)}})),t.description&&(0,e.jsx)("figcaption",{children:(0,e.jsx)(j(),{variant:"body2",children:t.description})})]})}B.defaultProps={alt:"An image is displayed"};const _=require("uuid");var A=i(934),H=i.n(A);const W=require("@mui/material/InputAdornment");var V=i.n(W);const U=require("@mui/material/MenuItem");var G=i.n(U);const K=require("@mui/material/MenuList");var Q=i.n(K);const Y=require("@mui/material/Popover");var X=i.n(Y);const $=require("@mui/material/TextField");var Z=i.n($),J=i(229),ee=i.n(J),te=i(13);function re(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}const ne=function(t){var r=(0,l.useTheme)(),n=(0,p.useRef)(null),a=(0,p.useRef)(null),o=(0,p.useState)(!1),s=o[0],c=o[1],u={"--indicator-color":r.palette.divider,"--background":r.palette.background.paper,"--input-border-color":r.palette.divider,"--outline-color":r.palette.secondary.main};function d(){c(!1)}function m(e){e.detail.unicode&&t.onEmojiClick(e.detail.unicode),d()}return(0,p.useEffect)((function(){a.current||"undefined"==typeof window||Promise.resolve().then(i.t.bind(i,13,23)).then((function(e){var t=new(0,e.Picker),n="dark"===r.palette.mode?"dark":"light";t.classList.add(n),Object.keys(u).forEach((function(e){t.style.setProperty(e,u[e])})),a.current=t})).catch((function(e){console.error("Failed to load emoji picker",e)}))}),[]),(0,p.useEffect)((function(){return a.current&&a.current.addEventListener("emoji-click",m),function(){var e;null===(e=a.current)||void 0===e||e.removeEventListener("emoji-click",m)}}),[s,t.onEmojiClick]),(0,e.jsxs)("div",{children:[(0,e.jsx)(ee(),{title:"Emoji",children:(0,e.jsx)(H(),{size:"small",ref:n,onClick:function(){c((function(e){return!e}))},sx:{color:t.buttonColor},children:(0,e.jsx)(re,{name:"Mood"})})}),a.current&&(0,e.jsx)(X(),{open:s,anchorEl:n.current,onClose:d,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,e.jsx)("div",{className:"rustic-emoji-picker",ref:function(e){e&&a.current&&!e.contains(a.current)&&e.appendChild(a.current)}})})]})};var ie={"no-speech":"No speech detected. Check your microphone volume and try again.",aborted:"Speech input was aborted. Ensure no other windows are accessing your microphone and try again.","audio-capture":"Could not capture any audio. Check that your microphone is connected and try again.",network:"Failed to connect to the internet for recognition. Check your internet connection and try again.","not-allowed":"This functionality requires microphone access. Please allow microphone access and try again.","service-not-allowed":"Speech recognition service is not allowed, either because the browser doesn't support it or because of reasons of security, privacy or user preference.","bad-grammar":"There was an error in the speech recognition grammar or format. Check your speech input or grammar rules.","language-not-supported":"The language you're speaking isn't supported. Try speaking in a different language or check your device settings."};function ae(e){if("unicode"in e&&"annotation"in e)return"".concat(e.unicode," ").concat(e.annotation)}var oe=(0,p.forwardRef)((function(t,r){var n=(0,p.useState)(""),i=n[0],a=n[1],o=(0,p.useState)(!1),s=o[0],l=o[1],u=(0,p.useState)(!1),d=u[0],m=u[1],f=(0,p.useState)(!1),h=f[0],x=f[1],v=(0,p.useState)(""),g=v[0],b=v[1],y=(0,p.useState)([]),S=y[0],w=y[1],k=(0,p.useState)(!1),F=k[0],C=k[1],N=(0,p.useRef)(null),T=!i.trim().length&&!t.isSendEnabled,O="".concat(s?"Stop":"Start"," speech to text"),P=d?"primary.main":"primary.light",D=s?"error.main":P,M=s?"stop_circle":"speech_to_text";function R(e,t){if(void 0===t&&(t=!1),N.current){var r=N.current,n=r.selectionStart,o=r.selectionEnd;if("number"==typeof n&&"number"==typeof o){var s,c=i||"",l=c.substring(0,n),u=c.substring(o);s=t?l.replace(/:(\w+)$/,e)+u:l+e+u,a(s);var d=t?l.replace(/:(\w+)$/,e).length:n+e.length;setTimeout((function(){var e,t;null===(e=N.current)||void 0===e||e.focus(),null===(t=N.current)||void 0===t||t.setSelectionRange(d,d)}),0)}}C(!1)}var q=new te.Database,z=h?(0,e.jsx)(E(),{size:24}):(0,e.jsx)(ee(),{title:O,children:(0,e.jsx)(H(),{onClick:function(){var e=new window.webkitSpeechRecognition,t=navigator.language;e.lang=t,s?(e.stop(),x(!0),l(!1)):(e.start(),b(""),l(!0)),e.onstart=function(){l(!0)},e.onresult=function(e){var t,r=e.results[0][0].transcript;i.length>0?a(i+" "+r):a(r),null===(t=N.current)||void 0===t||t.focus(),l(!1)},e.onerror=function(e){var t=ie[e.error];b(t),l(!1)},e.onend=function(){x(!1),l(!1)}},size:"small",sx:{color:D},children:(0,e.jsx)(re,{name:M})})});function I(){var e=(new Date).toISOString(),r={id:(0,_.v4)(),timestamp:e,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:i}};t.send(r),a(""),b("")}return(0,e.jsxs)(c(),{className:"rustic-base-input",ref:r,children:[(0,e.jsxs)(c(),{className:"rustic-error-and-input-container",children:[(0,e.jsx)(c(),{className:"rustic-error-container",children:(0,e.jsx)(j(),{variant:"caption",color:"error",className:"rustic-error-message",children:g})}),(0,e.jsxs)(c(),{className:"rustic-input-field",sx:{border:"1px solid",borderColor:d?"secondary.main":"action.disabled"},children:[S.length>0&&(0,e.jsx)(X(),{open:F,anchorEl:N.current,onClose:function(){return C(!1)},disableAutoFocus:!0,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:(0,e.jsx)(Q(),{children:S.map((function(t,r){return"unicode"in t&&(0,e.jsx)(G(),{onClick:function(){return R(t.unicode,!0)},children:ae(t)},r)}))})}),(0,e.jsx)(Z(),{className:"rustic-text-field",variant:"outlined",value:i,label:t.label,placeholder:t.placeholder,maxRows:t.maxRows,multiline:t.multiline,fullWidth:t.fullWidth,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),!T&&I())},onChange:function(e){b("");var r=e.target.value;a(r);var n,i=r.match(/:(\w{2,}):/g),o=r.match(/:(\w{2,})/g);if(i){var s=i[0].replace(/:/g,"");q.getEmojiByShortcode(s).then((function(e){if(e&&"unicode"in e){var t=r.replace(i[0],e.unicode);a(t)}else a(r)})).catch((function(){a(r)})),C(!1)}else o?(n=o[0].replace(":",""),q.getEmojiBySearchQuery(n).then((function(e){e.length?(w(e.slice(0,t.maximumEmojiSearchResults)),C(!0)):(w([]),C(!1))})).catch((function(){w([]),C(!1)}))):C(!1)},onFocus:function(){return m(!0)},onBlur:function(){return m(!1)},inputRef:N,color:"secondary",size:"small",InputProps:{endAdornment:(0,e.jsxs)(V(),{position:"end",children:[(0,e.jsx)(ne,{onEmojiClick:R,buttonColor:P}),t.enableSpeechToText&&z]})},InputLabelProps:{className:d?"":"rustic-input-label",sx:{backgroundColor:"background.paper"}}}),(0,e.jsx)("div",{className:"rustic-input-extras"})]})]}),(0,e.jsxs)(c(),{className:"rustic-input-actions",children:[t.children,(0,e.jsx)(ee(),{title:"Send",children:(0,e.jsx)("span",{className:"rustic-send-button",children:(0,e.jsx)(H(),{"aria-label":"send message",onClick:I,disabled:T,color:"primary",children:(0,e.jsx)(re,{name:"send"})})})})]})]})}));oe.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,enableSpeechToText:!1,maximumEmojiSearchResults:5};const se=oe,ce=require("@mui/material/LinearProgress");var le=i.n(ce);const ue=require("axios");var de=i.n(ue);const pe=require("react-dom"),me=require("@mui/material/Card");var fe=i.n(me);const he=require("@mui/material/Modal");var xe=i.n(he);const ve=require("@mui/system/Stack");var ge=i.n(ve);const be=require("@mui/system/useTheme");var ye=i.n(be);const je=require("pdfjs-dist"),Se=function(t){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[t.action].label.replaceAll(" ","-").toLowerCase(),r[t.action]);return(0,e.jsx)(ee(),{title:n.label,children:(0,e.jsx)("span",{children:(0,e.jsx)(H(),{onClick:t.onClick,className:t.className,disabled:t.isDisabled,children:(0,e.jsx)(re,{name:n.symbol})})})})},we=function(t){var r,n=(0,p.useRef)(null),i=(0,p.useState)(1),a=i[0],o=i[1],s=(0,p.useState)(1),l=s[0],u=s[1],m=(0,p.useState)(1),f=m[0],h=m[1],x=(0,p.useState)(!1),v=x[0],g=x[1],b=(0,p.useState)(),y=b[0],S=b[1],w=ye()(),k=d()(w.breakpoints.down("sm")),F=d()(w.breakpoints.between("sm","md"));if(r=t.url,!/\/[^/]+\.pdf$/.test(r))return(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(j(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var C=(0,p.useState)((function(){return k?.5:F?1:1.5})),E=C[0],N=C[1];return(0,p.useEffect)((function(){je.GlobalWorkerOptions.workerSrc||(je.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(je.version,"/pdf.worker.mjs")),je.getDocument({url:"".concat(t.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(a).then((function(e){var t=e.getViewport({scale:E}),r=n.current;if(r){var i=r.getContext("2d");if(i){var a=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*a,r.height=t.height*a;var o={canvasContext:i,viewport:t,transform:[a,0,0,a,0,0]};y&&y.cancel();var s=e.render(o);S(s),s.promise.then((function(){S(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){g(!0)}))}),[t.url,a,E]),v?(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-pdf-error",children:(0,e.jsx)(j(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,e.jsxs)(c(),{className:"rustic-pdf-viewer-header",children:[(0,e.jsx)(Se,{action:"zoomOut",onClick:function(){N((function(e){return Math.max(e-.2,.2)}))}}),(0,e.jsx)(Se,{action:"zoomIn",onClick:function(){N((function(e){return e+.2}))}})]}),(0,e.jsx)(c(),{className:"rustic-pdf-viewer-body",children:(0,e.jsx)(c(),{className:"rustic-pdf-viewer-body-inner",children:(0,e.jsx)("canvas",{ref:n})})}),(0,e.jsxs)(ge(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,e.jsx)(Se,{action:"previousPage",onClick:function(){a>1&&(o(a-1),h(a-1))},isDisabled:1===a}),(0,e.jsx)(j(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,e.jsx)(Z(),{type:"number",value:f,onChange:function(e){var t=parseInt(e.target.value);h(t),!isNaN(t)&&t>=1&&t<=l&&o(t)},size:"small",className:"rustic-pdf-page-input"}),(0,e.jsxs)(j(),{variant:"body1",className:"rustic-page-indicator",children:["of ",l]}),(0,e.jsx)(Se,{action:"nextPage",onClick:function(){a<l&&(o(a+1),h(a+1))},isDisabled:a===l})]})]})};var ke={pdf:we};function Fe(t){var r=(0,l.useTheme)(),n=(0,p.useState)(!1),i=n[0],a=n[1];function o(){a(!1)}var s,c,u=t.file.url&&(s=t.file.url.split("."))[s.length-1].toLowerCase(),d=u&&t.supportedViewers?t.supportedViewers[u]:null,m=!!d;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(fe(),{className:"rustic-file-preview".concat(m?" rustic-cursor-pointer":""),variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){a(!0)},children:[(0,e.jsx)(j(),{variant:"subtitle2",children:(c=t.file.name,15,c.length<=15?c:c.substring(0,12)+"...")}),(0,e.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:t.children})]}),m&&(0,e.jsx)(xe(),{open:i,onClose:o,className:"rustic-file-preview-modal",children:(0,e.jsxs)("div",{className:"rustic-modal-content",children:[(0,e.jsx)(ee(),{title:"Close",children:(0,e.jsx)(H(),{onClick:o,className:"rustic-close-button",children:(0,e.jsx)(re,{name:"close"})})}),t.file.url&&(0,e.jsx)(d,{url:t.file.url})]})})]})}Fe.defaultProps={supportedViewers:ke};var Ce=function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ce.apply(this,arguments)},Ee=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function Ne(e){for(var t=["Bytes","KB","MB","GB"],r=0;e>=1024&&r<t.length-1;)e/=1024,r++;var n=e.toFixed(1).toString().replace(/\.0$/,"");return"".concat(n," ").concat(t[r])}const Te=function(t){var r=(0,p.useState)([]),n=r[0],i=r[1],a=(0,p.useState)([]),o=a[0],s=a[1],l=(0,p.useRef)({}),u=(0,_.v4)();(0,p.useEffect)((function(){i([]),s([]),l.current={}}),[t.messageId]);var d=(0,e.jsx)(c(),{className:"rustic-files rustic-padding-16",children:n.map((function(r,n){return(0,e.jsx)(Fe,{file:{name:r.name},children:(0,e.jsxs)(c(),{className:"rustic-flex-center",children:[r.loadingProgress<100&&(0,e.jsx)(le(),{variant:"determinate",color:"secondary",value:r.loadingProgress,className:"rustic-upload-progress"}),(0,e.jsx)(ee(),{title:"Delete",children:(0,e.jsx)(H(),{color:"primary",onClick:function(){return function(e,r){var n,a;s([]);var o=e.name;if(l.current=Ce(Ce({},l.current),((n={})[o]=l.current[o]--,n)),t.onFileUpdate("remove",o),100===e.loadingProgress){var c="".concat(t.deleteFileEndpoint,"?message-id=").concat(t.messageId,"&file-id=").concat(e.id);de().delete(c).then((function(){return i((function(e){return e.filter((function(e,t){return t!==r}))}))})).catch((function(){return t.onFileUpdate("add",o),s((function(e){return Ee(Ee([],e,!0),["Failed to delete ".concat(o,". Please try again.")],!1)}))}))}else e.abortController.abort(),i((function(e){return e.filter((function(e,t){return t!==r}))})),l.current=Ce(Ce({},l.current),((a={})[o]=l.current[o]++,a))}(r,n)},className:"rustic-delete-button","aria-label":"cancel file upload",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"cancel"})})})]})},n)}))}),m=(0,e.jsx)(c(),{children:o.map((function(t,r){return(0,e.jsx)(j(),{variant:"caption",color:"error",className:"rustic-error-message",children:t},r)}))});function f(e,t){return t?(0,pe.createPortal)(e,t):e}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c(),{className:"rustic-uploader",children:[(0,e.jsx)("label",{htmlFor:u,children:(0,e.jsx)(ee(),{title:"Upload",children:(0,e.jsx)(H(),{component:"span","aria-label":"Upload file",color:"primary",children:(0,e.jsx)("span",{className:"material-symbols-rounded",children:"upload_2"})})})}),(0,e.jsx)("input",{type:"file",id:u,onChange:function(e){s([]);var r=e.target.files&&Array.from(e.target.files),a=n.length+(r?r.length:0);t.maxFileCount&&a>t.maxFileCount&&s((function(e){return Ee(Ee([],e,!0),["You can only upload ".concat(t.maxFileCount," files.")],!1)}));var o=r&&function(e,t,r){return r?t<=r?e:e.slice(0,r-t):e}(r,a,t.maxFileCount);o&&o.forEach((function(e){!function(e){var r;t.maxFileSize&&e.size>t.maxFileSize?(r=e.name,s((function(e){return Ee(Ee([],e,!0),["Failed to upload ".concat(r,". You cannot upload files larger than ").concat(t.maxFileSize&&Ne(t.maxFileSize),".")],!1)}))):function(e){var r=new FormData,n=new AbortController,a=function(e){var t,r,n=e.name,i=l.current[n];if(i){var a=i+1,o=n.lastIndexOf("."),s=n.substring(0,o),c=n.substring(o);n="".concat(s,"(").concat(i,")").concat(c),l.current=Ce(Ce({},l.current),((t={})[e.name]=a,t))}else l.current=Ce(Ce({},l.current),((r={})[e.name]=1,r));return n}(e),o=new File([e],a,{type:e.type});r.append("file",o);var c=(0,_.v4)(),u={name:a,loadingProgress:0,abortController:n,id:c};i((function(e){return Ee(Ee([],e,!0),[u],!1)})),t.onFileUpdate("add",a);var d="".concat(t.uploadFileEndpoint,"?message-id=").concat(t.messageId);de().post(d,r,{onUploadProgress:function(e){var t,r;e.total&&(t=e.loaded/e.total*100,r=u.id,i((function(e){var n=e.map((function(e){return e.id===r?Ce(Ce({},e),{loadingProgress:t}):e}));return n})))},signal:n.signal}).then((function(e){var t,r;t=e.data,r=u.id,i((function(e){var n=e.findIndex((function(e){return e.id===r}));if(-1!==n){var i=Ee([],e,!0);return i[n]=Ce(Ce({},i[n]),{id:t.fileId}),i}return e}))})).catch((function(r){var n,o;t.onFileUpdate("remove",a),l.current=Ce(Ce({},l.current),((n={})[a]=l.current[e.name]--,n)),function(e,t,r){s((function(t){return Ee(Ee([],t,!0),["Failed to upload ".concat(e,". ").concat((null==r?void 0:r.message)||"")],!1)})),i((function(e){return e.filter((function(e){return e.id!==t}))}))}(e.name,u.id,null===(o=r.response)||void 0===o?void 0:o.data)}))}(e)}(e)})),e.target.value=""},multiple:!0,accept:t.acceptedFileTypes})]}),o.length>0&&f(m,t.errorMessagesContainer),n.length>0&&f(d,t.filePreviewsContainer)]})};var Oe=function(){return Oe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oe.apply(this,arguments)},Pe=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function De(t){var r=(0,p.useState)([]),n=r[0],i=r[1],a=(0,p.useState)((0,_.v4)()),o=a[0],s=a[1],l=(0,p.useState)(),u=l[0],d=l[1],m=(0,p.useState)(),f=m[0],h=m[1],x=(0,p.useRef)(null),v=n.length>0;return(0,p.useEffect)((function(){x.current&&(h(x.current.querySelector(".rustic-error-container")),d(x.current.querySelector(".rustic-input-extras")))})),(0,e.jsx)(c(),{className:"rustic-multimodal-input",children:(0,e.jsx)(se,Oe({},t,{send:function(e){v&&(e.id=o,e.format="filesWithText",e.data.files=n),t.ws.send(e),s((0,_.v4)()),i([])},isSendEnabled:v,ref:x,children:(0,e.jsx)(c(),{className:"rustic-bottom-buttons",children:(0,e.jsx)(Te,{acceptedFileTypes:t.acceptedFileTypes,maxFileCount:t.maxFileCount,maxFileSize:t.maxFileSize,uploadFileEndpoint:t.uploadFileEndpoint,deleteFileEndpoint:t.deleteFileEndpoint,onFileUpdate:function(e,t){i("add"===e?function(e){return Pe(Pe([],e,!0),[{name:t}],!1)}:function(e){return e.filter((function(e){return e.name!==t}))})},messageId:o,filePreviewsContainer:u,errorMessagesContainer:f})})}))})}De.defaultProps={multiline:!0,fullWidth:!0,maxRows:6,maxFileSize:2097152,maxFileCount:1};var Me=function(){return Me=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Me.apply(this,arguments)},Re=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function qe(t){var r=t.ws,n=Re(t,["ws"]);return(0,e.jsx)(se,Me({},n,{send:function(e){r.send(e)}}))}require("ol/ol.css");const ze=require("@mui/material/Alert");var Ie=i.n(ze);const Le=require("ol/layer/Tile.js");var Be=i.n(Le);const _e=require("ol/Map.js");var Ae=i.n(_e);const He=require("ol/Overlay.js");var We=i.n(He);const Ve=require("ol/proj.js"),Ue=require("ol/source/OSM.js");var Ge=i.n(Ue);const Ke=require("ol/View.js");var Qe=i.n(Ke);function Ye(t){var r=(0,p.useState)(""),n=r[0],i=r[1],a=(0,p.useRef)(null),o=(0,p.useRef)(null);return(0,p.useEffect)((function(){if(i(""),t.latitude<-90||t.latitude>90||t.longitude<-180||t.longitude>180)return i("Invalid coordinates");if(a.current&&o.current){var e=new(Ae())({layers:[new(Be())({source:new(Ge())})],view:new(Qe())({center:(0,Ve.fromLonLat)([t.longitude,t.latitude]),zoom:12}),target:a.current}),r=new(We())({element:o.current,position:(0,Ve.fromLonLat)([t.longitude,t.latitude]),positioning:"bottom-center",stopEvent:!1});return e.addOverlay(r),e.once("postrender",(function(){var e;if(!(null===(e=a.current)||void 0===e?void 0:e.querySelector("canvas")))return i("An error occurred while loading the map")})),function(){e.setTarget(""),e.removeOverlay(r)}}}),[]),(0,e.jsx)(e.Fragment,{children:n.length>0?(0,e.jsx)(Ie(),{severity:"error",children:n}):(0,e.jsxs)(c(),{children:[(0,e.jsx)(c(),{ref:o,children:(0,e.jsx)(re,{className:"rustic-open-layers-map-marker",name:"location_on"})}),(0,e.jsx)("div",{ref:a,className:"rustic-open-layers-map-canvas"})]})})}const Xe=require("dompurify");var $e=i.n(Xe);const Ze=require("marked");function Je(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=Ze.marked.parse(t);return $e().sanitize(r)}const et=function(t){var r=(0,p.useState)(Je(t.text)),n=r[0],i=r[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=t.updatedData[t.updatedData.length-1].text;i(Je(e))}}),[t.text,t.updatedData]),(0,e.jsx)(j(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},tt=function(t){var r=(0,p.useState)(Je(t.text)),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var a=n[r];"string"!=typeof a.text?(e+=" [MISSING TEXT]",s("Some of the incoming text was not correctly formatted. Some data may be missing.")):e+=a.text}i(Je(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}}),o&&(0,e.jsx)(Ie(),{severity:"error",children:o})]})},rt=require("@mui/material"),nt=require("@mui/material/Button");var it=i.n(nt);const at=require("@mui/material/Slider");var ot=i.n(at);function st(t){var r,n={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return n[t.action].label.replaceAll(" ","-").toLowerCase(),(0,e.jsx)(ee(),{title:n[t.action].label,PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(H(),{onClick:t.onClick,className:t.className,color:"primary",children:(0,e.jsx)(re,{name:n[t.action].symbol,className:"rustic-icon-large"})})})}var ct=100;function lt(t){var r="dark"===(0,rt.useTheme)().palette.mode,n=q(t.mediaElement.currentTime);return(0,e.jsxs)(c(),{className:"rustic-progress",children:[function(){for(var n=t.mediaElement.buffered,i=0,a=n.length-1;a>=0;--a){var o=n.start(a),s=n.end(a);if(o<t.mediaElement.currentTime){i=s;break}}var c=i/t.mediaElement.duration*ct;return(0,e.jsx)(le(),{className:"rustic-progress-buffered",variant:"determinate",value:c,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:r?"secondary.light":"action.selected"}}})}(),(0,e.jsx)(ot(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(n),max:t.mediaElement.duration,value:t.mediaElement.currentTime,onChange:function(e,r){t.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return q(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function ut(t){var r=(0,p.useState)(t.mediaElement.volume),n=r[0],i=r[1],a=(0,p.useState)(t.mediaElement.volume),o=a[0],s=a[1],l=t.mediaElement.muted?"volumeOff":"volumeUp";return(0,e.jsxs)(c(),{className:"rustic-volume-settings",children:[(0,e.jsx)(st,{onClick:function(){t.mediaElement.muted=!t.mediaElement.muted,t.mediaElement.muted?(s(t.mediaElement.volume),i(0)):i(o)},className:"rustic-mute-button",action:l}),(0,e.jsx)(ot(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(n*ct,"%"),value:n,onChange:function(e,r){var n=r;t.mediaElement.muted=0===n,t.mediaElement.volume=n,i(t.mediaElement.volume)}})]})}function dt(t){var r=t.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",n="".concat(t.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,e.jsx)(it(),{className:"rustic-transcript-toggle",onClick:t.setIsTranscriptVisible,endIcon:(0,e.jsx)(re,{name:r}),children:(0,e.jsx)(j(),{variant:"overline",children:n})})}function pt(t){var r=(0,p.useState)(!t.mediaElement.paused),n=r[0],i=r[1],a=n?"pause":"play";return t.mediaElement.onended=function(){i(!1)},t.mediaElement.onpause=function(){i(!1)},t.mediaElement.onplay=function(){i(!0)},(0,e.jsx)(st,{onClick:function(){n?t.mediaElement.pause():t.mediaElement.play().catch((function(e){t.onError("Failed to play the media. Error: ".concat(e.message))}))},action:a,className:"rustic-pause-play-icon"})}function mt(t){var r,n=(0,p.useState)(t.mediaElement.playbackRate),i=n[0],a=n[1];return(0,e.jsx)(ee(),{title:"Playback rate",PopperProps:{container:null!==(r=document.fullscreenElement)&&void 0!==r?r:document.body},children:(0,e.jsx)(it(),{onClick:function(){var e=1;t.mediaElement.playbackRate<2&&(e=t.mediaElement.playbackRate+.5),t.mediaElement.playbackRate=e,a(e)},className:"rustic-playback-rate-button",children:(0,e.jsxs)(j(),{variant:"body1",children:[i,"X"]})})})}function ft(t){var r="replay"===t.movement,n=r?function(){t.mediaElement.currentTime-=10}:function(){t.mediaElement.currentTime+=10},i=r?"replay":"forward";return(0,e.jsx)(st,{onClick:n,action:i})}function ht(t){var r=q(t.elapsedTimeInSeconds),n=q(t.durationTimeInSeconds),i="".concat(r," / ").concat(n);return"wide"===t.style?(0,e.jsxs)(c(),{className:"rustic-time-container",children:[(0,e.jsx)(j(),{variant:"overline",children:r}),(0,e.jsx)(j(),{variant:"overline",children:n})]}):(0,e.jsx)(j(),{variant:"overline",className:"rustic-time-display",children:i})}ht.defaultProps={style:"condensed"};const xt=require("@mui/material/Divider");var vt=i.n(xt);function gt(t){var r=!!document.fullscreenElement;return(0,e.jsxs)(S.Box,{className:"rustic-transcript-container",children:[!r&&(0,e.jsx)(vt(),{orientation:"vertical",flexItem:!0}),(0,e.jsx)(j(),{className:"rustic-transcript-content",variant:"body2",children:t.transcript})]})}function bt(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!0),l=c[0],u=c[1],d=(0,p.useState)(0),m=d[0],f=d[1],h=(0,p.useState)(""),x=h[0],v=h[1],g=(0,p.useState)(""),b=g[0],y=g[1],w=(0,rt.useTheme)(),k=(0,p.useRef)(null),F=(0,rt.useMediaQuery)(w.breakpoints.down("md"));function C(){return(0,e.jsx)(j(),{variant:"h6",className:"rustic-sound-title",children:t.title})}function N(){if(t.captions&&t.captions.length>0){var r=o?"captionsOff":"captionsOn";return(0,e.jsx)(st,{action:r,onClick:function(){return s(!o)}})}}function T(){if(k.current)return(0,e.jsxs)(S.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(ft,{mediaElement:k.current,movement:"replay"}),(0,e.jsx)(pt,{mediaElement:k.current,onError:y}),(0,e.jsx)(ft,{mediaElement:k.current,movement:"forward"})]})}function O(){if(t.transcript&&n)return(0,e.jsx)(gt,{transcript:t.transcript})}function P(){if(t.transcript)return(0,e.jsx)(dt,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}function D(){return(0,e.jsx)("video",{src:t.src,ref:k,className:o?"rustic-has-captions":"",children:o&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})})}(0,p.useEffect)((function(){var e,t,r,n;function i(e){v(e)}null===(e=k.current)||void 0===e||e.addEventListener("timeupdate",(function(){k.current&&f(k.current.currentTime)})),null===(t=k.current)||void 0===t||t.addEventListener("canplay",(function(){v(""),u(!1)})),null===(r=k.current)||void 0===r||r.addEventListener("error",(function(){return i("Failed to load the audio.")})),null===(n=k.current)||void 0===n||n.addEventListener("stalled",(function(){return i("Failed to fetch audio data, but trying.")}))}),[]);var M=F?function(){if(k.current)return(0,e.jsxs)(S.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(ht,{elapsedTimeInSeconds:m,durationTimeInSeconds:k.current.duration,style:"wide"}),(0,e.jsx)(lt,{mediaElement:k.current}),C(),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsx)(S.Box,{className:"rustic-sound-bottom-controls-left",children:T()}),(0,e.jsx)(ut,{mediaElement:k.current}),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls-right",children:[P(),(0,e.jsxs)(S.Box,{children:[N(),(0,e.jsx)(mt,{mediaElement:k.current})]})]})]}),O()]})}:function(){if(k.current)return(0,e.jsxs)(e.Fragment,{children:[C(),(0,e.jsxs)(S.Box,{className:"rustic-sound-controls",children:[(0,e.jsx)(lt,{mediaElement:k.current}),(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-sound-bottom-controls-left",children:[T(),N(),(0,e.jsx)(mt,{mediaElement:k.current}),(0,e.jsx)(ut,{mediaElement:k.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:m,durationTimeInSeconds:k.current.duration,style:"condensed"})]}),(0,e.jsx)(S.Box,{className:"rustic-sound-bottom-controls-right",children:P()})]}),O()]})]})};return x.length>0?(0,e.jsx)(Ie(),{severity:"error",children:x}):l?(0,e.jsxs)(S.Box,{className:"rustic-sound",children:[D(),(0,e.jsx)(E(),{})]}):(0,e.jsxs)(S.Box,{className:"rustic-sound",children:[D(),M(),b.length>0&&(0,e.jsx)(Ie(),{severity:"error",className:"rustic-control-error",onClose:function(){return y("")},children:b})]})}function yt(t){var r=(0,p.useState)(!!document.pictureInPictureElement),n=r[0],i=r[1],a=t.mediaElement,o=n?"miniPlayerExit":"miniPlayer";return a.onleavepictureinpicture=function(){i(!1)},(0,e.jsx)(st,{onClick:function(){n?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit mini player. Error: ".concat(e.message))})):a.requestPictureInPicture().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter mini player. Error: ".concat(e.message))}))},action:o})}function jt(t){var r=(0,p.useState)(!!document.fullscreenElement),n=r[0],i=r[1],a=t.element,o=n?"fullscreenExit":"fullscreen";return a.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,e.jsx)(st,{onClick:function(){n?document.exitFullscreen().then((function(){i(!1)})).catch((function(e){t.onError("Failed to exit fullscreen mode. Error: ".concat(e.message))})):a.requestFullscreen().then((function(){i(!0)})).catch((function(e){t.onError("Failed to enter fullscreen mode. Error: ".concat(e.message))}))},action:o})}function St(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!0),l=c[0],u=c[1],d=(0,p.useState)(!!document.fullscreenElement),m=d[0],f=d[1],h=(0,p.useState)(!1),x=h[0],v=h[1],g=(0,p.useState)(""),b=g[0],y=g[1],w=(0,p.useState)(""),k=w[0],F=w[1],C=(0,p.useState)(0),N=C[0],T=C[1],O=(0,p.useRef)(null),P=(0,p.useRef)(null),D=(0,rt.useTheme)(),M=(0,rt.useMediaQuery)(D.breakpoints.down("md"));(0,p.useEffect)((function(){var e,t,r,n,i,a,o,s;function c(e){F(e),u(!1)}function l(){clearTimeout(s),s=setTimeout((function(){return v(!1)}),3e3)}null===(e=P.current)||void 0===e||e.addEventListener("timeupdate",(function(){P.current&&T(P.current.currentTime)})),null===(t=P.current)||void 0===t||t.addEventListener("canplay",(function(){F(""),u(!1)})),null===(r=P.current)||void 0===r||r.addEventListener("error",(function(){return c("Failed to load the video.")})),null===(n=P.current)||void 0===n||n.addEventListener("stalled",(function(){return c("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){f(!!document.fullscreenElement)})),null===(i=O.current)||void 0===i||i.addEventListener("mousemove",(function(){v(!0),l()})),null===(a=O.current)||void 0===a||a.addEventListener("mouseleave",(function(){v(!1)})),null===(o=O.current)||void 0===o||o.addEventListener("keydown",(function(){v(!0),l()}))}),[]);var R={backgroundColor:D.palette.background.paper,opacity:x?1:0};function q(){if(t.transcript&&n)return(0,e.jsx)(gt,{transcript:t.transcript})}function z(){if(t.captions&&t.captions.length>0){var r=o?"captionsOff":"captionsOn";return(0,e.jsx)(st,{action:r,onClick:function(){return s(!o)}})}}function I(){if(t.transcript)return(0,e.jsx)(dt,{isTranscriptVisible:n,setIsTranscriptVisible:function(){return i(!n)}})}var L=M?function(){return m?(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls",sx:R,children:[(0,e.jsxs)(S.Box,{className:"rustic-video-top-controls",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsx)(lt,{mediaElement:P.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:N,durationTimeInSeconds:P.current.duration})]}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-time-controls",children:[(0,e.jsx)(ft,{mediaElement:P.current,movement:"replay"}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"forward"}),z(),(0,e.jsx)(mt,{mediaElement:P.current})]}),I()]}),q()]})}):(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsxs)(S.Box,{className:"rustic-video-controls-right",children:[I(),(0,e.jsx)(jt,{element:O.current,onError:y})]})]})})}:function(){return(0,e.jsx)(e.Fragment,{children:P.current&&O.current&&(0,e.jsxs)(S.Box,{className:"rustic-video-controls",sx:R,children:[(0,e.jsx)(lt,{mediaElement:P.current}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls",children:[(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls-left",children:[(0,e.jsx)(pt,{mediaElement:P.current,onError:y}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"replay"}),(0,e.jsx)(ft,{mediaElement:P.current,movement:"forward"}),z(),(0,e.jsx)(mt,{mediaElement:P.current}),(0,e.jsx)(ut,{mediaElement:P.current}),(0,e.jsx)(ht,{elapsedTimeInSeconds:N,durationTimeInSeconds:P.current.duration,style:"condensed"})]}),(0,e.jsxs)(S.Box,{className:"rustic-video-bottom-controls-right",children:[I(),(0,e.jsx)(yt,{mediaElement:P.current,onError:y}),(0,e.jsx)(jt,{element:O.current,onError:y})]})]}),m&&q()]})})};return k.length>0?(0,e.jsx)(Ie(),{severity:"error",children:k}):(0,e.jsxs)(S.Box,{className:"rustic-video",children:[l&&(0,e.jsx)(E(),{className:"rustic-video-loading-spinner"}),(0,e.jsxs)(S.Box,{ref:O,className:"rustic-video-screen",sx:{visibility:l?"hidden":"visible"},children:[b.length>0&&(0,e.jsx)(Ie(),{severity:"error",className:"rustic-control-error",onClose:function(){return y("")},children:b}),(!M||m)&&function(){if(P.current&&O.current)return(0,e.jsxs)(S.Box,{className:"rustic-video-title",sx:R,children:[(0,e.jsx)(j(),{variant:"body2",children:t.title}),m&&M&&(0,e.jsxs)(S.Box,{children:[(0,e.jsx)(yt,{mediaElement:P.current,onError:y}),(0,e.jsx)(jt,{element:O.current,onError:y})]})]})}(),(0,e.jsx)("video",{className:"rustic-video-element",ref:P,src:t.src,poster:t.poster,children:o&&(0,e.jsx)("track",{src:t.captions,kind:"captions",default:!0})}),L()]}),!m&&q()]})}const wt=require("@mui/material/Drawer");var kt=i.n(wt);const Ft=require("@mui/material/ListItemText");var Ct=i.n(Ft);const Et=require("@mui/material/Menu");var Nt=i.n(Et),Tt=function(){return Tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Tt.apply(this,arguments)};function Ot(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useRef)(null),o=(0,l.useTheme)(),s=(0,rt.useMediaQuery)(o.breakpoints.down("md")),c=s?kt():Nt(),u={borderRadius:"".concat(o.shape.borderRadius,"px"),border:"1px solid ".concat(o.palette.divider)};function d(t){return(0,e.jsxs)(e.Fragment,{children:[t.startDecorator&&(0,e.jsx)(S.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:t.startDecorator}),(0,e.jsx)(Ct(),{children:(0,e.jsx)(j(),{variant:"body2",children:t.label})}),t.endDecorator&&(0,e.jsx)(S.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:t.endDecorator})]})}s&&(u=Tt(Tt({},u),{borderRadius:"".concat(o.shape.borderRadius,"px ").concat(o.shape.borderRadius,"px 0 0"),borderBottom:0}));var m=t.menuItems.map((function(t){return t.href?(0,e.jsx)(G(),{component:"a",onClick:function(){return i(!1)},href:t.href,download:t.downloadFileName||t.isFiledownload,children:d(t)},t.label):(0,e.jsx)(G(),{onClick:function(e){t.onClick&&t.onClick(e),i(!1)},disabled:!t.onClick,children:d(t)},t.label)}));var f,h,x=s?{}:{anchorEl:a.current};return(0,e.jsxs)(e.Fragment,{children:[(f={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":t.ariaLabel,ref:a,className:"rustic-popover-menu-button"},h=(0,e.jsx)(re,{name:"more_vert"}),t.buttonText?(0,e.jsx)(it(),Tt({},f,{startIcon:t.icon?t.icon:null,children:t.buttonText})):(0,e.jsx)(ee(),{title:t.ariaLabel,children:(0,e.jsx)(H(),Tt({},f,{children:t.icon?t.icon:h}))})),(0,e.jsx)(c,Tt({open:n,onClose:function(){return i(!1)}},x,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Tt(Tt({},u),{backgroundImage:"none",boxShadow:o.shadows[2]})},children:m}))]})}var Pt=i(986);function Dt(t){var r=(0,p.useState)("Copy text"),n=r[0],i=r[1];return(0,e.jsx)(Pt.default,{message:t.message,icon:(0,e.jsx)(re,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){i("Copied"),setTimeout((function(){i("Copy text")}),2e3)})).catch((function(){i("Failed to copy")}))},label:n})}function Mt(t){var r=(0,p.useState)("Start reading aloud"),n=r[0],i=r[1],a=[t.message.data.title,t.message.data.description,t.message.data.alt,t.message.data.text,t.message.data.transcript].filter(Boolean).join(" "),o=new SpeechSynthesisUtterance(a);return(0,e.jsx)(Pt.default,{message:t.message,icon:(0,e.jsx)(re,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),i("Start reading aloud")):(o.onend=function(){i("Start reading aloud")},window.speechSynthesis.speak(o),i("Stop reading aloud"))},label:n})}const Rt=require("@mui/material/Stack");var qt=i.n(Rt);const zt=function(t){return(0,e.jsx)(j(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(r=t.timestamp,P(r)<86400?function(e){var t=P(e);if(t<60)return"".concat(T()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(T()("minute",r,!0)," ago")}var n=Math.floor(t/3600);return"".concat(T()("hour",n,!0)," ago")}(r):(n=new Date(r),i=navigator.language,a={month:"short",day:"numeric"},o=new Date,c=(s=n.getFullYear()!==o.getFullYear())?" at ":", ",s&&(a.year="numeric"),n.toLocaleDateString(i,a)+c+n.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})))});var r,n,i,a,o,s,c},It=(0,p.forwardRef)((function(t,r){var n=(0,rt.useTheme)();return(0,e.jsxs)(qt(),{id:t.message.id,className:"rustic-message-canvas",ref:r,children:[(0,e.jsxs)(qt(),{direction:"row",alignItems:"center",spacing:1,children:[t.getProfileComponent&&t.getProfileComponent(t.message),(0,e.jsx)(zt,{timestamp:t.message.timestamp})]}),t.getActionsComponent&&t.getActionsComponent(t.message)&&(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:t.getActionsComponent(t.message)}),(0,e.jsx)(fe(),{variant:"outlined",className:"rustic-message-container",children:t.children})]})})),Lt=require("@mui/material/Chip");var Bt=i.n(Lt);const _t=require("@mui/system/Box");var At=i.n(_t),Ht=function(){return Ht=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ht.apply(this,arguments)};function Wt(e,t){var r=t.format.includes("update")?t.threadId:t.id;if(r){var n=Ht({},e),i=(e[r]||[])[0];return t.format.includes("update")&&i&&i.sender.id!==t.sender.id&&(r=t.id),n[r]||(n[r]=[]),n[r]=n[r].concat(t),n}return e}function Vt(t){var r,n,i,a=(0,p.useRef)(null),o=(0,p.useRef)(null),s=(0,p.useRef)(),c=(0,p.useState)(!0),l=c[0],u=c[1],d=(0,p.useState)(!0),m=d[0],f=d[1],h=(0,p.useState)(!1),x=h[0],v=h[1],g=(0,p.useState)({}),b=g[0],y=g[1],j=Object.keys(b).length,S=(n=j,i=(0,p.useRef)(0),(0,p.useEffect)((function(){i.current=n})),i.current),w=2e3;function k(){f(!0),s.current&&clearTimeout(s.current),s.current=setTimeout((function(){f(!1)}),w)}function C(){var e=o.current,t=a.current;if(e&&t){var r=e.getBoundingClientRect().bottom,n=t.getBoundingClientRect().bottom;u(n-1<=r)}}function E(){if(function(){var e,t=null===(e=o.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}()){var e=o.current;v(!0),e&&setTimeout((function(){k(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(E,1)}function N(e){y((function(t){return Wt(t,e)}))}return(0,p.useEffect)((function(){var e=o.current;if(C(),e)return e.addEventListener("scroll",C),window.addEventListener("resize",C),function(){e.removeEventListener("scroll",C),window.removeEventListener("resize",C)}}),[l]),(0,p.useEffect)((function(){E()}),[x]),(0,p.useEffect)((function(){l&&0!==S&&j>S&&(k(),E())}),[l,Object.keys(b).length]),(0,p.useEffect)((function(){var e,r={};null===(e=t.receivedMessages)||void 0===e||e.forEach((function(e){var t=Wt(r,e);r=t})),y(r)}),[null===(r=t.receivedMessages)||void 0===r?void 0:r.length]),(0,p.useEffect)((function(){t.ws.onReceive&&t.ws.onReceive(N)}),[]),(0,e.jsxs)(At(),{ref:o,className:"rustic-message-space",children:[Object.keys(b).map((function(r,n){var i=b[r],o=i[i.length-1];return(0,e.jsx)(It,{message:o,getActionsComponent:t.getActionsComponent,getProfileComponent:t.getProfileComponent,ref:n===j-1?a:null,children:(0,e.jsx)(F,{ws:t.ws,sender:t.sender,messages:i,supportedElements:t.supportedElements})},r)})),!l&&!m&&(0,e.jsx)(Bt(),{variant:"rusticSecondary",className:"rustic-scroll-down-button",size:"medium",onClick:E,label:(0,e.jsxs)(e.Fragment,{children:[t.scrollDownLabel,(0,e.jsx)(re,{name:"arrow_downward"})]})})]})}Vt.defaultProps={scrollDownLabel:"Scroll down"};const Ut=function(t){return(0,e.jsx)(j(),{variant:"body2",className:"rustic-text",children:$e().sanitize(t.text)})};function Gt(t){return(0,e.jsxs)(At(),{className:"rustic-multipart",children:[t.text&&(0,e.jsx)(Ut,{text:t.text}),(r=t.files.map((function(t,r){return(0,e.jsx)(Fe,{file:t,children:t.url&&(0,e.jsx)(ee(),{title:"Download",children:(0,e.jsx)(H(),{component:"a",href:t.url,download:t.name,children:(0,e.jsx)(re,{name:"download"})})})},r)})),(0,e.jsx)(At(),{className:"rustic-files",children:r}))]});var r}const Kt=require("@mui/material/Dialog");var Qt=i.n(Kt);const Yt=require("@mui/material/DialogTitle");var Xt=i.n(Yt);const $t=require("@mui/material/List");var Zt=i.n($t);const Jt=require("@mui/material/ListItem");var er=i.n(Jt);const tr=require("@mui/material/ListSubheader");var rr,nr,ir=i.n(tr);function ar(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=t.participants.length,o=n?t.participants:t.participants.slice(0,3),s="".concat(T()(t.participantType,a)," (").concat(a,")"),c=n?"Show Less":"Show All ".concat(a);return 0===a?(0,e.jsx)(j(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,e.jsx)(Zt(),{className:"rustic-participant-list",subheader:(0,e.jsxs)(ir(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,e.jsxs)(S.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,e.jsx)(j(),{variant:"subtitle2",color:"text.secondary",children:s})]}),a>3&&(0,e.jsx)(it(),{onClick:function(){return i(!n)},color:"primary",size:"small",startIcon:(0,e.jsx)(re,{name:"keyboard_arrow_down"}),children:c})]}),children:o.map((function(t){return(0,e.jsxs)(er(),{className:"rustic-participant-list-item",children:[(0,e.jsx)(j(),{variant:"subtitle2",children:t.displayName}),(0,e.jsx)(j(),{variant:t.participantRole===rr.Owner?"subtitle2":"caption",children:M(t.participantRole)})]},t.id)}))})}!function(e){e.Owner="owner",e.Member="member"}(rr||(rr={})),function(e){e.Human="human",e.Agent="agent"}(nr||(nr={}));const or=function(t){function r(e,t){return function(e){return function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e,!0).sort((function(e,t){return t.participantRole===rr.Owner?1:-1}))}(e.filter((function(e){return e.participantType===t})))}var n=r(t.participants,nr.Human),i=r(t.participants,nr.Agent),a="".concat(T()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,e.jsxs)(Qt(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,e.jsx)(Xt(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:a}),(0,e.jsx)(ar,{participantType:"Human",participantTypeIcon:(0,e.jsx)(re,{name:"account_circle"}),participants:n}),i.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(vt(),{className:"rustic-participants-container-divider"}),(0,e.jsx)(ar,{participantType:"Agent",participantTypeIcon:(0,e.jsx)(re,{name:"smart_toy"}),participants:i})]})]})},sr=require("@mui/material/DialogActions");var cr=i.n(sr);const lr=require("@mui/material/DialogContent");var ur=i.n(lr);const dr=require("@mui/material/DialogContentText");var pr=i.n(dr),mr=function(){return mr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mr.apply(this,arguments)},fr=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function hr(t){var r=(0,p.useState)(!1),n=r[0],i=r[1],a=(0,p.useState)(!1),o=a[0],s=a[1],c=(0,p.useState)(!1),l=c[0],u=c[1],d=(0,p.useState)(!1),m=d[0],f=d[1],h=(0,p.useState)([]),x=h[0],v=h[1],g=(0,p.useState)(null),b=g[0],y=g[1],w=(0,S.useTheme)(),k=x[x.length-1],C=mr(mr({},t.ws),{send:function(e){y(e)}});function N(e){v((function(t){return fr(fr([],t,!0),[e],!1)}))}function T(){if(b){var e=mr(mr({},b),{threadId:t.messageId});t.ws.send(e)}}if((0,p.useEffect)((function(){t.ws.onReceive&&t.ws.onReceive(N)}),[t.ws]),(0,p.useEffect)((function(){x.length>0&&(k&&k.sender.id!==t.sender.id&&s(!1),"promptBuilder"===k.format&&k.data.isLastQuestion&&i(!0))}),[x.length]),0!==x.length)return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,e.jsxs)(Qt(),{open:l,onClose:function(){return u(!1)},"aria-labelledby":"quit-dialog-title","aria-describedby":"quit-dialog-description",sx:{"& .MuiPaper-root":{width:"clamp(320px,50vw,600px)",border:"1px solid ".concat(w.palette.divider)}},children:[(0,e.jsx)(Xt(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,e.jsx)(vt(),{}),(0,e.jsx)(ur(),{children:(0,e.jsx)(pr(),{id:"quit-dialog-description",className:"rustic-align-self-center",children:"All progress will be lost."})}),(0,e.jsxs)(cr(),{className:"rustic-prompt-builder-dialog-buttons",disableSpacing:!0,children:[(0,e.jsx)(it(),{variant:"rusticSecondary",startIcon:(0,e.jsx)(re,{name:"close"}),onClick:function(){u(!1),t.onCancel()},children:"Quit"}),(0,e.jsx)(it(),{variant:"rusticPrimary",onClick:function(){return u(!1)},children:"Continue build"})]})]}),t.getProfileComponent?t.getProfileComponent(x[0]):(0,e.jsx)(j(),{color:"text.secondary",children:"Prompt Builder"}),(0,e.jsx)(vt(),{className:"rustic-prompt-builder-divider"}),(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!m&&x.length>0)return x.map((function(r){if(r.sender.id!==t.sender.id&&"promptBuilder"!==r.format)return(0,e.jsx)(F,{ws:C,sender:t.sender,messages:[r],supportedElements:t.supportedElements},r.id)}))}(),o&&(0,e.jsx)(E(),{color:"secondary",className:"rustic-align-self-center"})]}),(0,e.jsx)(e.Fragment,{children:!m&&(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons",children:[(0,e.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons-left",children:[(0,e.jsx)(it(),{variant:"rusticSecondary",startIcon:(0,e.jsx)(re,{name:"close"}),onClick:function(){return u(!0)},children:"Quit"}),(0,e.jsx)(it(),{variant:"rusticSecondary",endIcon:(0,e.jsx)(re,{name:"chevron_right"}),onClick:function(){T(),y(null),s(!0)},disabled:!b,"aria-disabled":!b,children:"Next question"})]}),n&&(0,e.jsx)(S.Box,{className:"rustic-prompt-builder-buttons-right",children:(0,e.jsx)(it(),{variant:"rusticPrimary",onClick:function(){T(),f(!0),s(!0),t.onSubmit()},disabled:o,"aria-disabled":o,children:"Generate"})})]})})]})}function xr(t){var r=(0,p.useState)(""),n=r[0],i=r[1],a=(0,rt.useTheme)(),o=(0,rt.useMediaQuery)(a.breakpoints.down("md"))?"column":"row",s=t.options.map((function(r,a){return(0,e.jsx)(Bt(),{onClick:function(){return function(e){i(e);var r=(new Date).toISOString(),n={id:(0,_.v4)(),timestamp:r,sender:t.sender,conversationId:t.conversationId,format:"text",data:{text:e},inReplyTo:t.messageId};t.ws.send(n)}(r)},variant:"rusticSecondary",size:"small",sx:n===r?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!n,"aria-disabled":!!n,label:r},a)}));return(0,e.jsxs)(c(),{className:"rustic-question",children:[(t.title||t.description)&&(0,e.jsxs)(c(),{className:"rustic-question-text",children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",className:"rustic-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",children:t.description})]}),(0,e.jsx)(qt(),{direction:o,className:"rustic-options-container",children:s})]})}const vr=require("@mui/material/Table");var gr=i.n(vr);const br=require("@mui/material/TableBody");var yr=i.n(br);const jr=require("@mui/material/TableCell");var Sr=i.n(jr);const wr=require("@mui/material/TableContainer");var kr=i.n(wr);const Fr=require("@mui/material/TableHead");var Cr=i.n(Fr);const Er=require("@mui/material/TablePagination");var Nr=i.n(Er);const Tr=require("@mui/material/TableRow");var Or=i.n(Tr);const Pr=require("@mui/material/TableSortLabel");var Dr,Mr=i.n(Pr),Rr=10;function qr(){return(0,e.jsx)(re,{name:"expand_all"})}function zr(t){if(0===t.data.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available"});var r,n,i,a=t.data.length>Rr,o=(0,p.useState)({}),s=o[0],c=o[1],l=(0,p.useState)(a?Rr:-1),u=l[0],d=l[1],m=(0,p.useState)(0),f=m[0],h=m[1],x=(0,rt.useTheme)(),v=Array.from(new Set(t.data.flatMap((function(e){return Object.keys(e)})))),g=t.headers||v.map((function(e){return{dataKey:e}})),b=(r=t.data,n=Object.keys(s)[0],i=s[n],n&&i?r.slice().sort((function(e,t){var r=Object.keys(s)[0],n=s[r];return e[r]<t[r]?n===Dr.Descending?1:-1:e[r]>t[r]?n===Dr.Descending?-1:1:0})):r),y=b.slice(f*u,f*u+u),S=u>0?y:b;function w(e){if(!s[e])return qr}return(0,e.jsxs)(qt(),{className:"rustic-table",spacing:1,children:[t.title&&(0,e.jsx)(j(),{variant:"h6",className:"rustic-table-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsx)(kr(),{className:"rustic-table-container",children:(0,e.jsxs)(gr(),{"aria-label":t.title||"a table of data",size:"small",stickyHeader:!0,children:[g.length>0&&(0,e.jsx)(Cr(),{children:(0,e.jsx)(Or(),{children:g.map((function(t,r){return(0,e.jsx)(Sr(),{sortDirection:s[t.dataKey]||!1,children:(0,e.jsx)(ee(),{title:(n=t.dataKey,i=s[n],i?Object.keys(Dr)[Object.values(Dr).indexOf(i)]:"Sort"),children:(0,e.jsx)(Mr(),{active:!0,direction:s[t.dataKey],onClick:function(){return function(e){c((function(t){var r,n,i={};switch(t[e]){case Dr.Ascending:(r={})[e]=Dr.Descending,i=r;break;case Dr.Descending:i={};break;default:(n={})[e]=Dr.Ascending,i=n}return i}))}(t.dataKey)},className:"rustic-table-header",IconComponent:w(t.dataKey),children:t.label||M(t.dataKey)})})},"header-".concat(r));var n,i}))})}),(0,e.jsx)(yr(),{children:S.map((function(t,r){return(0,e.jsx)(Or(),{children:g.map((function(n,i){return(0,e.jsx)(Sr(),{children:t[n.dataKey]},"cell-".concat(r,"-").concat(i))}))},"row-".concat(r))}))})]})}),a&&(0,e.jsx)(Nr(),{className:"rustic-table-pagination",component:"div",count:t.data.length,rowsPerPage:u,labelRowsPerPage:"Rows:",page:f,onPageChange:function(e,t){return h(t)},onRowsPerPageChange:function(e){d(+e.target.value),h(0)},sx:{"& .MuiTablePagination-selectLabel":{color:x.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})}!function(e){e.Ascending="asc",e.Descending="desc"}(Dr||(Dr={}));const Ir=function(t){var r=(0,p.useState)($e().sanitize(t.text)),n=r[0],i=r[1],a=(0,p.useState)(""),o=a[0],s=a[1];return(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){for(var e=t.text,r=0,n=t.updatedData;r<n.length;r++){var a=n[r];"string"!=typeof a.text&&(e+=" [MISSING TEXT]",s("Some of the incoming text was not correctly formatted. Some data may be missing.")),e+=a.text}i($e().sanitize(e))}}),[t.text,t.updatedData]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j(),{variant:"body2",children:n}),o&&(0,e.jsx)(Ie(),{severity:"error",children:o})]})};var Lr=function(){return Lr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lr.apply(this,arguments)};function Br(t){var r=$e().sanitize(t.youtubeVideoId);return(0,e.jsx)("iframe",Lr({},z(t.width,t.height),{src:"https://www.youtube.com/embed/".concat(r),title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}Br.defaultProps={title:"Embedded video"};const _r=require("@mui/material/FormControl");var Ar=i.n(_r);const Hr=require("recharts");var Wr=function(){return Wr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wr.apply(this,arguments)},Vr={line:Hr.LineChart,bar:Hr.BarChart,area:Hr.AreaChart};function Ur(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function Gr(t){var r=(0,p.useState)(t.defaultChartType||"line"),n=r[0],i=r[1],a=(0,p.useState)(null),o=a[0],s=a[1],c=(0,p.useState)(t.timeSeries),l=c[0],u=c[1],d=ye()(),m=l.length>0?Object.keys(l[0]):[],f=m[0],h=m.slice(1),x=(0,p.useState)(Ur(h)),v=x[0],g=x[1];(0,p.useEffect)((function(){if(t.updatedData&&t.updatedData.length>0){var e=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],t.timeSeries,!0);t.updatedData.forEach((function(t){e=e.concat(t.timeSeries),u(e)}))}}),[t.timeSeries,t.updatedData]);var b=Vr[n];function y(e){o?s(null):e&&s(e.currentTarget)}function S(e,r){return v[e]?t.chartColors[r%t.chartColors.length]:"grey"}function w(e){return v[e]?"none":"line-through"}if(0===l.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available"});var k,F,C,E,N=t.timeSeries[t.timeSeries.length-1],T=(k=t.timeSeries[0][f],F=N[f],C=new Date(k),E=new Date(F),Math.round(Math.abs((E.getTime()-C.getTime())/864e5)));return(0,e.jsxs)(At(),{className:"rustic-recharts-time-series",children:[!t.disableChartTypeToggle&&(0,e.jsxs)(Ar(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,e.jsx)(H(),{"aria-label":"chart options","aria-expanded":Boolean(o),"aria-haspopup":"true",onClick:y,color:"primary",children:(0,e.jsx)(re,{name:"more_vert"})}),(0,e.jsxs)(Nt(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:o,open:Boolean(o),onClose:function(e){return y(e)},children:[(0,e.jsx)(j(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(Vr).map((function(t){return(0,e.jsxs)(G(),{value:t,selected:t===n,onClick:function(){return function(e){i(e),y()}(t)},children:[t.charAt(0).toUpperCase()+t.slice(1)," ","Chart"]},t)}))]})]}),(0,e.jsxs)(At(),{children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",className:"rustic-recharts-time-series-description",children:t.description}),(0,e.jsx)(Hr.ResponsiveContainer,{aspect:t.aspectRatio,width:t.width,maxHeight:t.maxHeight,minWidth:t.minChartWidth,children:(0,e.jsxs)(b,{data:l,margin:t.chartContainerMargin,children:[(0,e.jsx)(Hr.XAxis,{dataKey:f,tickFormatter:function(e){return R(e,T)},stroke:d.palette.text.primary}),(0,e.jsx)(Hr.YAxis,{domain:["auto","auto"],width:t.yAxisLabelWidth,tickFormatter:t.yAxisTickFormatter,stroke:d.palette.text.primary}),(0,e.jsx)(Hr.Tooltip,{labelFormatter:function(e){return[R(e,T)]},formatter:t.tooltipFormatter,contentStyle:{color:d.palette.common.black}}),(0,e.jsx)(Hr.Legend,{content:function(){return(0,e.jsx)(At(),{className:"rustic-recharts-time-series-legend",children:h.map((function(t,r){return(0,e.jsxs)(At(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=v[e]&&!h.find((function(t){return t!==e&&v[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(v)){for(var n={},i=0,a=h;i<a.length;i++){var o=a[i],s=o===e;n[o]=s}g(n)}else g(r?Ur(h):Wr(Wr({},v),((t={})[e]=!v[e],t)))}(t)},sx:{color:S(t,r)},children:[(0,e.jsx)(re,{name:"crop_16_9"}),(0,e.jsx)(j(),{variant:"body2",display:"inline",sx:{textDecorationLine:w(t)},children:t})]},r)}))})}}),h.map((function(r,i){return v[r]?function(r,i){var a=i%t.chartColors.length,o=v[r]?t.chartColors[a]:"transparent",s={onClick:t.onClick,cursor:"pointer"};switch(n){case"line":return(0,e.jsx)(Hr.Line,{type:"monotone",isAnimationActive:!1,dataKey:r,name:r,dot:!1,stroke:o,activeDot:t.onClick&&s},r);case"bar":return(0,e.jsx)(Hr.Bar,{dataKey:r,fill:o,onClick:t.onClick&&s.onClick,cursor:t.onClick&&s.cursor},r);case"area":return(0,e.jsxs)(p.Fragment,{children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"color".concat(r),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,e.jsx)("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),(0,e.jsx)("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),(0,e.jsx)(Hr.Area,{isAnimationActive:!1,dataKey:r,type:"monotone",stroke:o,fillOpacity:1,fill:"url(#color".concat(r,")"),activeDot:t.onClick&&s},r)]},r)}}(r,i):null})),t.referenceLineYAxis&&t.referenceLineYAxis.map((function(r,n){return(0,e.jsx)(Hr.ReferenceLine,{y:r,label:t.referenceLineLabel&&t.referenceLineLabel[n],stroke:t.referenceLineColor&&t.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:t.referenceLineStrokeWidth&&t.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}Gr.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const Kr=Gr,Qr=require("mermaid");var Yr=i.n(Qr),Xr=function(){return Xr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Xr.apply(this,arguments)};const $r=function(t){var r=(0,p.useRef)(null),n=(0,p.useState)(),i=n[0],a=n[1],o=ye()(),s=(0,_.v4)();return(0,p.useEffect)((function(){var e="dark"===o.palette.mode?"dark":"neutral",n=o.typography.fontFamily;r.current&&(Yr().initialize(Xr({theme:e,themeVariables:{fontFamily:n}},t.config)),Yr().render("mermaid-svg-".concat(s),t.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),a("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),a("Failed to render the diagram.")})))})),(0,e.jsxs)(qt(),{className:"rustic-mermaid-container",children:[t.title&&(0,e.jsx)(j(),{variant:"subtitle2",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"caption",children:t.description}),(0,e.jsx)("div",{className:"rustic-mermaid",ref:r}),i&&(0,e.jsx)(j(),{variant:"body2",children:i})]})},Zr=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var Jr=i.n(Zr),en=function(){return en=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},en.apply(this,arguments)};function tn(e){return e?e.reduce((function(e,t){var r=t.dataKey,n=t.label;return e[r]=n||r,e}),{}):{}}const rn=function(t){if(0===t.data.length)return(0,e.jsx)(j(),{variant:"body2",children:"No data available."});var r=(0,p.useRef)(null),n=(0,l.useTheme)(),i=(0,p.useState)(!1),a=i[0],o=i[1],s=n.palette.mode,c="dark"===s?"Pro Dark":"Pro Light",u=tn(t.headers),d="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(n.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(n.palette.primary.light," !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ").concat("dark"===s?"dark":"white"," !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n span.button {\n color: ").concat(n.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(n.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(n.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n ");var m,f,h,x,v,g,b,y,S,w=t.config&&(f=(m=t.config).groupBy,h=m.splitBy,x=m.aggregates,v=m.sort,g=m.filter,b=m.columns,y=null==v?void 0:v.map((function(e){return[u[e[0]]||e[0],e[1]]})),S=x&&Object.fromEntries(Object.entries(x).map((function(e){var t=e[0],r=e[1];return[u[t]||t,r]}))),{group_by:null==f?void 0:f.map((function(e){return u[e]||e})),split_by:null==h?void 0:h.map((function(e){return u[e]||e})),aggregates:S,sort:y,filter:g&&function(e){return e.map((function(e){return[u[e[0]]||e[0],e[1],e[e.length-1]]}))}(g),columns:null==b?void 0:b.map((function(e){return u[e]||e}))});return(0,p.useEffect)((function(){Jr().worker().table(function(e,t){var r=tn(t);return e.map((function(e){for(var t={},n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],o=a[0],s=a[1];t[r[o]||o]=[s]}return t}))}(t.data,t.headers)).then((function(e){var n=r.current;n&&n.load(e).then((function(){if(n.restore(en(en({},w),{theme:c,title:t.title,settings:!1})),n.shadowRoot){var e=new CSSStyleSheet;e.replaceSync(d),n.shadowRoot.adoptedStyleSheets.push(e)}})).catch((function(){o(!0)}))})).catch((function(){o(!0)}))}),[t.data,c]),a?(0,e.jsx)(j(),{variant:"body2",children:"Failed to create table from data."}):(0,e.jsxs)(ge(),{direction:"column",className:"rustic-perspective-viz",children:[t.title&&(0,e.jsx)(j(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsx)("perspective-viewer",{ref:r,style:{fontFamily:n.typography.fontFamily}})]})},nn=require("react-dom/server"),an=require("vega-embed");var on=i.n(an),sn=function(){return sn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},sn.apply(this,arguments)};function cn(t){var r=(0,p.useRef)(null),n=(0,p.useState)(!1),i=n[0],a=n[1],o=ye()(),s="dark"===o.palette.mode,c=o.typography.fontFamily,l={backgroundColor:o.palette.primary.main,color:o.palette.background.paper,borderRadius:o.shape.borderRadius+"px",padding:"4px 8px",fontSize:o.typography.caption.fontSize,fontFamily:c,fontWeight:o.typography.caption.fontWeight},u={formatTooltip:function(t,r){return(0,nn.renderToStaticMarkup)((0,e.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:l,children:Object.entries(t).map((function(t){var n=t[0],i=t[1];return(0,e.jsxs)("div",{children:[(0,e.jsxs)("strong",{children:[r(n),":"]})," ",r(i)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},d=[{label:"Save as SVG"},{label:"Save as PNG"}];function m(){var e,n,i,o;if(r.current&&t.spec){var l=sn(sn({config:{font:c}},t.options),{theme:s?null===(e=t.theme)||void 0===e?void 0:e.dark:null===(n=t.theme)||void 0===n?void 0:n.light,tooltip:u,actions:!1});(null===(o=null===(i=t.options)||void 0===i?void 0:i.config)||void 0===o?void 0:o.font)||(l.config.font=c);var p=sn({},t.spec);delete p.title,on()(r.current,p,l).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,i){var a="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,a).then((function(e){d[i].href=e,d[i].downloadFileName="".concat(r,".").concat(n)}))})),a(!1)})).catch((function(){a(!0)}))}}return(0,p.useEffect)((function(){function e(){m()}return m(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[t.spec,s]),i?(0,e.jsx)(j(),{variant:"body2",children:"Failed to load the chart."}):(0,e.jsxs)(ge(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,e.jsx)(At(),{justifyContent:"end",display:"flex",children:(0,e.jsx)(Ot,{menuItems:d,ariaLabel:"Download options"})}),t.title&&(0,e.jsx)(j(),{variant:"h6",children:t.title}),t.description&&(0,e.jsx)(j(),{variant:"body1",children:t.description}),(0,e.jsxs)(At(),{textAlign:"center",mt:1,children:["string"==typeof t.spec.title&&(0,e.jsx)(j(),{variant:"subtitle2",children:t.spec.title}),t.spec.description&&(0,e.jsx)(j(),{variant:"caption",children:t.spec.description})]}),(0,e.jsx)("div",{ref:r,className:"rustic-vega-lite"})]})}const ln=cn;function un(t){var r=(0,p.useState)(t.units),n=r[0],i=r[1];function a(e){return"metric"===t.units&&"imperial"===n?Math.round(1.8*e+32):"imperial"===t.units&&"metric"===n?Math.round(e*(5/9)-32):Math.round(e)}var o=new Date(1e3*t.weather[0].timestamp),s=I(t.weather[0].timestamp).shortName,l=o.getDate(),u=o.getFullYear().toString().slice(2),d="".concat(s," ").concat(l,"/").concat(u," TODAY"),m="HIGH: ".concat(a(t.weather[0].temp.high)," / LOW: ").concat(a(t.weather[0].temp.high)),f=t.weather.map((function(t,r){if(0!==r)return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,e.jsx)(j(),{variant:"h5",component:"span",color:"text.secondary","aria-label":I(t.timestamp).fullName,children:I(t.timestamp).shortName}),(0,e.jsx)("img",{src:t.weatherIcon.icon,alt:t.weatherIcon.description}),(0,e.jsxs)(j(),{variant:"body2",color:"text.secondary",children:["High: ",a(t.temp.high),"°"]}),(0,e.jsxs)(j(),{variant:"body2",color:"text.secondary",children:["Low: ",a(t.temp.low),"°"]})]},r)}));return(0,e.jsxs)(fe(),{variant:"outlined",className:"rustic-weather",children:[(0,e.jsx)(Ot,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,e.jsxs)(qt(),{alignItems:"center",children:[(0,e.jsx)(j(),{variant:"h4",component:"span",children:t.location}),(0,e.jsxs)(qt(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,e.jsx)("img",{src:t.weather[0].weatherIcon.icon,alt:""}),(0,e.jsx)(j(),{variant:"body2",children:t.weather[0].weatherIcon.description})]}),t.weather[0].temp.current&&(0,e.jsxs)(j(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[a(t.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,e.jsxs)(qt(),{direction:"row",spacing:2,children:[(0,e.jsx)(j(),{variant:"overline",children:d}),(0,e.jsx)(j(),{variant:"overline",children:m})]})]}),(0,e.jsx)(c(),{className:"rustic-daily-weather-container",children:f}),t.weatherProvider&&(0,e.jsxs)(qt(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,e.jsx)(re,{name:"cloud"}),(0,e.jsx)(j(),{variant:"body2",children:"Weather data provided by ".concat(t.weatherProvider)})]})]})}cn.defaultProps={theme:{dark:"dark"}};var dn=i(470)})(),a})()));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockWebSocket.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/mockWebSocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,aAAa,CAAA;AAGpD,OAAO,KAAK,EAAW,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAKrE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,QAalB;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAmB5E"}
|