khoj 1.32.3.dev8__py3-none-any.whl → 1.32.3.dev23__py3-none-any.whl

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.
Files changed (93) hide show
  1. khoj/interface/compiled/404/index.html +1 -1
  2. khoj/interface/compiled/_next/static/chunks/1234-5c66c4b4512fbca3.js +20 -0
  3. khoj/interface/compiled/_next/static/chunks/{1915-878efdc6db697d8f.js → 1915-605f698f2573cfd4.js} +1 -1
  4. khoj/interface/compiled/_next/static/chunks/{1662-adf4c615bef2fdc2.js → 2581-455000f8aeb08fc3.js} +1 -1
  5. khoj/interface/compiled/_next/static/chunks/2633-78be7e42aa20a130.js +20 -0
  6. khoj/interface/compiled/_next/static/chunks/{2781-4f022b6e9eb6df6e.js → 3175-b2e522f8ca392f7e.js} +2 -2
  7. khoj/interface/compiled/_next/static/chunks/3789-a09e37a819171a9d.js +1 -0
  8. khoj/interface/compiled/_next/static/chunks/4357-03ea130575287c27.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/4925-f8f9a325afd43638.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/5427-a0a9ec9272c7dc22.js +1 -0
  11. khoj/interface/compiled/_next/static/chunks/{5477-59f257e791e2c0b3.js → 5477-6e377986786baa88.js} +1 -1
  12. khoj/interface/compiled/_next/static/chunks/6471-a53edba7728eff27.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/8055-9c08d578021a0bc3.js +1 -0
  14. khoj/interface/compiled/_next/static/chunks/8667-8d2e60d9a35f6bb5.js +1 -0
  15. khoj/interface/compiled/_next/static/chunks/9259-27d1ff42af9a43e0.js +1 -0
  16. khoj/interface/compiled/_next/static/chunks/9431-810871d753e53c6a.js +1 -0
  17. khoj/interface/compiled/_next/static/chunks/9665-1ab5c8c667b74dca.js +1 -0
  18. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +1 -0
  19. khoj/interface/compiled/_next/static/chunks/app/agents/page-288c0edc461fa5c9.js +1 -0
  20. khoj/interface/compiled/_next/static/chunks/app/automations/{layout-dce809da279a4a8a.js → layout-1fe1537449f43496.js} +1 -1
  21. khoj/interface/compiled/_next/static/chunks/app/automations/page-486b50016a08b4b5.js +1 -0
  22. khoj/interface/compiled/_next/static/chunks/app/chat/layout-01fa675d4d56157c.js +1 -0
  23. khoj/interface/compiled/_next/static/chunks/app/chat/page-acfb668abec2b4c7.js +1 -0
  24. khoj/interface/compiled/_next/static/chunks/app/page-a9d3393760f6081d.js +1 -0
  25. khoj/interface/compiled/_next/static/chunks/app/search/layout-484d34239ed0f2b1.js +1 -0
  26. khoj/interface/compiled/_next/static/chunks/app/search/page-439eb6b3073f3224.js +1 -0
  27. khoj/interface/compiled/_next/static/chunks/app/settings/layout-cfb0ab077038f9b8.js +1 -0
  28. khoj/interface/compiled/_next/static/chunks/app/settings/page-74e7a8877798eb27.js +1 -0
  29. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-b3f7ae1ef8871d30.js +1 -0
  30. khoj/interface/compiled/_next/static/chunks/app/share/chat/page-42623ff6bdbb91d9.js +1 -0
  31. khoj/interface/compiled/_next/static/chunks/{webpack-250671c0bcd4eacb.js → webpack-2a946d6408b83055.js} +1 -1
  32. khoj/interface/compiled/_next/static/css/00f41e24e96391e7.css +1 -0
  33. khoj/interface/compiled/_next/static/css/0f0e5dbeda138161.css +1 -0
  34. khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
  35. khoj/interface/compiled/_next/static/css/6a9a043a6b83c0af.css +1 -0
  36. khoj/interface/compiled/_next/static/css/bb7461ef275b9b8b.css +1 -0
  37. khoj/interface/compiled/_next/static/css/c3acbadc30537d04.css +1 -0
  38. khoj/interface/compiled/_next/static/css/de88e9efc2116161.css +25 -0
  39. khoj/interface/compiled/_next/static/css/e546bf5cc4914244.css +1 -0
  40. khoj/interface/compiled/agents/index.html +1 -1
  41. khoj/interface/compiled/agents/index.txt +2 -2
  42. khoj/interface/compiled/automations/index.html +1 -1
  43. khoj/interface/compiled/automations/index.txt +3 -3
  44. khoj/interface/compiled/chat/index.html +1 -1
  45. khoj/interface/compiled/chat/index.txt +2 -2
  46. khoj/interface/compiled/index.html +1 -1
  47. khoj/interface/compiled/index.txt +2 -2
  48. khoj/interface/compiled/search/index.html +1 -1
  49. khoj/interface/compiled/search/index.txt +2 -2
  50. khoj/interface/compiled/settings/index.html +1 -1
  51. khoj/interface/compiled/settings/index.txt +4 -4
  52. khoj/interface/compiled/share/chat/index.html +1 -1
  53. khoj/interface/compiled/share/chat/index.txt +2 -2
  54. khoj/processor/conversation/openai/utils.py +14 -8
  55. khoj/processor/conversation/utils.py +11 -13
  56. khoj/utils/constants.py +1 -1
  57. {khoj-1.32.3.dev8.dist-info → khoj-1.32.3.dev23.dist-info}/METADATA +1 -1
  58. {khoj-1.32.3.dev8.dist-info → khoj-1.32.3.dev23.dist-info}/RECORD +63 -61
  59. khoj/interface/compiled/_next/static/chunks/1201-aac5b5f9a28edf09.js +0 -1
  60. khoj/interface/compiled/_next/static/chunks/2264-0a1a6264f89f3a66.js +0 -1
  61. khoj/interface/compiled/_next/static/chunks/2813-7ee42798e23243b8.js +0 -1
  62. khoj/interface/compiled/_next/static/chunks/3091-e0ff2288e8a29dd7.js +0 -1
  63. khoj/interface/compiled/_next/static/chunks/5401-9a6734358089a7b3.js +0 -20
  64. khoj/interface/compiled/_next/static/chunks/6589-f806113de469d684.js +0 -1
  65. khoj/interface/compiled/_next/static/chunks/8117-5c85e2f135c99169.js +0 -1
  66. khoj/interface/compiled/_next/static/chunks/8407-49aa838300b78c48.js +0 -1
  67. khoj/interface/compiled/_next/static/chunks/8667-d3e5bc726e4ff4e3.js +0 -1
  68. khoj/interface/compiled/_next/static/chunks/9058-25ef3344805f06ea.js +0 -1
  69. khoj/interface/compiled/_next/static/chunks/9262-24bbca9dab8dd897.js +0 -1
  70. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e49165209d2e406c.js +0 -1
  71. khoj/interface/compiled/_next/static/chunks/app/agents/page-bd7c168e25246bca.js +0 -1
  72. khoj/interface/compiled/_next/static/chunks/app/automations/page-a5365f75f2745bbc.js +0 -1
  73. khoj/interface/compiled/_next/static/chunks/app/chat/layout-d5ae861e1ade9d08.js +0 -1
  74. khoj/interface/compiled/_next/static/chunks/app/chat/page-846cb5c9588aade3.js +0 -1
  75. khoj/interface/compiled/_next/static/chunks/app/page-cd8a655025dd5ec5.js +0 -1
  76. khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js +0 -1
  77. khoj/interface/compiled/_next/static/chunks/app/search/page-dcf49d92a85259b9.js +0 -1
  78. khoj/interface/compiled/_next/static/chunks/app/settings/layout-b3f6bc6f1aa118e0.js +0 -1
  79. khoj/interface/compiled/_next/static/chunks/app/settings/page-53e7ef663da16aff.js +0 -1
  80. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-95998f0bdc22bb13.js +0 -1
  81. khoj/interface/compiled/_next/static/chunks/app/share/chat/page-a6bcbfaf4a37a137.js +0 -1
  82. khoj/interface/compiled/_next/static/css/3cf13271869a4aeb.css +0 -1
  83. khoj/interface/compiled/_next/static/css/3f27c3cf45375eb5.css +0 -1
  84. khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +0 -1
  85. khoj/interface/compiled/_next/static/css/5a400c87d295e68a.css +0 -1
  86. khoj/interface/compiled/_next/static/css/9504108437df6804.css +0 -1
  87. khoj/interface/compiled/_next/static/css/b2dbbd9ab2ab4061.css +0 -25
  88. khoj/interface/compiled/_next/static/css/d89135ea56435f83.css +0 -1
  89. /khoj/interface/compiled/_next/static/{pr4toMMzYgK9XMJiOcRYC → jk7T_qfZU1hdYV-lgkSJT}/_buildManifest.js +0 -0
  90. /khoj/interface/compiled/_next/static/{pr4toMMzYgK9XMJiOcRYC → jk7T_qfZU1hdYV-lgkSJT}/_ssgManifest.js +0 -0
  91. {khoj-1.32.3.dev8.dist-info → khoj-1.32.3.dev23.dist-info}/WHEEL +0 -0
  92. {khoj-1.32.3.dev8.dist-info → khoj-1.32.3.dev23.dist-info}/entry_points.txt +0 -0
  93. {khoj-1.32.3.dev8.dist-info → khoj-1.32.3.dev23.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9262],{9262:function(e,t,s){"use strict";s.d(t,{EY:function(){return es},ks:function(){return ea},bc:function(){return et}});var a=s(57437),r=s(71159),l=s.n(r),n=s(2265),i=s(62869),o=s(52023),c=s(80854),d=s(27909),u=s(63329),h=s(2452),m=s(41317),x=s(86967),f=s(19841),p=s(57757),j=s(75419),g=s(96108),v=s(78299),b=s(87296),N=s(89203),y=s(38513),w=s(64697),_=s(45178),k=s(2049),C=s(70602),z=s(31229),S=s(66070),T=s(26110),I=s(33494),P=s(42225),V=s(84671),O=s(65613),R=s(15681),q=s(29501),A=s(95186),F=s(13590),W=s(76818),B=s(53647),E=s(49027),J=s(962);let M=J.fC,D=J.wy,Z=J.Fw;var X=s(94508),G=s(23518),Y=s(59199),K=s(37099),L=s(32759),Q=s(57054),U=s(97673),$=s(81103);async function H(e,t){let s="/login?next=/agents?agent=".concat(e);if(!t){window.location.href=s;return}let a=await fetch("/api/chat/sessions?agent_slug=".concat(encodeURIComponent(e)),{method:"POST"}),r=await a.json();200==a.status?window.location.href="/chat?conversationId=".concat(r.conversation_id):403==a.status||401==a.status?window.location.href=s:alert("Failed to start chat session")}function ee(e){var t;let s=(null===(t=e.text)||void 0===t?void 0:t.replace(/^\w/,e=>e.toUpperCase()))||"";return(0,a.jsx)($.pn,{children:(0,a.jsxs)($.u,{children:[(0,a.jsx)($._v,{asChild:!0,children:(0,a.jsx)("div",{className:"text-sm",children:e.hoverText||s})}),(0,a.jsx)($.aJ,{className:"cursor-text",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 rounded-full border-accent-500 border p-1.5",children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:e.icon}),s&&s.length>0&&(0,a.jsx)("div",{className:"text-muted-foreground text-sm",children:s})]})})]})})}let et=z.z.object({name:z.z.string({required_error:"Name is required"}).min(1,"Name is required"),persona:z.z.string({required_error:"Personality is required"}).min(1,"Personality is required"),color:z.z.string({required_error:"Color is required"}).min(1,"Color is required"),icon:z.z.string({required_error:"Icon is required"}).min(1,"Icon is required"),privacy_level:z.z.string({required_error:"Privacy level is required"}).min(1,"Privacy level is required"),chat_model:z.z.string({required_error:"Chat model is required"}).min(1,"Chat model is required"),files:z.z.array(z.z.string()).default([]).optional(),input_tools:z.z.array(z.z.string()).default([]).optional(),output_modes:z.z.array(z.z.string()).default([]).optional()});function es(e){var t;let[s,r]=(0,n.useState)(e.agentSlug===e.data.slug),[j,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null),N=(0,a.jsx)(o.H,{}),y="Private agents are only visible to you.";"public"===e.data.privacy_level?(N=(0,a.jsx)(c.T,{}),y="Public agents are visible to everyone."):"protected"===e.data.privacy_level&&(N=(0,a.jsx)(d.M,{}),y="Protected agents are visible to anyone with a direct link.");let w=e.userProfile,_=(0,q.cI)({resolver:(0,F.F)(et),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes}});(0,n.useEffect)(()=>{_.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes})},[e.data]),s&&window.history.pushState({},"Khoj AI - Agent ".concat(e.data.slug),"/agents?agent=".concat(e.data.slug));let k=(0,V.oz)(e.data.color);function C(){return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[e.editCard&&(0,a.jsx)(ee,{icon:N,text:e.data.privacy_level,hoverText:y}),e.data.files&&e.data.files.length>0&&(0,a.jsx)(ee,{icon:(0,a.jsx)(u.f,{}),text:"knowledge",hoverText:"The agent has a custom knowledge base with ".concat(e.data.files.length," documents. It can use them to give you answers.")}),(0,a.jsx)(ee,{icon:(0,a.jsx)(h.a,{}),text:e.data.chat_model,hoverText:"The agent uses the ".concat(e.data.chat_model," model to chat with you.")}),e.data.output_modes.map(t=>(0,a.jsx)(ee,{icon:(0,P.vH)(t),hoverText:"".concat(t,": ").concat(e.outputModeOptions[t])},t)),e.data.input_tools.map(t=>(0,a.jsx)(ee,{icon:(0,P.vH)(t),hoverText:"".concat(t,": ").concat(e.inputToolOptions[t])},t))]})}return(0,a.jsxs)(S.Zb,{className:"shadow-md rounded-xl hover:shadow-lg dark:bg-muted",children:[j&&(0,a.jsx)(I.Z,{loginRedirectMessage:"Sign in to start chatting with ".concat(e.data.name),onOpenChange:g,isMobileWidth:e.isMobileWidth}),(0,a.jsx)(S.Ol,{children:(0,a.jsx)(S.ll,{children:(0,a.jsxs)(T.Vq,{open:s,onOpenChange:()=>{r(!s),window.history.pushState({},"Khoj AI - Agents","/agents")},children:[(0,a.jsx)(T.hg,{className:"focus-visible:outline-none",children:(0,a.jsxs)("div",{className:"flex items-center relative top-2",children:[(0,P.TI)(e.data.icon,e.data.color),e.data.name]})}),(0,a.jsxs)("div",{className:"flex float-right",children:[e.editCard&&(0,a.jsx)("div",{className:"float-right",children:(0,a.jsxs)(Q.J2,{children:[(0,a.jsx)(Q.xo,{children:(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,a.jsx)(m.F,{className:"w-6 h-6 ".concat((0,V.oz)(e.data.color))})})}),(0,a.jsxs)(Q.yk,{className:"w-fit grid p-1",side:"bottom",align:"end",children:[(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"ghost",onClick:()=>r(!0),children:[(0,a.jsx)(x.z,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.editCard&&"private"!==e.data.privacy_level&&(0,a.jsx)(U.Z,{buttonTitle:"Share",title:"Share Agent",description:"Share a link to this agent with others. They'll be able to chat with it, and ask questions to all of its knowledge base.",buttonVariant:"ghost",includeIcon:!0,url:"".concat(window.location.origin,"/agents?agent=").concat(e.data.slug)}),e.data.creator===(null==w?void 0:w.username)&&(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"destructive",onClick:()=>{fetch("/api/agents/".concat(e.data.slug),{method:"DELETE"}).then(()=>{e.setAgentChangeTriggered(!0)})},children:[(0,a.jsx)(f.r,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}),(null===(t=e.showChatButton)||void 0===t||t)&&(0,a.jsx)("div",{className:"float-right ml-2",children:e.userProfile?(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>H(e.data.slug,w),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,V.oz)(e.data.color))})}):(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-14 h-14 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>g(!0),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,V.oz)(e.data.color))})})})]}),e.editCard?(0,a.jsxs)(T.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,a.jsxs)(E.$N,{children:["Edit ",(0,a.jsx)("b",{children:e.data.name})]}),(0,a.jsx)(ea,{form:_,onSubmit:t=>{let s=e.editCard?"PATCH":"POST",a=t;e.editCard&&(a={...t,slug:e.data.slug}),fetch("/api/agents",{method:s,headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(t=>{200===t.status?(_.reset(),r(!1),b(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),_.clearErrors(),e.error&&b(e.error)})}).catch(e=>{console.error("Error:",e),b(e),_.clearErrors()})},create:!1,errors:v,filesOptions:e.filesOptions,modelOptions:e.modelOptions,slug:e.data.slug,inputToolOptions:e.inputToolOptions,isSubscribed:e.isSubscribed,outputModeOptions:e.outputModeOptions})]}):(0,a.jsxs)(T.cZ,{className:"whitespace-pre-line max-h-[80vh] max-w-[90vw] rounded-lg",children:[(0,a.jsx)(T.fK,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,P.TI)(e.data.icon,e.data.color),(0,a.jsx)("p",{className:"font-bold text-lg",children:e.data.name})]})}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-scroll text-neutral-500 dark:text-white",children:e.data.persona}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()}),(0,a.jsx)(T.cN,{children:(0,a.jsxs)(i.z,{className:"pt-6 pb-6 ".concat(k," bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white border-2 border-stone-100 shadow-sm rounded-xl hover:bg-stone-100 dark:hover:bg-neutral-900 dark:border-neutral-700"),onClick:()=>{H(e.data.slug,w),r(!1)},children:[(0,a.jsx)(p.g,{className:"w-6 h-6 m-2 ".concat((0,V.oz)(e.data.color))}),"Start Chatting"]})})]})]})})}),(0,a.jsx)(S.aY,{children:(0,a.jsx)("div",{className:l().agentPersonality,children:(0,a.jsx)("button",{className:"".concat(l().infoButton," text-neutral-500 dark:text-white"),onClick:()=>r(!0),children:(0,a.jsx)("p",{children:e.data.persona})})})}),(0,a.jsx)(S.eW,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()})})]})}function ea(e){let[t,s]=(0,n.useState)(!1),r=(0,P.BI)(),l=V.xF,o=(0,V.oz)(e.form.getValues("color")),[c,d]=(0,n.useState)(!1),[u,h]=(0,n.useState)(null),[m,x]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),[z,S]=(0,n.useState)(0),[T,I]=(0,n.useState)([]),[q,F]=(0,n.useState)([]),[E,J]=(0,n.useState)(0),[U,$]=(0,n.useState)(!1),H=["public","private","protected"],ee=[{fields:[{name:"name",label:"Name"},{name:"persona",label:"Personality"}],label:"Basic Settings"},{fields:[{name:"color",label:"Color"},{name:"icon",label:"Icon"},{name:"chat_model",label:"Chat Model"},{name:"privacy_level",label:"Privacy Level"}],label:"Customization & Access"},{fields:[{name:"files",label:"Knowledge Base"},{name:"input_tools",label:"Input Tools"},{name:"output_modes",label:"Output Modes"}],label:"Advanced Settings"}],es=(0,n.useRef)(null);function ea(e){e.preventDefault(),d(!0)}function er(e){e.preventDefault(),d(!1)}function el(e){e.preventDefault(),d(!1),e.dataTransfer.files&&en(e.dataTransfer.files)}function en(e){(0,Y.ko)(e,h,p,x,I)}function ei(){es&&es.current&&es.current.click()}function eo(e){e.target.files&&en(e.target.files)}(0,n.useEffect)(()=>{if(f||S(0),f){let e=setInterval(()=>{S(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[f]),(0,n.useEffect)(()=>{F(Array.from(new Set([...q,...e.form.getValues("files")||[],...e.filesOptions||[]])))},[]),(0,n.useEffect)(()=>{T.length>0&&(ec(T),F(e=>[...e,...T]))},[T]),(0,n.useEffect)(()=>{e.errors&&s(!1)},[e.errors]);let ec=t=>{for(let s of t){let t=e.form.getValues("files")||[],a=t.includes(s)?t.filter(e=>e!==s):[...t,s];e.form.setValue("files",a)}};if(U)return(0,a.jsx)(K.aR,{open:!0,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Upgrade to Futurist"})}),(0,a.jsxs)(K.yT,{children:["You need to be a Futurist subscriber to create more agents."," ",(0,a.jsx)("a",{href:"/settings",children:"Upgrade now"}),"."]}),(0,a.jsxs)(K.xo,{children:[(0,a.jsx)(K.le,{onClick:()=>{$(!1)},children:"Cancel"}),(0,a.jsx)(K.OL,{onClick:()=>{window.location.href="/settings"},children:"Continue"})]})]})});let ed=t=>{switch(t){case"name":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"name",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-0 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Name"}),(0,a.jsx)(R.pf,{children:"What should this agent be called? Pick something descriptive & memorable."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(A.I,{className:"dark:bg-muted",placeholder:"Biologist",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"chat_model":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"chat_model",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Chat Model"}),(0,a.jsx)(R.pf,{children:e.isSubscribed?(0,a.jsx)("p",{children:"Which chat model would you like to use?"}):(0,a.jsxs)("p",{className:"text-secondary-foreground",children:["Upgrade to the ",(0,a.jsx)("a",{href:"/settings",children:"Futurist plan"})," to access all models."]})}),(0,a.jsxs)(B.Ph,{onValueChange:s.onChange,defaultValue:s.value,disabled:!e.isSubscribed,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.i4,{className:"text-left dark:bg-muted",children:(0,a.jsx)(B.ki,{})})}),(0,a.jsx)(B.Bw,{className:"items-start space-y-1 inline-flex flex-col",children:e.modelOptions.map(e=>(0,a.jsx)(B.Ql,{value:e.name,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e.name})},e.id))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"privacy_level":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"privacy_level",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(R.lX,{children:(0,a.jsx)("div",{children:"Privacy Level"})}),(0,a.jsx)(R.pf,{children:(0,a.jsxs)(Q.J2,{children:[(0,a.jsx)(Q.xo,{asChild:!0,children:(0,a.jsx)(i.z,{variant:"ghost",className:"p-0 h-fit",children:(0,a.jsxs)("span",{className:"items-center flex gap-1 text-sm",children:[(0,a.jsx)(j.k,{className:"inline"}),(0,a.jsx)("p",{className:"text-sm",children:"Learn more"})]})})}),(0,a.jsxs)(Q.yk,{children:[(0,a.jsx)("b",{children:"Private"}),": only visible to you.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Protected"}),": visible to anyone with a link.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Public"}),": visible to everyone.",(0,a.jsx)("br",{}),"All public agents will be reviewed by us before they are launched."]})]})}),(0,a.jsxs)(B.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(B.ki,{placeholder:"private"})})}),(0,a.jsx)(B.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:H.map(e=>(0,a.jsx)(B.Ql,{value:e,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"color":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"color",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-3",children:[(0,a.jsx)(R.lX,{children:"Color"}),(0,a.jsxs)(B.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(B.ki,{placeholder:"Color"})})}),(0,a.jsx)(B.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:l.map(e=>(0,a.jsx)(B.Ql,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(g.C,{className:"w-6 h-6 mr-2 ".concat((0,V.oz)(e)),weight:"fill"}),e]})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"icon":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"icon",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"space-y-3",children:[(0,a.jsx)(R.lX,{children:"Icon"}),(0,a.jsxs)(B.Ph,{onValueChange:s.onChange,defaultValue:s.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(B.ki,{placeholder:"Icon"})})}),(0,a.jsx)(B.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:r.map(t=>(0,a.jsx)(B.Ql,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,P.TI)(t,e.form.getValues("color"),"w-6","h-6"),t]})},t))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"persona":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"persona",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Personality"}),(0,a.jsx)(R.pf,{children:"What is the personality, thought process, or tuning of this agent? Get creative; this is how you can influence the agent constitution."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(W.g,{className:"dark:bg-muted",placeholder:"You are an excellent biologist, at the top of your field in marine biology.",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"files":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"files",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(R.lX,{children:"Knowledge Base"}),(0,a.jsxs)(R.pf,{children:["Which information should be part of its digital brain?"," ",(0,a.jsx)("a",{href:"/settings",children:"Manage data"}),"."]}),(0,a.jsxs)(M,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," files selected"):"Select files"]}),(0,a.jsx)(Z,{children:(0,a.jsxs)(G.mY,{children:[(0,a.jsx)(K.aR,{open:null!==u||null!=m,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Alert"})}),(0,a.jsx)(K.yT,{children:u||m}),(0,a.jsx)(K.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{h(null),x(null),p(!1)},children:"Close"})]})}),(0,a.jsxs)("div",{className:"flex flex-col h-full cursor-pointer",onDragOver:ea,onDragLeave:er,onDrop:el,onClick:ei,children:[(0,a.jsx)("input",{type:"file",multiple:!0,ref:es,style:{display:"none"},onChange:eo}),(0,a.jsx)("div",{className:"flex-none p-4",children:f&&(0,a.jsx)(L.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:z})}),(0,a.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(c?"animate-pulse":""," rounded-lg"),children:(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-16 border-2 border-dashed border-gray-300 rounded-lg",children:c?(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(b.u,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drop files to upload"})]}):(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(N.v,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,a.jsx)(G.sZ,{placeholder:"Select files..."}),(0,a.jsxs)(G.e8,{children:[(0,a.jsx)(G.rb,{children:"No files found."}),(0,a.jsx)(G.fu,{children:q.map(t=>(0,a.jsxs)(G.di,{value:t,onSelect:()=>{let s=e.form.getValues("files")||[],a=s.includes(t)?s.filter(e=>e!==t):[...s,t];e.form.setValue("files",a)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(t)?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]})}},t);case"input_tools":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"input_tools",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Input Tools"}),(0,a.jsxs)(R.pf,{children:["Which knowledge retrieval tools should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(M,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," tools selected"):"All tools"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(G.mY,{children:(0,a.jsx)(G.e8,{children:(0,a.jsx)(G.fu,{children:Object.entries(e.inputToolOptions).map(t=>{let[r,l]=t;return(0,a.jsxs)(G.di,{value:r,onSelect:()=>{let t=e.form.getValues("input_tools")||[],s=t.includes(r)?t.filter(e=>e!==r):[...t,r];e.form.setValue("input_tools",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(r)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:r})}),(0,a.jsx)("p",{children:l})]})]},r)})})})})})]})]})}},t);case"output_modes":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"output_modes",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Output Modes"}),(0,a.jsxs)(R.pf,{children:["Which output modes should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(M,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," modes selected"):"All modes"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(G.mY,{children:(0,a.jsx)(G.e8,{children:(0,a.jsx)(G.fu,{children:Object.entries(e.outputModeOptions).map(t=>{let[r,l]=t;return(0,a.jsxs)(G.di,{value:r,onSelect:()=>{let t=e.form.getValues("output_modes")||[],s=t.includes(r)?t.filter(e=>e!==r):[...t,r];e.form.setValue("output_modes",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(r)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:r})}),(0,a.jsx)("p",{children:l})]})]},r)})})})})})]})]})}},t);default:return null}};return(0,a.jsx)(R.l0,{...e.form,children:(0,a.jsxs)("form",{onSubmit:e.form.handleSubmit(t=>{e.onSubmit(t),s(!0)}),className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-6",children:ee[E].label}),E<ee.length&&ee[E].fields.map(e=>ed(e.name)),(0,a.jsxs)("div",{className:"flex justify-between mt-4",children:[(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),E>0&&J(E-1)},disabled:0===E,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(w.X,{className:"mr-2 h-4 w-4"}),"Previous"]}),E<ee.length-1?(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),E<ee.length-1&&J(E+1)},disabled:!(t=>{try{return et.parse(e.form.getValues()),!0}catch(s){let e=s.errors.reduce((e,t)=>(e[t.path[0]]=t.message,e),{});for(let s of t.fields)if(e[s.name])return!1;return!0}})(ee[E]),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:["Next",(0,a.jsx)(_.o,{className:"ml-2 h-4 w-4"})]}):(0,a.jsxs)(i.z,{type:"submit",variant:"outline",disabled:t,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(k.B,{className:"h-4 w-4 mr-2"}),t?"Booting...":"Save"]})]}),e.errors&&(0,a.jsx)(O.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(O.X,{className:"flex items-center gap-1",children:[(0,a.jsx)(C.f,{weight:"fill",className:"h-4 w-4 text-yellow-400 inline"}),(0,a.jsx)("span",{children:e.errors})]})})]})})}},97673:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=s(57437),r=s(26110),l=s(62869),n=s(95186),i=s(26815),o=s(92457);function c(e){var t;return(0,a.jsxs)(r.Vq,{children:[(0,a.jsx)(r.hg,{asChild:!0,onClick:e.onShare,children:(0,a.jsxs)(l.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,a.jsx)(o.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,a.jsxs)(r.cZ,{children:[(0,a.jsxs)(r.fK,{children:[(0,a.jsx)(r.$N,{children:e.title}),(0,a.jsx)(r.Be,{children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,a.jsx)(i._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,a.jsx)(n.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,a.jsx)(l.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,a.jsx)("span",{children:"Copy"})})]})]})]})}},65613:function(e,t,s){"use strict";s.d(t,{X:function(){return c},bZ:function(){return o}});var a=s(57437),r=s(2265),l=s(90535),n=s(94508);let i=(0,l.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=r.forwardRef((e,t)=>{let{className:s,variant:r,...l}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:r}),s),...l})});o.displayName="Alert",r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",s),...r})}).displayName="AlertTitle";let c=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",s),...r})});c.displayName="AlertDescription"},15681:function(e,t,s){"use strict";s.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return j},xJ:function(){return x},zG:function(){return g}});var a=s(57437),r=s(2265),l=s(37053),n=s(29501),i=s(94508),o=s(26815);let c=n.RV,d=r.createContext({}),u=e=>{let{...t}=e;return(0,a.jsx)(d.Provider,{value:{name:t.name},children:(0,a.jsx)(n.Qr,{...t})})},h=()=>{let e=r.useContext(d),t=r.useContext(m),{getFieldState:s,formState:a}=(0,n.Gc)(),l=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...l}},m=r.createContext({}),x=r.forwardRef((e,t)=>{let{className:s,...l}=e,n=r.useId();return(0,a.jsx)(m.Provider,{value:{id:n},children:(0,a.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",s),...l})})});x.displayName="FormItem";let f=r.forwardRef((e,t)=>{let{className:s,...r}=e,{error:l,formItemId:n}=h();return(0,a.jsx)(o._,{ref:t,className:(0,i.cn)(l&&"text-destructive",s),htmlFor:n,...r})});f.displayName="FormLabel";let p=r.forwardRef((e,t)=>{let{...s}=e,{error:r,formItemId:n,formDescriptionId:i,formMessageId:o}=h();return(0,a.jsx)(l.g7,{ref:t,id:n,"aria-describedby":r?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!r,...s})});p.displayName="FormControl";let j=r.forwardRef((e,t)=>{let{className:s,...r}=e,{formDescriptionId:l}=h();return(0,a.jsx)("p",{ref:t,id:l,className:(0,i.cn)("text-sm text-muted-foreground",s),...r})});j.displayName="FormDescription";let g=r.forwardRef((e,t)=>{let{className:s,children:r,...l}=e,{error:n,formMessageId:o}=h(),c=n?String(null==n?void 0:n.message):r;return c?(0,a.jsx)("p",{ref:t,id:o,className:(0,i.cn)("text-sm font-medium text-destructive",s),...l,children:c}):null});g.displayName="FormMessage"},26815:function(e,t,s){"use strict";s.d(t,{_:function(){return c}});var a=s(57437),r=s(2265),l=s(6394),n=s(90535),i=s(94508);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.f,{ref:t,className:(0,i.cn)(o(),s),...r})});c.displayName=l.f.displayName},53647:function(e,t,s){"use strict";s.d(t,{Bw:function(){return f},Ph:function(){return d},Ql:function(){return p},i4:function(){return h},ki:function(){return u}});var a=s(57437),r=s(2265),l=s(28951),n=s(40875),i=s(22135),o=s(30401),c=s(94508);let d=l.fC;l.ZA;let u=l.B4,h=r.forwardRef((e,t)=>{let{className:s,children:r,...i}=e;return(0,a.jsxs)(l.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...i,children:[r,(0,a.jsx)(l.JO,{asChild:!0,children:(0,a.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});h.displayName=l.xz.displayName;let m=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});m.displayName=l.u_.displayName;let x=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(n.Z,{className:"h-4 w-4"})})});x.displayName=l.$G.displayName;let f=r.forwardRef((e,t)=>{let{className:s,children:r,position:n="popper",...i}=e;return(0,a.jsx)(l.h_,{children:(0,a.jsxs)(l.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...i,children:[(0,a.jsx)(m,{}),(0,a.jsx)(l.l_,{className:(0,c.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,a.jsx)(x,{})]})})});f.displayName=l.VY.displayName,r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...r})}).displayName=l.__.displayName;let p=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(l.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(l.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(l.eT,{children:r})]})});p.displayName=l.ck.displayName,r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...r})}).displayName=l.Z0.displayName},71159:function(e){e.exports={agentPersonality:"agentCard_agentPersonality__MmRlN",infoButton:"agentCard_infoButton__heh_w"}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8459,244,3317,7138],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,t,a){Promise.resolve().then(a.bind(a,37335))},37335:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return O}});var n=a(57437),l=a(14675),o=a.n(l),s=a(63861),i=a(2265),r=a(56937),d=a(89203),c=a(78527),u=a(26110),p=a(33494),m=a(14308),f=a(92813),g=a(65613),h=a(7436),x=a(9262),v=a(29501),b=a(13590);let _=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),j=e=>fetch(e).then(e=>e.json());function y(e){let[t,a]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),[s,r]=(0,i.useState)(!0),c=(0,v.cI)({resolver:(0,b.F)(x.bc),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]}});return(0,i.useEffect)(()=>{c.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,n.jsxs)(u.Vq,{open:t,onOpenChange:a,children:[(0,n.jsx)(u.hg,{children:(0,n.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,n.jsx)(d.v,{}),"Create Agent"]})}),(0,n.jsxs)(u.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,n.jsx)(u.fK,{children:"Create Agent"}),!e.userProfile&&s&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:r,isMobileWidth:e.isMobileWidth}),(0,n.jsx)(x.ks,{form:c,onSubmit:t=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>{200===t.status?(c.reset(),a(!1),o(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),e.error&&o(e.error)})}).catch(e=>{console.error("Error:",e),o(e)})},create:!0,errors:l,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function O(){let{data:e,error:t,mutate:a}=(0,s.ZP)("agents",_,{revalidateOnFocus:!1}),l=(0,r.GW)(),{userConfig:d}=(0,r.h2)(!0),[u,v]=(0,i.useState)(!1),b=(0,h.IC)(),[O,w]=(0,i.useState)([]),[N,M]=(0,i.useState)([]),[L,E]=(0,i.useState)(null),{data:C,error:S}=(0,s.ZP)(d?"/api/content/computer":null,j),{data:P,error:Z}=(0,s.ZP)("/api/agents/options",j),[A,T]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{A&&(a(),T(!1))},[A]),(0,i.useEffect)(()=>{if(e){w(e.filter(e=>e.creator===(null==l?void 0:l.username)));let t=e.filter(e=>"private"!==e.privacy_level&&e.creator!==(null==l?void 0:l.username));M(t);{let a=new URLSearchParams(window.location.search).get("agent");if(a){E(a);let n=e.find(e=>e.slug===a);n||(n=t.find(e=>e.slug===a)),n||fetch("/api/agents/".concat(a)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&M(t=>[...t,e])})}}}},[e,l]),t)return(0,n.jsxs)("main",{className:o().main,children:[(0,n.jsx)("div",{className:"".concat(o().titleBar," text-5xl"),children:"Agents"}),(0,n.jsx)("div",{className:o().agentList,children:"Error loading agents"})]});if(!e)return(0,n.jsx)("main",{className:o().main,children:(0,n.jsxs)("div",{className:o().agentList,children:[(0,n.jsx)(m.l,{})," booting up your agents"]})});let z=(null==d?void 0:d.chat_model_options)||[],F=(null==d?void 0:d.selected_chat_model_config)||0,k=(0,r.T8)(d),R=z.find(e=>e.id===F);return(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(o().sidePanel," top-0"),children:(0,n.jsx)(f.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:b})}),(0,n.jsxs)("div",{className:"".concat(o().pageLayout," w-full"),children:[(0,n.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,n.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,n.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,n.jsx)(y,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:b,filesOptions:C||[],modelOptions:(null==d?void 0:d.chat_model_options)||[],selectedChatModelOption:(null==R?void 0:R.name)||"",isSubscribed:k,setAgentChangeTriggered:T,inputToolOptions:(null==P?void 0:P.input_tools)||{},outputModeOptions:(null==P?void 0:P.output_modes)||{}})})]}),u&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:v,isMobileWidth:b}),(0,n.jsx)(g.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(g.X,{children:[(0,n.jsx)(c.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,n.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,n.jsx)("div",{className:"pt-6 md:pt-8",children:(0,n.jsx)("div",{className:"".concat(o().agentList),children:O.map(e=>(0,n.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:b,filesOptions:null!=C?C:[],selectedChatModelOption:(null==R?void 0:R.name)||"",isSubscribed:k,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],editCard:!0,agentSlug:L||"",inputToolOptions:(null==P?void 0:P.input_tools)||{},outputModeOptions:(null==P?void 0:P.output_modes)||{}},e.slug))})}),(0,n.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,n.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,n.jsx)("div",{className:"".concat(o().agentList),children:N.map(e=>(0,n.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:b,editCard:!1,filesOptions:null!=C?C:[],selectedChatModelOption:(null==R?void 0:R.name)||"",isSubscribed:k,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],agentSlug:L||"",inputToolOptions:(null==P?void 0:P.input_tools)||{},outputModeOptions:(null==P?void 0:P.output_modes)||{}},e.slug))})]})]})]})})}},32759:function(e,t,a){"use strict";a.d(t,{E:function(){return i}});var n=a(57437),l=a(2265),o=a(60610),s=a(94508);let i=l.forwardRef((e,t)=>{let{className:a,value:l,indicatorColor:i,...r}=e;return(0,n.jsx)(o.fC,{ref:t,className:(0,s.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...r,children:(0,n.jsx)(o.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});i.displayName=o.fC.displayName},76818:function(e,t,a){"use strict";a.d(t,{g:function(){return s}});var n=a(57437),l=a(2265),o=a(94508);let s=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,n.jsx)("textarea",{className:(0,o.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});s.displayName="Textarea"},81103:function(e,t,a){"use strict";a.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return r}});var n=a(57437),l=a(2265),o=a(61312),s=a(94508);let i=o.zt,r=o.fC,d=o.xz,c=l.forwardRef((e,t)=>{let{className:a,sideOffset:l=4,...i}=e;return(0,n.jsx)(o.VY,{ref:t,sideOffset:l,className:(0,s.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});c.displayName=o.VY.displayName},14675:function(e){e.exports={titleBar:"agents_titleBar__FzYbY",agentPersonality:"agents_agentPersonality__o0Ysz",pageLayout:"agents_pageLayout__gR3S3",sidePanel:"agents_sidePanel__wGVGc",infoButton:"agents_infoButton__NqI7E",agentList:"agents_agentList__XVx4A"}},78527:function(e,t,a){"use strict";a.d(t,{B:function(){return g}});var n=a(2265),l=a(49656);let o=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]);var s=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,m=(e,t)=>{for(var a in t||(t={}))c.call(t,a)&&p(e,a,t[a]);if(d)for(var a of d(t))u.call(t,a)&&p(e,a,t[a]);return e},f=(e,t)=>i(e,r(t));let g=(0,n.forwardRef)((e,t)=>n.createElement(l.Z,f(m({ref:t},e),{weights:o})));g.displayName="Lightning"}},function(e){e.O(0,[4722,3194,5540,8407,8667,5401,6589,8117,1662,2813,9262,2971,2117,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4371],{2743:function(e,t,a){Promise.resolve().then(a.bind(a,77837))},77837:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ef}});var n=a(57437),s=a(63861),r=a(14308),o=a(66070),i=a(62869),l=a(53647),c=a(47107),d=a.n(c),u=a(13590),m=a(29501),h=a(31229),f=a(2265),x=a(15681),p=a(95186),g=a(26110),j=a(49027),y=a(76818),w=a(7436),b=a(30190),v=a.n(b),N=a(97673),k=a(99376),D=a(57054),S=a(41317),C=a(87332),_=a(19841),I=a(3634),A=a(97822),M=a(93435),R=a(27484),z=a(39353),T=a(66594),P=a(12443),L=a(89203),W=a(78527),O=a(56937),q=a(33494),E=a(77992),U=a(89534),F=a(65613),V=a(92813),B=a(17814);let G=()=>window.fetch("/api/automations").then(e=>e.json()).catch(e=>console.log(e));function Z(e){let t=e.split(" "),a=t[2],n=t[4];return"*"===a&&"*"===n?"Day":"*"!==n?"Week":"*"!==a?"Month":"Day"}function J(e){let t=e.split(" ");if("*"===t[3]&&"*"!==t[4])return Number(t[4])}function Q(e){let t=e.split(" "),a=t[1],n=t[0],s=Number(a)>=12?"PM":"AM",r=Number(a)>12?Number(a)-12:a;"00"===r&&(r="12");let o=n;return 10>Number(o)&&"00"!==o&&(o="0".concat(o)),"".concat(r,":").concat(o," ").concat(s)}function X(e){return String(e.split(" ")[2])}function H(e){return d().toString(e)}let Y=["Day","Week","Month"],$=Array.from({length:31},(e,t)=>String(t+1)),K=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ee=[],et=["AM","PM"];for(var ea=0;ea<et.length;ea++)for(var en=0;en<12;en++)for(var es=0;es<60;es+=15){let e=String(es).padStart(2,"0"),t=0===en?12:en;ee.push("".concat(t,":").concat(e," ").concat(et[ea]))}let er=Date.now(),eo=[{subject:"Weekly Newsletter",query_to_run:"/research Compile a message including: 1. A recap of news from last week 2. An at-home workout I can do before work 3. A quote to inspire me for the week ahead",schedule:"9AM every Monday",next:"Next run at 9AM on Monday",crontime:"0 9 * * 1",id:er,scheduling_request:""},{subject:"Daily Bedtime Story",query_to_run:"Compose a bedtime story that a five-year-old might enjoy. It should not exceed five paragraphs. Appeal to the imagination, but weave in learnings.",schedule:"9PM every night",next:"Next run at 9PM today",crontime:"0 21 * * *",id:er+1,scheduling_request:""},{subject:"Front Page of Hacker News",query_to_run:"/research Summarize the top 5 posts from https://news.ycombinator.com/best and share them with me, including links",schedule:"9PM on every Wednesday",next:"Next run at 9PM on Wednesday",crontime:"0 21 * * 3",id:er+2,scheduling_request:""},{subject:"Market Summary",query_to_run:"/research Get the market summary for today and share it with me. Focus on tech stocks and the S&P 500.",schedule:"9AM on every weekday",next:"Next run at 9AM on Monday",crontime:"0 9 * * *",id:er+3,scheduling_request:""},{subject:"Market Crash Notification",query_to_run:"Notify me if the stock market fell by more than 5% today.",schedule:"5PM every evening",next:"Next run at 5PM today",crontime:"0 17 * * *",id:er+5,scheduling_request:""},{subject:"Round-up of research papers about AI in healthcare",query_to_run:"/research Summarize the top 3 research papers about AI in healthcare that were published in the last week. Include links to the full papers.",schedule:"9AM every Friday",next:"Next run at 9AM on Friday",crontime:"0 9 * * 5",id:er+4,scheduling_request:""}];function ei(e){let t=encodeURIComponent(e.subject),a=encodeURIComponent(e.query_to_run),n=encodeURIComponent(e.crontime);return"".concat(window.location.origin,"/automations?subject=").concat(t,"&query=").concat(a,"&crontime=").concat(n)}function el(e){let[t,a]=(0,f.useState)(!1),[s,r]=(0,f.useState)(null),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(""),{toast:m}=(0,E.pm)(),h=e.automation,[x,p]=(0,f.useState)(""),[g,j]=(0,f.useState)("");return((0,f.useEffect)(()=>{let e=s||h;p(Q(e.crontime));let t=Z(e.crontime);if("Day"===t)j("Daily");else if("Week"===t){let t=J(e.crontime);void 0===t?j("Weekly"):j("".concat(K[t]))}else if("Month"===t){let t=X(e.crontime);j("Monthly on the ".concat(t))}},[s,h]),(0,f.useEffect)(()=>{let e="Automation: ".concat((null==s?void 0:s.subject)||h.subject);d&&(m({title:e,description:d,action:(0,n.jsx)(U.gD,{altText:"Dismiss",children:"Ok"})}),u(""))},[d,s,h,m]),l)?null:(0,n.jsxs)(o.Zb,{className:"h-full shadow-md rounded-lg dark:bg-muted ".concat(v().automationCard),children:[(0,n.jsx)(o.Ol,{children:(0,n.jsxs)(o.ll,{className:"line-clamp-2 leading-normal flex justify-between",children:[(null==s?void 0:s.subject)||h.subject,(0,n.jsxs)(D.J2,{children:[(0,n.jsx)(D.xo,{asChild:!0,children:(0,n.jsx)(i.z,{className:"bg-background",variant:"ghost",children:(0,n.jsx)(S.F,{className:"h-4 w-4"})})}),(0,n.jsxs)(D.yk,{className:"w-auto grid gap-2 text-left bg-secondary",children:[!e.suggestedCard&&e.locationData&&(0,n.jsx)(eh,{isMobileWidth:e.isMobileWidth,callToAction:"Edit",createNew:!1,setIsCreating:a,setShowLoginPrompt:e.setShowLoginPrompt,setNewAutomationData:r,authenticatedData:e.authenticatedData,isCreating:t,automation:s||h,ipLocationData:e.locationData}),(0,n.jsx)(N.Z,{buttonTitle:"Share",includeIcon:!0,buttonClassName:"justify-start px-4 py-2 h-10",buttonVariant:"outline",title:"Share Automation",description:"Copy the link below and share it with your coworkers or friends.",url:ei(h),onShare:()=>{navigator.clipboard.writeText(ei(h))}}),!e.suggestedCard&&(0,n.jsxs)(i.z,{variant:"outline",className:"justify-start",onClick:()=>{!function(e,t){fetch("/api/trigger/automation?automation_id=".concat(e),{method:"POST"}).then(e=>{if(!e.ok)throw Error("Network response was not ok");return e}).then(e=>{t("Automation triggered. Check your inbox in a few minutes!")}).catch(e=>{t("Sorry, something went wrong. Try again later.")})}(h.id.toString(),u)},children:[(0,n.jsx)(C.s,{className:"h-4 w-4 mr-2"}),"Run Now"]}),(0,n.jsxs)(i.z,{variant:"destructive",className:"justify-start",onClick:()=>{if(e.suggestedCard){c(!0);return}!function(e,t){fetch("/api/automation?automation_id=".concat(e),{method:"DELETE"}).then(e=>e.json()).then(e=>{t(!0)})}(h.id.toString(),c)},children:[(0,n.jsx)(_.r,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})}),(0,n.jsx)(o.aY,{className:"text-secondary-foreground break-all",children:(null==s?void 0:s.query_to_run)||h.query_to_run}),(0,n.jsxs)(o.eW,{className:"flex flex-col items-start md:flex-row md:justify-between md:items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center bg-blue-50 rounded-lg p-1.5 border-blue-200 border dark:bg-blue-800 dark:border-blue-500",children:[(0,n.jsx)(I.T,{className:"h-4 w-4 mr-2 text-blue-700 dark:text-blue-300"}),(0,n.jsx)("div",{className:"text-s text-blue-700 dark:text-blue-300",children:x})]}),(0,n.jsxs)("div",{className:"flex items-center bg-purple-50 rounded-lg p-1.5 border-purple-200 border dark:bg-purple-800 dark:border-purple-500",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 text-purple-700 dark:text-purple-300"}),(0,n.jsx)("div",{className:"text-s text-purple-700 dark:text-purple-300",children:g})]})]}),e.suggestedCard&&e.setNewAutomationData&&(0,n.jsx)(eh,{isMobileWidth:e.isMobileWidth,callToAction:"Add",createNew:!0,setIsCreating:a,setShowLoginPrompt:e.setShowLoginPrompt,setNewAutomationData:e.setNewAutomationData,authenticatedData:e.authenticatedData,isCreating:t,automation:h,ipLocationData:e.locationData})]})]})}function ec(e){let t=(0,k.useSearchParams)(),[a,s]=(0,f.useState)(!0),r=t.get("subject"),o=t.get("query"),i=t.get("crontime");if(!r||!o||!i)return null;let l={id:0,subject:decodeURIComponent(r),query_to_run:decodeURIComponent(o),scheduling_request:"",schedule:H(decodeURIComponent(i)),crontime:decodeURIComponent(i),next:""};return a?(0,n.jsx)(eh,{isMobileWidth:e.isMobileWidth,callToAction:"Shared",createNew:!0,setIsCreating:s,setShowLoginPrompt:e.setShowLoginPrompt,setNewAutomationData:e.setNewAutomationData,authenticatedData:e.authenticatedData,isCreating:a,automation:l,ipLocationData:e.locationData}):null}let ed=h.z.object({subject:h.z.optional(h.z.string()),everyBlah:h.z.string({required_error:"Every is required"}),dayOfWeek:h.z.optional(h.z.number()),dayOfMonth:h.z.optional(h.z.string()),timeRecurrence:h.z.string({required_error:"Time Recurrence is required"}),queryToRun:h.z.string({required_error:"Query to Run is required"})});function eu(e){let t=e.automation,a=(0,m.cI)({resolver:(0,u.F)(ed),defaultValues:{subject:null==t?void 0:t.subject,everyBlah:(null==t?void 0:t.crontime)?Z(t.crontime):"Day",dayOfWeek:(null==t?void 0:t.crontime)?J(t.crontime):void 0,timeRecurrence:(null==t?void 0:t.crontime)?Q(t.crontime):"12:00 PM",dayOfMonth:(null==t?void 0:t.crontime)?X(t.crontime):"1",queryToRun:null==t?void 0:t.query_to_run}});return(0,n.jsx)(em,{authenticatedData:e.authenticatedData,locationData:e.locationData||null,form:a,onSubmit:a=>{let n=function(e,t,a,n){let s="",r=t.split(":")[1].split(" ")[0],o=t.split(":")[1].split(" ")[1],i=Number(t.split(":")[0]),l="PM"===o&&i<12?String(i+12):i;switch(e){case"Day":s="".concat(r," ").concat(l," * * *");break;case"Week":s="".concat(r," ").concat(l," * * ").concat(void 0!==a?7===a?0:a:"*");break;case"Month":s="".concat(r," ").concat(l," ").concat(n," * *")}return s}(a.everyBlah,a.timeRecurrence,a.dayOfWeek,a.dayOfMonth),s="/api/automation?";s+="q=".concat(encodeURIComponent(a.queryToRun)),(null==t?void 0:t.id)&&!e.createNew&&(s+="&automation_id=".concat(encodeURIComponent(t.id))),a.subject&&(s+="&subject=".concat(encodeURIComponent(a.subject))),s+="&crontime=".concat(encodeURIComponent(n)),e.locationData&&e.locationData.city&&(s+="&city=".concat(encodeURIComponent(e.locationData.city))),e.locationData&&e.locationData.region&&(s+="&region=".concat(encodeURIComponent(e.locationData.region))),e.locationData&&e.locationData.country&&(s+="&country=".concat(encodeURIComponent(e.locationData.country))),e.locationData&&e.locationData.timezone&&(s+="&timezone=".concat(encodeURIComponent(e.locationData.timezone))),fetch(s,{method:e.createNew?"POST":"PUT"}).then(e=>e.json()).then(t=>{e.setIsEditing(!1),e.setUpdatedAutomationData({id:t.id,subject:t.subject||"",query_to_run:t.query_to_run,scheduling_request:t.scheduling_request,schedule:H(t.crontime),crontime:t.crontime,next:t.next})})},create:e.createNew,isLoggedIn:e.isLoggedIn,setShowLoginPrompt:e.setShowLoginPrompt})}function em(e){var t,a;let[s,r]=(0,f.useState)(!1),{errors:o}=e.form.formState,c=["Make a picture of","Generate a summary of","Create a newsletter of","Notify me when"];return(0,n.jsx)(x.l0,{...e.form,children:(0,n.jsxs)("form",{onSubmit:e.form.handleSubmit(t=>{e.onSubmit(t),r(!0)}),className:"space-y-6",children:[(0,n.jsx)(x.xJ,{className:"space-y-1",children:(0,n.jsxs)(x.pf,{children:["Emails will be sent to this address. Timezone and location data will be used to schedule automations.",e.locationData&&(t=e.locationData,a=e.authenticatedData,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center justify-start",children:[a?(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(z.w,{className:"h-4 w-4 mr-2 inline text-orange-500 shadow-sm"}),a.email]}):null,t&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(T.x,{className:"h-4 w-4 mr-2 inline text-purple-500"}),t?"".concat(t.city,", ").concat(t.country):"Unknown"]}),t&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(P.S,{className:"h-4 w-4 mr-2 inline text-green-500"}),t?"".concat(t.timezone):"Unknown"]})]}))]})}),!e.create&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"subject",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Subject"}),(0,n.jsx)(x.pf,{children:"This is the subject of the email you will receive."}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(p.I,{placeholder:"Digest of Healthcare AI trends",...a})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.subject)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"everyBlah",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Frequency"}),(0,n.jsx)(x.pf,{children:"How often should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(M.W,{className:"h-4 w-4 mr-2 inline"}),"Every"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:Y.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.everyBlah)||void 0===t?void 0:t.message})]})}}),"Week"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfWeek",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every week, on which day should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:e=>a.onChange(Number(e)),defaultValue:String(a.value),children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:K.map((e,t)=>(0,n.jsx)(l.Ql,{value:String(t),children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfWeek)||void 0===t?void 0:t.message})]})}}),"Month"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfMonth",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every month, on which day should the automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On the"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:$.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfMonth)||void 0===t?void 0:t.message})]})}}),("Day"===e.form.watch("everyBlah")||"Week"==e.form.watch("everyBlah")||"Month"==e.form.watch("everyBlah"))&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"timeRecurrence",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Time"}),(0,n.jsx)(x.pf,{children:"On the days this automation runs, at what time should it run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 inline"}),"At"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:ee.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.timeRecurrence)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"queryToRun",render:t=>{var a;let{field:s}=t;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Instructions"}),(0,n.jsx)(x.pf,{children:"What do you want Khoj to do?"}),e.create&&(0,n.jsx)("div",{children:c.map(e=>{var t;return t=s.onChange,(0,n.jsxs)(i.z,{className:"text-xs bg-slate-50 dark:bg-slate-950 h-auto p-1.5 m-1 rounded-full",variant:"ghost",onClick:a=>{a.preventDefault(),t({target:{value:e}},a)},children:[e,"..."]},e)})}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(y.g,{placeholder:"Create a summary of the latest news about AI in healthcare.",value:s.value,onChange:s.onChange})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(a=o.queryToRun)||void 0===a?void 0:a.message})]})}}),(0,n.jsx)("fieldset",{disabled:s,children:e.isLoggedIn?s?(0,n.jsx)(i.z,{type:"submit",disabled:!0,children:"Saving..."}):(0,n.jsx)(i.z,{type:"submit",children:"Save"}):(0,n.jsx)(i.z,{onClick:t=>{t.preventDefault(),e.setShowLoginPrompt(!0)},variant:"default",children:"Login to Save"})})]})})}function eh(e){return e.isMobileWidth?(0,n.jsxs)(B.dy,{open:e.isCreating,onOpenChange:t=>{e.setIsCreating(t)},children:[(0,n.jsx)(B.Qz,{asChild:!0,children:(0,n.jsxs)(i.z,{className:"shadow-sm justify-start",variant:"outline",children:[(0,n.jsx)(L.v,{className:"h-4 w-4 mr-2"}),e.callToAction]})}),(0,n.jsxs)(B.sc,{className:"p-2",children:[(0,n.jsx)(B.iI,{children:"Automation"}),(0,n.jsx)(eu,{createNew:e.createNew,automation:e.automation,setIsEditing:e.setIsCreating,isLoggedIn:!!e.authenticatedData,authenticatedData:e.authenticatedData,setShowLoginPrompt:e.setShowLoginPrompt,setUpdatedAutomationData:e.setNewAutomationData,locationData:e.ipLocationData})]})]}):(0,n.jsxs)(g.Vq,{open:e.isCreating,onOpenChange:t=>{e.setIsCreating(t)},children:[(0,n.jsx)(g.hg,{asChild:!0,children:(0,n.jsxs)(i.z,{className:"shadow-sm justify-start",variant:"outline",children:[(0,n.jsx)(L.v,{className:"h-4 w-4 mr-2"}),e.callToAction]})}),(0,n.jsxs)(g.cZ,{className:"max-h-[98vh] overflow-y-auto",children:[(0,n.jsx)(j.$N,{children:"Automation"}),(0,n.jsx)(eu,{automation:e.automation,createNew:e.createNew,setIsEditing:e.setIsCreating,isLoggedIn:!!e.authenticatedData,authenticatedData:e.authenticatedData,setShowLoginPrompt:e.setShowLoginPrompt,setUpdatedAutomationData:e.setNewAutomationData,locationData:e.ipLocationData})]})]})}function ef(){let e=(0,O.GW)(),{data:t,error:a,isLoading:o}=(0,s.ZP)(e?"automations":null,G,{revalidateOnFocus:!1}),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(null),[m,h]=(0,f.useState)([]),[x,p]=(0,f.useState)([]),[g,j]=(0,f.useState)(!1),y=(0,w.IC)(),{locationData:b,locationDataError:N,locationDataLoading:k}=(0,w.k6)();return((0,f.useEffect)(()=>{d&&(h([...m,d]),u(null))},[d,m]),(0,f.useEffect)(()=>{let e=t?t.concat(m):m;e&&p(eo.filter(t=>void 0===e.find(e=>t.subject===e.subject)))},[t,m]),a)?(0,n.jsx)(r.l,{message:"Oops, something went wrong. Please refresh the page."}):(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(v().sidePanel," top-0"),children:(0,n.jsx)(V.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:y})}),(0,n.jsxs)("div",{className:"".concat(v().pageLayout," w-full"),children:[(0,n.jsxs)("div",{className:"pt-6 md:pt-8 grid gap-1 md:flex md:justify-between",children:[(0,n.jsx)("h1",{className:"text-3xl flex items-center",children:"Automations"}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center justify-start",children:[e?(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(z.w,{className:"h-4 w-4 mr-2 inline text-orange-500 shadow-sm"}),e.email]}):null,b&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(T.x,{className:"h-4 w-4 mr-2 inline text-purple-500"}),b?"".concat(b.city,", ").concat(b.country):"Unknown"]}),b&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm dark:bg-muted",children:[(0,n.jsx)(P.S,{className:"h-4 w-4 mr-2 inline text-green-500"}),b?"".concat(b.timezone):"Unknown"]})]})]}),g&&(0,n.jsx)(q.Z,{loginRedirectMessage:"Create an account to make your own automation",onOpenChange:j,isMobileWidth:y}),(0,n.jsx)(F.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(F.X,{children:[(0,n.jsx)(W.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,n.jsx)("span",{className:"font-bold",children:"How it works"})," Automations help you structure your time by automating tasks you do regularly. Build your own, or try out our presets. Get results straight to your inbox."]})}),(0,n.jsx)("div",{className:"flex justify-between items-center py-4",children:e?(0,n.jsx)(eh,{isMobileWidth:y,callToAction:"Create Automation",createNew:!0,setIsCreating:c,setShowLoginPrompt:j,setNewAutomationData:u,authenticatedData:e,isCreating:l,ipLocationData:b}):(0,n.jsxs)(i.z,{className:"shadow-sm",onClick:()=>j(!0),variant:"outline",children:[(0,n.jsx)(L.v,{className:"h-4 w-4 mr-2"}),"Create Automation"]})}),(0,n.jsx)(f.Suspense,{children:(0,n.jsx)(ec,{isMobileWidth:y,authenticatedData:e,locationData:b,isLoggedIn:!!e,setShowLoginPrompt:j,setNewAutomationData:u})}),o&&(0,n.jsx)(r.l,{message:"booting up your automations"}),(0,n.jsxs)("div",{className:"".concat(v().automationsLayout),children:[t&&t.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:b,isLoggedIn:!!e,setShowLoginPrompt:j},t.id)),m.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:b,isLoggedIn:!!e,setShowLoginPrompt:j},t.id))]}),(0,n.jsx)("h3",{className:"text-xl py-4",children:"Explore"}),(0,n.jsx)("div",{className:"".concat(v().automationsLayout),children:x.map(t=>(0,n.jsx)(el,{isMobileWidth:y,setNewAutomationData:u,authenticatedData:e,automation:t,locationData:b,isLoggedIn:!!e,setShowLoginPrompt:j,suggestedCard:!0},t.id))})]})]})})}},97673:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var n=a(57437),s=a(26110),r=a(62869),o=a(95186),i=a(26815),l=a(92457);function c(e){var t;return(0,n.jsxs)(s.Vq,{children:[(0,n.jsx)(s.hg,{asChild:!0,onClick:e.onShare,children:(0,n.jsxs)(r.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,n.jsx)(l.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,n.jsxs)(s.cZ,{children:[(0,n.jsxs)(s.fK,{children:[(0,n.jsx)(s.$N,{children:e.title}),(0,n.jsx)(s.Be,{children:e.description})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,n.jsx)(i._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,n.jsx)(o.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,n.jsx)(r.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,n.jsx)("span",{children:"Copy"})})]})]})]})}},65613:function(e,t,a){"use strict";a.d(t,{X:function(){return c},bZ:function(){return l}});var n=a(57437),s=a(2265),r=a(90535),o=a(94508);let i=(0,r.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),l=s.forwardRef((e,t)=>{let{className:a,variant:s,...r}=e;return(0,n.jsx)("div",{ref:t,role:"alert",className:(0,o.cn)(i({variant:s}),a),...r})});l.displayName="Alert",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("h5",{ref:t,className:(0,o.cn)("mb-1 font-medium leading-none tracking-tight",a),...s})}).displayName="AlertTitle";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("text-sm [&_p]:leading-relaxed",a),...s})});c.displayName="AlertDescription"},15681:function(e,t,a){"use strict";a.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return x},pf:function(){return g},xJ:function(){return f},zG:function(){return j}});var n=a(57437),s=a(2265),r=a(37053),o=a(29501),i=a(94508),l=a(26815);let c=o.RV,d=s.createContext({}),u=e=>{let{...t}=e;return(0,n.jsx)(d.Provider,{value:{name:t.name},children:(0,n.jsx)(o.Qr,{...t})})},m=()=>{let e=s.useContext(d),t=s.useContext(h),{getFieldState:a,formState:n}=(0,o.Gc)(),r=a(e.name,n);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...r}},h=s.createContext({}),f=s.forwardRef((e,t)=>{let{className:a,...r}=e,o=s.useId();return(0,n.jsx)(h.Provider,{value:{id:o},children:(0,n.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",a),...r})})});f.displayName="FormItem";let x=s.forwardRef((e,t)=>{let{className:a,...s}=e,{error:r,formItemId:o}=m();return(0,n.jsx)(l._,{ref:t,className:(0,i.cn)(r&&"text-destructive",a),htmlFor:o,...s})});x.displayName="FormLabel";let p=s.forwardRef((e,t)=>{let{...a}=e,{error:s,formItemId:o,formDescriptionId:i,formMessageId:l}=m();return(0,n.jsx)(r.g7,{ref:t,id:o,"aria-describedby":s?"".concat(i," ").concat(l):"".concat(i),"aria-invalid":!!s,...a})});p.displayName="FormControl";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e,{formDescriptionId:r}=m();return(0,n.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});g.displayName="FormDescription";let j=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e,{error:o,formMessageId:l}=m(),c=o?String(null==o?void 0:o.message):s;return c?(0,n.jsx)("p",{ref:t,id:l,className:(0,i.cn)("text-sm font-medium text-destructive",a),...r,children:c}):null});j.displayName="FormMessage"},26815:function(e,t,a){"use strict";a.d(t,{_:function(){return c}});var n=a(57437),s=a(2265),r=a(6394),o=a(90535),i=a(94508);let l=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.f,{ref:t,className:(0,i.cn)(l(),a),...s})});c.displayName=r.f.displayName},53647:function(e,t,a){"use strict";a.d(t,{Bw:function(){return x},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return u}});var n=a(57437),s=a(2265),r=a(28951),o=a(40875),i=a(22135),l=a(30401),c=a(94508);let d=r.fC;r.ZA;let u=r.B4,m=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,n.jsxs)(r.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[s,(0,n.jsx)(r.JO,{asChild:!0,children:(0,n.jsx)(o.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=r.xz.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})});f.displayName=r.$G.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,position:o="popper",...i}=e;return(0,n.jsx)(r.h_,{children:(0,n.jsxs)(r.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:o,...i,children:[(0,n.jsx)(h,{}),(0,n.jsx)(r.l_,{className:(0,c.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,n.jsx)(f,{})]})})});x.displayName=r.VY.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})}).displayName=r.__.displayName;let p=s.forwardRef((e,t)=>{let{className:a,children:s,...o}=e;return(0,n.jsxs)(r.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(r.wU,{children:(0,n.jsx)(l.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(r.eT,{children:s})]})});p.displayName=r.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=r.Z0.displayName},76818:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var n=a(57437),s=a(2265),r=a(94508);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});o.displayName="Textarea"},89534:function(e,t,a){"use strict";a.d(t,{FN:function(){return m},Mi:function(){return x},VW:function(){return c},_i:function(){return d},gD:function(){return h},lj:function(){return p},sA:function(){return f}});var n=a(57437),s=a(2265),r=a(41915),o=a(90535),i=a(32489),l=a(94508);let c=r.zt,d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.l_,{ref:t,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),...s})});d.displayName=r.l_.displayName;let u=(0,o.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),m=s.forwardRef((e,t)=>{let{className:a,variant:s,...o}=e;return(0,n.jsx)(r.fC,{ref:t,className:(0,l.cn)(u({variant:s}),a),...o})});m.displayName=r.fC.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.aU,{ref:t,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",a),...s})});h.displayName=r.aU.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.x8,{ref:t,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});f.displayName=r.x8.displayName;let x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Dx,{ref:t,className:(0,l.cn)("text-sm font-semibold",a),...s})});x.displayName=r.Dx.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.dk,{ref:t,className:(0,l.cn)("text-sm opacity-90",a),...s})});p.displayName=r.dk.displayName},77992:function(e,t,a){"use strict";a.d(t,{pm:function(){return m}});var n=a(2265);let s=0,r=new Map,o=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},i=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?o(a):e.toasts.forEach(e=>{o(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],c={toasts:[]};function d(e){c=i(c,e),l.forEach(e=>{e(c)})}function u(e){let{...t}=e,a=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),n=()=>d({type:"DISMISS_TOAST",toastId:a});return d({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:e=>{e||n()}}}),{id:a,dismiss:n,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:a}})}}function m(){let[e,t]=n.useState(c);return n.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},30190:function(e){e.exports={automationsLayout:"automations_automationsLayout__Atoh_",automationCard:"automations_automationCard__BKidA",pageLayout:"automations_pageLayout__OaoYA",sidePanel:"automations_sidePanel__MPciO"}}},function(e){e.O(0,[3194,5540,8407,8667,5401,8117,1915,5473,2813,2971,2117,1744],function(){return e(e.s=2743)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3317,244,8459,7138],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,74723))},74723:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(63136),n=s.n(o),i=s(2265),r=s(92813),l=s(62264),c=s(99376),d=s(14308),u=s(59199);s(2446);var h=s(7436),m=s(5477),g=s(56937);function f(e){let t=(0,c.useSearchParams)().get("conversationId"),[s,o]=(0,i.useState)(""),[r,d]=(0,i.useState)([]),[u,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(null),[p,x]=(0,i.useState)(!1),_=(0,i.useRef)(null),y=e.setQueryToProcess,w=e.onConversationIdChange,S=e.isMobileWidth?"w-full":"w-4/6";if((0,i.useEffect)(()=>{if(r.length>0){let t=r.map(e=>encodeURIComponent(e));e.setImages(t)}},[r,e.setImages]),(0,i.useEffect)(()=>{let t=localStorage.getItem("images");if(t){let s=JSON.parse(t);d(s);let a=s.map(e=>encodeURIComponent(e));e.setImages(a),localStorage.removeItem("images")}let s=localStorage.getItem("message");s&&(h(!0),y(s),s.trim().startsWith("/research")&&x(!0));let a=localStorage.getItem("uploadedFiles");if(a){let t=a?JSON.parse(a):[],s=[];for(let e of t)s.push({name:e.name,file_type:e.file_type,content:e.content,size:e.size});localStorage.removeItem("uploadedFiles"),e.setUploadedFiles(s)}},[y,e.setImages,t]),(0,i.useEffect)(()=>{s&&(h(!0),y(s))},[s,y]),(0,i.useEffect)(()=>{t&&(null==w||w(t))},[t,w]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?(h(!1),d([]),e.setUploadedFiles(void 0)):o("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(l.Z,{conversationId:t,setTitle:e.setTitle,setAgent:f,pendingMessage:u?s:"",incomingMessages:e.streamedMessages,setIncomingMessages:e.setStreamedMessages,customClassName:S})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(S," mr-auto ml-auto"),children:(0,a.jsx)(m.a,{agentColor:null==g?void 0:g.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>o(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:u,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,ref:_,isResearchModeEnabled:p,setTriggeredAbort:e.setTriggeredAbort})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,l]=(0,i.useState)(!0),[c,m]=(0,i.useState)(e),[p,x]=(0,i.useState)(null),[_,y]=(0,i.useState)([]),[w,S]=(0,i.useState)(""),[I,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(void 0),[C,B]=(0,i.useState)([]),[E,M]=(0,i.useState)(null),[T,k]=(0,i.useState)(!1),{locationData:F,locationDataError:R,locationDataLoading:N}=(0,h.k6)()||{locationData:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}},O=(0,g.GW)(),D=(0,h.IC)();async function W(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,a="␃\uD83D\uDD1A␗",o="",n=[],i={},r={};for(;;){let e;let{done:l,value:c}=await t.read();if(l){S(""),b(!1),B([]),p&&(0,u.tQ)(p,m);break}for(o+=s.decode(c,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i,codeContext:r}=(0,u.VK)(t,e,n,i,r)),y([..._])}}}}async function P(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...F&&{city:F.city,region:F.region,country:F.country,country_code:F.countryCode,timezone:F.timezone},...C.length>0&&{images:C},...v&&{files:v}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:null==E?void 0:E.signal});try{await W(t)}catch(n){let e=await t.json();console.error(e);let s=_.find(e=>!e.completed);if(!s)return;let a=n.message,o=n.name;a.includes("Error in input stream")?s.rawResponse="Woops! The connection broke while I was writing my thoughts down. Maybe try again in a bit or dislike this message if the issue persists?":429===t.status?"detail"in e?s.rawResponse="".concat(e.detail):s.rawResponse="I'm a bit overwhelmed at the moment. Could you try again in a bit or dislike this message if the issue persists?":"AbortError"===o?s.rawResponse="I've stopped processing this message. If you'd like to continue, please send the message again.":s.rawResponse="Umm, not sure what just happened. I see this error message: ".concat(a,". Could you try again or dislike this message if the issue persists?"),s.completed=!0,y([..._]),S(""),b(!1)}}return(0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{l(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{T&&(null==E||E.abort(),function(){let e=_.find(e=>!e.completed);e&&(e.completed=!0,y([..._]),S(""),b(!1))}(),k(!1))}),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},codeContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",images:C,queryFiles:v};y(t=>[...t,e]),b(!0),M(new AbortController)}},[w]),(0,i.useEffect)(()=>{I&&!N&&P()},[I,N]),o?(0,a.jsx)(d.Z,{}):(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:"".concat(e).concat(c&&c!==e?": ".concat(c):"")}),(0,a.jsx)("div",{className:D?"h-1":"h-auto",children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:[],isMobileWidth:D})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[p&&(0,a.jsxs)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mx-2 md:mr-8 md:pt-6 col-auto h-fit"),children:[c&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:c}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:D?"sm":"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==O,streamedMessages:_,setStreamedMessages:y,chatOptionsData:t,setTitle:m,setQueryToProcess:S,setUploadedFiles:j,isMobileWidth:D,onConversationIdChange:e=>{x(e)},setImages:B,setTriggeredAbort:k})})]})})]})}},99376:function(e,t,s){"use strict";var a=s(35475);s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},63136:function(e){e.exports={main:"chat_main__8xQu5",suggestions:"chat_suggestions__m8n2t",inputBox:"chat_inputBox__LOFws",chatBodyFull:"chat_chatBodyFull__FfKEK",chatBody:"chat_chatBody__sS1LX",chatLayout:"chat_chatLayout__pR203",chatBox:"chat_chatBox__FBct_",titleBar:"chat_titleBar__R5QlK",chatBoxBody:"chat_chatBoxBody__qT_SC",agentIndicator:"chat_agentIndicator__8V55w",chatTitleWrapper:"chat_chatTitleWrapper__6ChWq"}}},function(e){e.O(0,[5540,3194,2664,3954,8407,8667,5401,6589,9058,2781,2813,5477,2264,2971,2117,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{1507:function(e,t,i){Promise.resolve().then(i.bind(i,93866))},93866:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return J}});var n,a,o=i(57437);i(47960);var r=i(76777),s=i.n(r);i(2446);var l=i(2265),c=i(63861),d=i(49656);let p=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var u=Object.defineProperty,h=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,k=(e,t,i)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))f.call(t,i)&&k(e,i,t[i]);if(m)for(var i of m(t))y.call(t,i)&&k(e,i,t[i]);return e},w=(e,t)=>h(e,g(t));let v=(0,l.forwardRef)((e,t)=>l.createElement(d.Z,w(b({ref:t},e),{weights:p})));v.displayName="ArrowCounterClockwise";var x=i(66070),L=i(64670),C=i.n(L),j=i(42225);(n=a||(a={})).Automation="Automation",n.Paint="Paint",n.Travel="Travel",n.Health="Health",n.Learning="Learning",n.Math="Mathematics",n.Language="Language",n.PopCulture="Pop Culture",n.Food="Food",n.Interviewing="Interviewing",n.Home="Home",n.Fun="Fun",n.Code="Code",n.Finance="Finance";let P={};P.Automation="blue",P.Paint="indigo",P.Travel="yellow",P.Health="teal",P.Learning="purple",P.Language="blue",P["Pop Culture"]="red",P.Food="yellow",P.Interviewing="orange",P.Home="green",P.Fun="fuchsia",P.Code="purple",P.Finance="green",P.Mathematics="blue";let S="orange",A=[{type:"Automation",color:P.Automation||S,description:"Send me a summary of HackerNews every morning.",link:"/automations?subject=Summarizing%20Top%20Headlines%20from%20HackerNews&query=Summarize%20the%20top%20headlines%20on%20HackerNews&crontime=00%207%20*%20*%20*"},{type:"Automation",color:P.Automation||S,description:"Compose a bedtime story that a five-year-old might enjoy.",link:"/automations?subject=Daily%20Bedtime%20Story&query=Compose%20a%20bedtime%20story%20that%20a%20five-year-old%20might%20enjoy.%20It%20should%20not%20exceed%20five%20paragraphs.%20Appeal%20to%20the%20imagination%2C%20but%20weave%20in%20learnings.&crontime=0%2021%20*%20*%20*"},{type:"Paint",color:P.Paint||S,description:"Paint a picture of a sunset but it's made of stained glass tiles",link:""},{type:"Travel",color:P.Travel||S,description:"Search for the best attractions in Austria Hungary",link:""},{type:"Health",color:P.Health||S,description:"Generate a weekly meal plan with recipes.",link:"/automations?subject=Weekly Meal Plan&query=Create a weekly meal plan with 7 dinner recipes, including ingredients and brief instructions. Focus on balanced, healthy meals.&crontime=0 18 * * 0"},{type:"Paint",color:P.Paint||S,description:"Paint a futuristic cityscape with flying cars.",link:""},{type:"Travel",color:P.Travel||S,description:"Find the top-rated coffee shops in Seattle.",link:""},{type:"Automation",color:P.Automation||S,description:"Send daily motivational quotes.",link:"/automations?subject=Daily Motivation&query=Provide an inspiring quote for the day along with a brief explanation of its meaning.&crontime=0 7 * * *"},{type:"Paint",color:P.Paint||S,description:"Create an abstract representation of jazz music.",link:""},{type:"Learning",color:P.Learning||S,description:"Research the history of the Eiffel Tower.",link:""},{type:"Automation",color:P.Automation||S,description:"Compile a weekly news summary.",link:"/automations?subject=Weekly News Digest&query=Summarize the top 5 most important news stories of the week across various categories.&crontime=0 18 * * 5"},{type:"Paint",color:P.Paint||S,description:"Paint a portrait of a cat wearing a Victorian-era costume.",link:""},{type:"Travel",color:P.Travel||S,description:"Find beginner-friendly hiking trails near Los Angeles.",link:""},{type:"Automation",color:P.Automation||S,description:"Generate a daily writing prompt.",link:"/automations?subject=Daily Writing Prompt&query=Create an engaging writing prompt suitable for short story or journal writing.&crontime=0 9 * * *"},{type:"Paint",color:P.Paint||S,description:"Create a surrealist landscape inspired by Salvador Dali.",link:""},{type:"Learning",color:P.Learning||S,description:"Research the benefits and drawbacks of electric vehicles.",link:""},{type:"Automation",color:P.Automation||S,description:"Send weekly language learning tips for Spanish.",link:"/automations?subject=Spanish Learning Tips&query=Provide a useful Spanish language learning tip, including vocabulary, grammar, or cultural insight.&crontime=0 19 * * 2"},{type:"Paint",color:P.Paint||S,description:"Paint a scene from a fairy tale in the style of Studio Ghibli.",link:""},{type:"Pop Culture",color:"yellow",description:"Find the best-rated science fiction books of the last decade.",link:""},{type:"Paint",color:P.Paint||S,description:"Paint a still life of exotic fruits in a neon color palette.",link:""},{type:"Travel",color:P.Travel||S,description:"Research the most eco-friendly cities in Europe.",link:""},{type:"Automation",color:P.Automation||S,description:"Send daily reminders for habit tracking.",link:"/automations?subject=Habit Tracker&query=Generate a daily reminder to track habits, including a motivational message.&crontime=0 20 * * *"},{type:"Paint",color:P.Paint||S,description:"Create a digital painting of a cyberpunk street market.",link:""},{type:"Learning",color:P.Learning||S,description:"Summarize the biography of this figure: https://en.wikipedia.org/wiki/Jean_Baptiste_Point_du_Sable",link:""},{type:"Language",color:"blue",description:"Send daily Spanish phrases used in Latin America.",link:"/automations?subject=Daily Latin American Spanish&query=Provide a common Spanish phrase or slang term used in Latin America, its meaning, and an example of usage. Include which countries it's most common in.&crontime=0 8 * * *"},{type:"Paint",color:P.Paint||S,description:"Create a vibrant painting inspired by Frida Kahlo's style.",link:""},{type:"Food",color:P.Food||S,description:"Find the best empanada recipe from Colombia.",link:""},{type:"Automation",color:P.Automation||S,description:"Weekly update on the Brazilian startup ecosystems.",link:"/automations?subject=LatAm Startup News&query=Provide a summary of the most significant developments in Latin American startup ecosystems this week. Include notable funding rounds, expansions, or policy changes.&crontime=0 18 * * 5"},{type:"Paint",color:P.Paint||S,description:"Paint a colorful scene of a traditional Day of the Dead celebration in Mexico.",link:""},{type:"Language",color:P.Language||S,description:"Daily Swahili phrase with English translation.",link:"/automations?subject=Daily Swahili Lesson&query=Provide a common Swahili phrase or proverb, its English translation, and a brief explanation of its cultural significance in East Africa.&crontime=0 7 * * *"},{type:"Paint",color:P.Paint||S,description:"Create a digital painting of the Serengeti during wildebeest migration.",link:""},{type:"Learning",color:P.Learning||S,description:"Research the top M-Pesa alternatives in East Africa.",link:""},{type:"Automation",color:P.Automation||S,description:"Weekly update on East African tech startups and innovations.",link:"/automations?subject=East African Tech News&query=Summarize the most significant developments in East African tech startups and innovations this week. Include notable funding rounds, new product launches, or policy changes affecting the tech ecosystem.&crontime=0 18 * * 5"},{type:"Paint",color:P.Paint||S,description:"Paint a colorful scene inspired by Maasai traditional clothing and jewelry.",link:""},{type:"Automation",color:P.Automation||S,description:"Weekly summary of EU policy changes and their impact.",link:"/automations?subject=EU Policy Update&query=Summarize the most significant EU policy changes or proposals from this week. Explain their potential impact on European citizens and businesses.&crontime=0 17 * * 5"},{type:"Paint",color:P.Paint||S,description:"Paint a digital landscape of the Northern Lights over the Norwegian fjords.",link:""},{type:"Automation",color:P.Automation||S,description:"Daily East Asian proverb with explanation.",link:"/automations?subject=East Asian Wisdom&query=Provide a proverb from an East Asian language (rotating through Chinese, Japanese, Korean, etc.), its English translation, and a brief explanation of its cultural significance and practical application.&crontime=0 7 * * *"},{type:"Paint",color:P.Paint||S,description:"Create a digital painting in the style of traditional Chinese ink wash landscape.",link:""},{type:"Pop Culture",color:"yellow",description:"Research the latest trends in K-pop and its global influence.",link:""},{type:"Automation",color:P.Automation||S,description:"Weekly summary of technological innovations from East Asian tech giants.",link:"/automations?subject=East Asian Tech Update&query=Summarize the most significant technological innovations or product launches from major East Asian tech companies (e.g., Samsung, Sony, Alibaba, Tencent) this week. Explain their potential impact on global markets.&crontime=0 18 * * 5"},{type:"Paint",color:P.Paint||S,description:"Paint a vibrant scene of a Japanese cherry blossom festival.",link:""},{type:"Automation",color:P.Automation||S,description:"Daily South Asian recipe with cultural significance.",link:"/automations?subject=South Asian Culinary Journey&query=Provide a traditional South Asian recipe (rotating through Indian, Pakistani, Bangladeshi, Sri Lankan, etc. cuisines), including ingredients, brief instructions, and its cultural significance or origin story.&crontime=0 10 * * *"},{type:"Pop Culture",color:P["Pop Culture"]||S,description:"Research the impact of Bollywood on global cinema and fashion.",link:""},{type:"Automation",color:P.Automation||S,description:"Weekly update on South Asian startup ecosystems and innovations.",link:"/automations?subject=South Asian Startup Pulse&query=Summarize the most significant developments in South Asian startup ecosystems this week. Include notable funding rounds, innovative solutions to local challenges, and any policy changes affecting the tech landscape in countries like India, Bangladesh, Pakistan, and Sri Lanka.&crontime=0 18 * * 5"},{type:"Interviewing",color:P.Interviewing||S,description:"Create interview prep questions for a consulting job.",link:""},{type:"Interviewing",color:P.Interviewing||S,description:"What information should I include in a CV for a PhD application?",link:""},{type:"Home",color:P.Home||S,description:"Recommend plants that can grow well indoors.",link:""},{type:"Health",color:P.Health||S,description:"Suggest healthy meal prep ideas for a busy work week.",link:""},{type:"Learning",color:P.Learning||S,description:"List effective time management techniques for students.",link:""},{type:"Learning",color:P.Learning||S,description:"Provide tips for improving public speaking skills.",link:""},{type:"Learning",color:P.Learning||S,description:"Recommend books for learning about personal finance.",link:""},{type:"Home",color:P.Home||S,description:"Suggest ways to reduce plastic waste in daily life.",link:""},{type:"Health",color:P.Health||S,description:"Create a beginner's guide to meditation and mindfulness.",link:""},{type:"Health",color:P.Health||S,description:"Give me some tips for improving my sleep quality.",link:""},{type:"Health",color:P.Health||S,description:"What are weight loss strategies supported by clinical studies?",link:""},{type:"Fun",color:P.Fun||S,description:"List creative date ideas for couples on a budget.",link:""},{type:"Code",color:P.Interviewing||S,description:"Provide tips for writing an effective resume.",link:""},{type:"Code",color:P.Code||S,description:"Explain the concept of recursion with a simple coding example.",link:""},{type:"Code",color:P.Code||S,description:"Provide a coding challenge to reverse a string without using built-in functions.",link:""},{type:"Code",color:P.Code||S,description:"Explain the difference between 'let', 'const', and 'var' in JavaScript.",link:""},{type:"Code",color:P.Code||S,description:"Create a coding exercise to implement a basic sorting algorithm (e.g., bubble sort).",link:""},{type:"Code",color:P.Code||S,description:"Explain object-oriented programming principles with a simple class example.",link:""},{type:"Code",color:P.Code||S,description:"Provide a coding challenge to find the longest palindromic substring in a given string.",link:""},{type:"Code",color:P.Code||S,description:"Explain the concept of asynchronous programming with a JavaScript Promise example.",link:""},{type:"Code",color:P.Code||S,description:"Create a coding exercise to implement a basic data structure (e.g., linked list or stack).",link:""},{type:"Code",color:P.Code||S,description:"Explain the time and space complexity of common algorithms (e.g., binary search).",link:""},{type:"Code",color:P.Code||S,description:"Provide a coding challenge to implement a simple REST API using Node.js and Express.",link:""},{type:"Code",color:P.Code||S,description:"Compare popular web frameworks in Rust and Python",link:""},{type:"Travel",color:P.Travel||S,description:"Craft an off-beat itinerary for a weekend in Lagos, Nigeria.",link:""},{type:"Language",color:P.Language||S,description:"Teach me about declensions in Latin.",link:""},{type:"Learning",color:P.Learning||S,description:"Break down the concept of photosynthesis for a middle school student.",link:""},{type:"Learning",color:P.Learning||S,description:"Use the Socratic method to explore the causes of World War I.",link:""},{type:"Learning",color:P.Learning||S,description:"Explain the water cycle using an analogy suitable for elementary students.",link:""},{type:"Learning",color:P.Learning||S,description:"Guide a high school student through solving a quadratic equation step-by-step.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a series of questions to help a student discover the principles of basic economics.",link:""},{type:"Learning",color:P.Learning||S,description:"Develop a hands-on experiment to demonstrate the concept of density to middle schoolers.",link:""},{type:"Learning",color:P.Learning||S,description:"Use guided discovery to help a student understand the structure of DNA.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a personalized learning plan for a student struggling with grammar concepts.",link:""},{type:"Learning",color:P.Learning||S,description:"Design a series of questions to encourage critical thinking about climate change.",link:""},{type:"Learning",color:P.Learning||S,description:"Develop a step-by-step guide for conducting a basic science experiment on plant growth.",link:""},{type:"Health",color:P.Health||S,description:"Provide a detailed explanation about how to manage type 2 diabetes.",link:""},{type:"Health",color:P.Health||S,description:"Explain the effects a stroke might have on the body.",link:""},{type:"Health",color:P.Health||S,description:"Describe the recommended steps for preventing heart disease.",link:""},{type:"Health",color:P.Health||S,description:"Explain the differences between various types of headaches and their treatments.",link:""},{type:"Health",color:P.Health||S,description:"Provide an overview of the most effective stress management techniques.",link:""},{type:"Health",color:P.Health||S,description:"Explain the importance of vaccination and how vaccines work.",link:""},{type:"Health",color:P.Health||S,description:"Describe the symptoms and treatment options for depression.",link:""},{type:"Health",color:P.Health||S,description:"Explain the process of digestion and common digestive disorders.",link:""},{type:"Health",color:P.Health||S,description:"Provide an overview of the different types of cancer screenings and their importance.",link:""},{type:"Health",color:P.Health||S,description:"Explain the effects of sleep deprivation on physical and mental health.",link:""},{type:"Fun",color:P.Fun||S,description:"Create a list of fun activities for a family game night.",link:""},{type:"Finance",color:P.Finance||S,description:"Explain the concept of compound interest and its importance in long-term savings.",link:""},{type:"Finance",color:P.Finance||S,description:"Provide an overview of different types of retirement accounts (e.g., 401(k), IRA, Roth IRA).",link:""},{type:"Finance",color:P.Finance||S,description:"Describe strategies for creating and sticking to a personal budget.",link:""},{type:"Finance",color:P.Finance||S,description:"Explain the basics of stock market investing for beginners.",link:""},{type:"Finance",color:P.Finance||S,description:"Outline the pros and cons of renting vs. buying a home.",link:""},{type:"Finance",color:P.Finance||S,description:"Describe different methods for paying off debt, such as the snowball and avalanche methods.",link:""},{type:"Finance",color:P.Finance||S,description:"Explain the importance of an emergency fund and how to build one.",link:""},{type:"Finance",color:P.Finance||S,description:"Provide an overview of different types of insurance and their importance in financial planning.",link:""},{type:"Finance",color:P.Finance||S,description:"Explain the concept of diversification in investment portfolios.",link:""},{type:"Finance",color:P.Finance||S,description:"Describe strategies for minimizing tax liability legally.",link:""},{type:"Finance",color:P.Finance||S,description:"Draw a diagram illustrating the flow of money in a personal budget.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a mind map summarizing key concepts from the Industrial Revolution.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a diagram of the life cycle of a flowering plant.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a diagram illustrating the structure of the United States government.",link:""},{type:"Code",color:P.Code||S,description:"Draw a diagram illustrating the architecture of a computer network.",link:""},{type:"Health",color:P.Health||S,description:"Draw a diagram of the digestive system.",link:""},{type:"Travel",color:P.Travel||S,description:"Create a sample flow chart of a travel itinerary for CDMX.",link:""},{type:"Food",color:P.Food||S,description:"Draw a diagram illustrating the steps in a recipe for lasagna.",link:""},{type:"Fun",color:P.Fun||S,description:"Draw a diagram of a basketball court, labeling the different positions.",link:""},{type:"Code",color:P.Code||S,description:"Draw a diagram of a simple electrical circuit.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a diagram illustrating the notes on a musical staff.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a plot diagram of A Tale of Two Cities.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a timeline of major events in World War II.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a free-body diagram of a falling object.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw the Lewis structure of a water molecule.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a diagram of the layers of the Earth.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a diagram of the solar system.",link:""},{type:"Learning",color:P.Learning||S,description:"Draw a graph of the equation y = x^2.",link:""},{type:"Mathematics",color:P.Mathematics||S,description:"Create a chart for the sine and cosine functions over one period.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a bar chart comparing the average monthly temperatures of two cities.",link:""},{type:"Finance",color:P.Finance||S,description:"Create a line chart showing the GDP growth rate over the last decade.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart for historical rainfall in Karachi last year.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart showing the trend in smartphone usage in Korea over the past five years.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart comparing the performance statistics of Lebron James and Kobe Bryant.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart showing historical casualties in major wars.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart illustrating the relationship between velocity and time.",link:""},{type:"Learning",color:P.Learning||S,description:"Create a chart showing the frequency of earthquakes over the past century.",link:""},{type:"Mathematics",color:P.Mathematics||S,description:"Create a scatter plot of a set of random data points.",link:""}];function E(e){var t,i;let n="".concat(C().card," md:w-full md:h-fit sm:w-full h-fit md:w-[200px] md:h-[180px] cursor-pointer md:p-2"),a="".concat(C().text," dark:text-white"),r=(0,o.jsx)(x.Zb,{className:n,children:(0,o.jsx)("div",{className:"flex w-full",children:(0,o.jsxs)(x.aY,{className:"m-0 p-2 w-full",children:[(t=e.title,i=e.color.toLowerCase(),"Automation"===t?(0,j.TI)("Robot",i,"w-6","h-6"):"Paint"===t?(0,j.TI)("Palette",i,"w-6","h-6"):"Pop Culture"===t?(0,j.TI)("Confetti",i,"w-6","h-6"):"Travel"===t?(0,j.TI)("Jeep",i,"w-6","h-6"):"Learning"===t?(0,j.TI)("Book",i,"w-6","h-6"):"Health"===t?(0,j.TI)("Asclepius",i,"w-6","h-6"):"Fun"===t?(0,j.TI)("Island",i,"w-6","h-6"):"Home"===t?(0,j.TI)("House",i,"w-6","h-6"):"Language"===t?(0,j.TI)("Translate",i,"w-6","h-6"):"Code"===t?(0,j.TI)("Code",i,"w-6","h-6"):"Food"===t?(0,j.TI)("BowlFood",i,"w-6","h-6"):"Interviewing"===t?(0,j.TI)("Lectern",i,"w-6","h-6"):"Finance"===t?(0,j.TI)("Wallet",i,"w-6","h-6"):"Mathematics"===t?(0,j.TI)("MathOperations",i,"w-6","h-6"):(0,j.TI)("Lightbulb",i,"w-6","h-6")),(0,o.jsx)(x.SZ,{className:"".concat(a," sm:line-clamp-2 md:line-clamp-4 pt-1 break-words whitespace-pre-wrap max-w-full"),children:e.body})]})})});return e.link?(0,o.jsx)("a",{href:e.link,className:"no-underline",children:r}):r}var H=i(92813),F=i(14308),I=i(5477),M=i(33494),_=i(56937),D=i(84671),N=i(59199),T=i(7436),W=i(99376),B=i(19378),q=i(9262),O=i(57054),R=i(62869),z=i(37104),U=i(17814);function Z(e){return e.isMobileWidth?(0,o.jsx)(U.dy,{open:!0,onClose:()=>e.setShowLoginPrompt(!1),children:(0,o.jsx)(U.sc,{children:(0,o.jsx)(V,{...e})})}):(0,o.jsx)("div",{className:"fixed inset-x-0 bottom-8 z-30 flex items-center justify-center",children:(0,o.jsx)(V,{...e})})}function V(e){return(0,o.jsxs)(x.Zb,{className:"rounded-lg p-6 flex flex-col items-center justify-between gap-8 md:w-fit border-none md:flex-row md:z-30 md:shadow-lg",children:[!e.isMobileWidth&&(0,o.jsx)(z.S6,{className:"w-12 h-auto"}),(0,o.jsxs)("div",{className:"flex flex-col items-start justify-center gap-8 md:gap-2",children:[(0,o.jsx)(x.Ol,{className:"p-0 text-xl font-bold",children:"Welcome to Khoj!"}),(0,o.jsx)(x.SZ,{children:"Sign in to get started with Khoj, your AI research assistant."})]}),(0,o.jsx)(R.z,{variant:"default",className:"p-6 text-lg",onClick:()=>e.setShowLoginPrompt(!0),children:"Get started for free"})]})}function G(e){var t,i;let[n,a]=(0,l.useState)(""),[r,d]=(0,l.useState)([]),[p,u]=(0,l.useState)(!1),[h,g]=(0,l.useState)(""),[m,f]=(0,l.useState)([]),[y,k]=(0,l.useState)(null),b=(0,T.Nr)(y,500),[w,L]=(0,l.useState)(!1),[C,P]=(0,l.useState)("khoj"),[S,H]=(0,l.useState)([]),[F,R]=(0,l.useState)([]),z=(0,l.useRef)(null),[U,V]=(0,l.useState)(!1),G=(0,W.useRouter)(),J=(0,W.useSearchParams)().get("q");(0,l.useEffect)(()=>{J&&a(decodeURIComponent(J))},[J]),(0,l.useEffect)(()=>{b&&L(!0)},[b]);let K=e.onConversationIdChange,{data:Y,error:Q}=(0,c.ZP)("agents",()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),{revalidateOnFocus:!1}),X=e=>{G.push("/agents?agent=".concat(e))};function $(){f((function(e){for(let t=e.length-1;t>0;t--){let i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]]}return e})(A).slice(0,3))}return(0,l.useEffect)(()=>{var t,i;if(e.isLoadingUserConfig)return;let n=new Date,a=n.getDay(),o=n.getHours()>=17||4>n.getHours()?"evening":n.getHours()>=12?"afternoon":"morning",r=(null===(t=e.userConfig)||void 0===t?void 0:t.given_name)?", ".concat(null===(i=e.userConfig)||void 0===i?void 0:i.given_name):"",s=["What would you like to get done".concat(r,"?"),"Hey".concat(r,"! How can I help?"),"Good ".concat(o).concat(r,"! What's on your mind?"),"Ready to breeze through ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a],"?"),"Let's navigate your ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a]," workload")];g(s[Math.floor(Math.random()*s.length)])},[e.isLoadingUserConfig,e.userConfig]),(0,l.useEffect)(()=>{e.chatOptionsData&&$()},[e.chatOptionsData]),(0,l.useEffect)(()=>{let e=(Y||[]).filter(e=>null!=e);R(e),P(e.length>1?e[0].slug:"khoj"),H(e.map(e=>(0,j.TI)(e.icon,e.color)))},[Y,e.isMobileWidth]),(0,l.useEffect)(()=>{(async()=>{if(n&&!p){u(!0);try{let e=await (0,N.A0)(C||"khoj");null==K||K(e),localStorage.setItem("message",n),r.length>0&&localStorage.setItem("images",JSON.stringify(r)),window.location.href="/chat?conversationId=".concat(e)}catch(e){console.error("Error creating new conversation:",e),u(!1)}a(""),d([])}})(),(n||r.length>0)&&u(!0)},[C,n,p,K]),(0,l.useEffect)(()=>{let e=document.querySelector("[data-radix-scroll-area-viewport]"),t=()=>{k(null),L(!1)};return null==e||e.addEventListener("scroll",t),()=>null==e?void 0:e.removeEventListener("scroll",t)},[]),(0,o.jsxs)("div",{className:"".concat(s().homeGreetings," w-full md:w-auto"),children:[U&&(0,o.jsx)(M.Z,{onOpenChange:V,isMobileWidth:e.isMobileWidth,loginRedirectMessage:"Login to your second brain"}),!e.isLoggedIn&&(0,o.jsx)(Z,{isMobileWidth:e.isMobileWidth,setShowLoginPrompt:V}),(0,o.jsxs)("div",{className:"w-full text-center justify-end content-end",children:[(0,o.jsx)("div",{className:"items-center",children:(0,o.jsx)("h1",{className:"text-2xl md:text-3xl text-center w-fit pb-6 px-4 mx-auto",children:h})}),!e.isMobileWidth&&(0,o.jsxs)(B.x,{className:"w-full max-w-[600px] mx-auto",children:[(0,o.jsx)("div",{className:"flex pb-2 gap-2 items-center justify-center",children:F.map((t,i)=>(0,o.jsxs)(O.J2,{open:w&&b===t.slug,onOpenChange:e=>{e||(k(null),L(!1))},children:[(0,o.jsx)(O.xo,{asChild:!0,children:(0,o.jsx)(x.Zb,{className:"".concat(C===t.slug?(0,D.Iu)(t.color):"border-stone-100 dark:border-neutral-700 text-muted-foreground","\n hover:cursor-pointer rounded-lg px-2 py-2"),onDoubleClick:()=>X(t.slug),onClick:()=>{var e;P(t.slug),null===(e=z.current)||void 0===e||e.focus(),k(null),L(!1)},onMouseEnter:()=>k(t.slug),onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsxs)(x.ll,{className:"text-center text-md font-medium flex justify-center items-center whitespace-nowrap",children:[S[i]," ",t.name]})})}),(0,o.jsx)(O.yk,{className:"w-80 p-0 border-none bg-transparent shadow-none",onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsx)(q.EY,{data:t,userProfile:null,isMobileWidth:e.isMobileWidth||!1,showChatButton:!1,editCard:!1,filesOptions:[],selectedChatModelOption:"",agentSlug:"",isSubscribed:(0,_.T8)(e.userConfig),setAgentChangeTriggered:()=>{},modelOptions:[],inputToolOptions:{},outputModeOptions:{}})})]},"".concat(i,"-").concat(t.slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]})]}),(0,o.jsxs)("div",{className:"mx-auto ".concat(e.isMobileWidth?"w-full":"w-fit max-w-screen-md"),children:[!e.isMobileWidth&&(0,o.jsx)("div",{className:"w-full ".concat(s().inputBox," shadow-lg bg-background align-middle items-center justify-center px-3 py-1 dark:bg-neutral-700 border-stone-100 dark:border-none dark:shadow-none rounded-2xl"),children:(0,o.jsx)(I.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(t=F.find(e=>e.slug===C))||void 0===t?void 0:t.color,ref:z,setTriggeredAbort:()=>{}})}),(0,o.jsx)("div",{className:"".concat(s().suggestions," w-full ").concat(e.isMobileWidth?"grid":"flex flex-row"," justify-center items-center"),children:m.map((t,i)=>(0,o.jsx)("div",{onClick:i=>{e.isLoggedIn?function(e,t,i){if(!e){let e="";i=i.charAt(0).toLowerCase()+i.slice(1),e="Online Search"===t?"/online "+i:"Paint"===t?"/image "+i:i;let n=document.getElementById("message");n&&(n.value=e,a(e))}}(t.link,t.type,t.description):(i.preventDefault(),i.stopPropagation(),V(!0))},children:(0,o.jsx)(E,{title:t.type,body:t.description,link:t.link,color:t.color},t.type+Math.random())},"".concat(t.type," ").concat(t.description)))}),(0,o.jsx)("div",{className:"flex items-center justify-center margin-auto",children:(0,o.jsxs)("button",{onClick:function(){$()},className:"m-2 p-1.5 rounded-lg dark:hover:bg-[var(--background-color)] hover:bg-stone-100 border border-stone-100 text-sm text-stone-500 dark:text-stone-300 dark:border-neutral-700",children:["More Ideas ",(0,o.jsx)(v,{className:"h-4 w-4 inline"})]})})]}),e.isMobileWidth&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"".concat(s().inputBox," pt-1 shadow-[0_-20px_25px_-5px_rgba(0,0,0,0.1)] dark:bg-neutral-700 bg-background align-middle items-center justify-center pb-3 mx-1 rounded-t-2xl rounded-b-none"),children:[(0,o.jsxs)(B.x,{className:"w-full max-w-[85vw]",children:[(0,o.jsx)("div",{className:"flex gap-2 items-center justify-left pt-1 pb-2 px-12",children:S.map((e,t)=>(0,o.jsx)(x.Zb,{className:"".concat(C===F[t].slug?(0,D.Iu)(F[t].color):"border-muted text-muted-foreground"," hover:cursor-pointer"),children:(0,o.jsxs)(x.ll,{className:"text-center text-xs font-medium flex justify-center items-center whitespace-nowrap px-1.5 py-1",onDoubleClick:()=>X(F[t].slug),onClick:()=>{var e;P(F[t].slug),null===(e=z.current)||void 0===e||e.focus()},children:[e," ",F[t].name]})},"".concat(t,"-").concat(F[t].slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]}),(0,o.jsx)(I.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(i=F.find(e=>e.slug===C))||void 0===i?void 0:i.color,ref:z,setTriggeredAbort:()=>{}})]})})]})}function J(){let[e,t]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0),[a,r]=(0,l.useState)(null),[c,d]=(0,l.useState)(null),p=(0,T.IC)(),{userConfig:u,isLoadingUserConfig:h}=(0,_.h2)(!0),[g,m]=(0,l.useState)(null),f=(0,_.GW)();return((0,l.useEffect)(()=>{m(u)},[u]),(0,l.useEffect)(()=>{c&&localStorage.setItem("uploadedFiles",JSON.stringify(c))},[c]),(0,l.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{n(!1),e&&t(e)}).catch(e=>{console.error(e)})},[]),i)?(0,o.jsx)(F.Z,{}):(0,o.jsxs)("div",{className:"".concat(s().main," ").concat(s().chatLayout),children:[(0,o.jsx)("title",{children:"Khoj AI - Your Second Brain"}),(0,o.jsx)("div",{className:"".concat(s().sidePanel),children:(0,o.jsx)(H.ZP,{conversationId:a,uploadedFiles:[],isMobileWidth:p})}),(0,o.jsx)("div",{className:"".concat(s().chatBox),children:(0,o.jsx)("div",{className:"".concat(s().chatBoxBody),children:(0,o.jsx)(G,{isLoggedIn:null!==f,chatOptionsData:e,setUploadedFiles:d,isMobileWidth:p,onConversationIdChange:e=>{r(e)},userConfig:g,isLoadingUserConfig:h})})})]})}},99376:function(e,t,i){"use strict";var n=i(35475);i.o(n,"useRouter")&&i.d(t,{useRouter:function(){return n.useRouter}}),i.o(n,"useSearchParams")&&i.d(t,{useSearchParams:function(){return n.useSearchParams}})},47960:function(){},64670:function(e){e.exports={card:"suggestions_card__fbiZo",title:"suggestions_title__vNozc",text:"suggestions_text__J_IfY"}},76777:function(e){e.exports={main:"page_main__nw1Wk",suggestions:"page_suggestions__Y8EqU",inputBox:"page_inputBox__LrcZ4",chatBodyFull:"page_chatBodyFull__Qu2T2",chatBody:"page_chatBody__IirQQ",chatLayout:"page_chatLayout__bJUjP",chatBox:"page_chatBox__gsR6V",titleBar:"page_titleBar__3btUI",chatBoxBody:"page_chatBoxBody__xORKr",homeGreetings:"page_homeGreetings__VjQhh",sidePanel:"page_sidePanel__mxpxa"}}},function(e){e.O(0,[3587,2664,5540,3194,8407,8667,5401,6589,8117,9058,1662,2813,5477,9262,2971,2117,1744],function(){return e(e.s=1507)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[244,8459,3317,7138],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,t,s){Promise.resolve().then(s.bind(s,96034))},96034:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(57437),a=s(95186),r=s(2265),l=s(92813),o=s(41816),i=s.n(o),d=s(19378),c=s(66070),u=s(73925),m=s(75216),h=s(91521),x=s(45178),f=s(58619),g=s(35099),j=s(64697),b=s(27556),p=s(77168),N=s(74915),y=s(62869),w=s(27648),v=s(42225),k=s(7436);let _=["What does the paper say about climate change?","Making a cappuccino at home","Benefits of eating mangoes","How to plan a wedding on a budget","Appointment with Dr. Makinde on 12th August","Class notes lecture 3 on quantum mechanics","Painting concepts for acrylics","Abstract from the paper attention is all you need","Climbing Everest without oxygen","Solving a rubik's cube in 30 seconds","Facts about the planet Mars","How to make a website using React","Fish at the bottom of the ocean","Fish farming Kenya 2021","How to make a cake without an oven","Installing a solar panel at home"];function S(e){var t;let s=e.note,a=(s.additional.file||"").startsWith("http"),r=a?s.additional.heading:s.additional.file.split("/").pop(),l=(0,v.Le)(r||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsxs)(c.ll,{className:"inline-flex gap-2",children:["notion"===(t=s.additional.source)?(0,n.jsx)(u.F,{className:"text-muted-foreground"}):"github"===t?(0,n.jsx)(m.b,{className:"text-muted-foreground"}):(0,n.jsx)(h.S,{className:"text-muted-foreground"}),r]})}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:s.entry}),(0,n.jsxs)(y.z,{onClick:()=>e.setFocusSearchResult(s),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,n.jsx)(x.o,{className:"inline ml-2"})]})]}),(0,n.jsx)(c.eW,{children:a?(0,n.jsxs)("a",{href:s.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,n.jsx)(f.a,{className:"inline m-2"}),s.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-2 text-sm rounded-lg text-muted-foreground",children:[l,s.additional.file]})})]})}function C(){let[e,t]=(0,r.useState)(""),[s,o]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(null),[C,E]=(0,r.useState)(""),F=(0,r.useRef)(null),M=(0,k.IC)();function P(){!u&&e.trim()&&fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{o(e),m(!1)}).catch(e=>{console.error("Error:",e)})}return(0,r.useEffect)(()=>{E(_[Math.floor(Math.random()*_.length)])},[]),(0,r.useEffect)(()=>{if(e.trim())return x(null),F.current&&clearTimeout(F.current),e.trim()&&(F.current=setTimeout(()=>{P()},750)),()=>{F.current&&clearTimeout(F.current)}},[e]),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"h-full ".concat(i().sidePanel),children:(0,n.jsx)(l.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:M})}),(0,n.jsx)("div",{className:"".concat(i().searchLayout),children:(0,n.jsx)("div",{className:"md:w-3/4 sm:w-full mx-auto pt-6 md:pt-8",children:(0,n.jsxs)("div",{className:"p-4 md:w-3/4 sm:w-full mx-auto",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg",children:[(0,n.jsx)(a.I,{autoFocus:!0,className:"border-none pl-4",onChange:e=>t(e.currentTarget.value),onKeyDown:e=>"Enter"===e.key&&P(),type:"search",placeholder:"Search Documents"}),(0,n.jsxs)("button",{className:"px-2 gap-2 inline-flex items-center rounded border-l border-gray-300 hover:text-gray-500",onClick:()=>P(),children:[(0,n.jsx)(g.Y,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Find"})]})]}),h&&(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)(y.z,{onClick:()=>x(null),className:"mb-4",variant:"outline",children:[(0,n.jsx)(j.X,{className:"inline mr-2"}),"Back"]}),function(e){let t=(e.additional.file||"").startsWith("http"),s=t?e.additional.heading:e.additional.file.split("/").pop(),a=(0,v.Le)(s||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsx)(c.ll,{children:s})}),(0,n.jsx)(c.eW,{children:t?(0,n.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,n.jsx)(f.a,{className:"inline"}),e.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-3 text-sm rounded-lg text-muted-foreground flex items-center gap-2",children:[a,e.additional.file]})}),(0,n.jsx)(c.aY,{children:(0,n.jsx)("div",{className:"text-m",children:e.entry})})]})}(h)]}),!h&&s&&s.length>0&&(0,n.jsx)("div",{className:"mt-4 max-w-[92vw] break-all",children:(0,n.jsx)(d.x,{className:"h-[80vh]",children:s.map((e,t)=>(0,n.jsx)(S,{note:e,setFocusSearchResult:x},e["corpus-id"]))})}),null==s&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(b.r,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"Search across your documents"})]}),(0,n.jsxs)(c.aY,{className:"text-muted-foreground items-center justify-center text-center flex",children:[(0,n.jsx)(p.v,{className:"inline mr-2"})," ",C]})]}),s&&0===s.length&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(N.D,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"No documents found"})]}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:"To use search, upload your docs to your account."}),(0,n.jsx)(w.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,n.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]})]})})})]})}},41816:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0",sidePanel:"search_sidePanel__myfc9"}}},function(e){e.O(0,[5540,3194,8407,8667,5401,1201,2813,2971,2117,1744],function(){return e(e.s=94114)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3474],{28661:function(t,e,r){Promise.resolve().then(r.bind(r,35293)),Promise.resolve().then(r.bind(r,35976))},35293:function(t,e,r){"use strict";r.d(e,{ChatwootWidget:function(){return a}});var n=r(57437),s=r(48667);function a(){return(0,n.jsx)(s.default,{id:"chatwoot-widget",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'\n window.chatwootSettings = {\n position: "right",\n type: "standard",\n launcherTitle: "Chat with us"\n };\n (function(d,t) {\n var BASE_URL="https://app.chatwoot.com";\n var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n g.src=BASE_URL+"/packs/js/sdk.js";\n g.defer = true;\n g.async = true;\n s.parentNode.insertBefore(g,s);\n g.onload=function(){\n window.chatwootSDK.run({\n websiteToken: \'5uV59Ay2pvMJenJary2hvvVM\',\n baseUrl: BASE_URL\n })\n }\n })(document,"script");\n '}})}},89534:function(t,e,r){"use strict";r.d(e,{FN:function(){return f},Mi:function(){return g},VW:function(){return d},_i:function(){return c},gD:function(){return p},lj:function(){return v},sA:function(){return m}});var n=r(57437),s=r(2265),a=r(41915),o=r(90535),i=r(32489),u=r(94508);let d=a.zt,c=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.l_,{ref:e,className:(0,u.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...s})});c.displayName=a.l_.displayName;let l=(0,o.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),f=s.forwardRef((t,e)=>{let{className:r,variant:s,...o}=t;return(0,n.jsx)(a.fC,{ref:e,className:(0,u.cn)(l({variant:s}),r),...o})});f.displayName=a.fC.displayName;let p=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.aU,{ref:e,className:(0,u.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),...s})});p.displayName=a.aU.displayName;let m=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.x8,{ref:e,className:(0,u.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});m.displayName=a.x8.displayName;let g=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.Dx,{ref:e,className:(0,u.cn)("text-sm font-semibold",r),...s})});g.displayName=a.Dx.displayName;let v=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.dk,{ref:e,className:(0,u.cn)("text-sm opacity-90",r),...s})});v.displayName=a.dk.displayName},35976:function(t,e,r){"use strict";r.d(e,{Toaster:function(){return o}});var n=r(57437),s=r(89534),a=r(77992);function o(){let{toasts:t}=(0,a.pm)();return(0,n.jsxs)(s.VW,{children:[t.map(function(t){let{id:e,title:r,description:a,action:o,...i}=t;return(0,n.jsxs)(s.FN,{...i,children:[(0,n.jsxs)("div",{className:"grid gap-1",children:[r&&(0,n.jsx)(s.Mi,{children:r}),a&&(0,n.jsx)(s.lj,{children:a})]}),o,(0,n.jsx)(s.sA,{})]},e)}),(0,n.jsx)(s._i,{})]})}},77992:function(t,e,r){"use strict";r.d(e,{pm:function(){return f}});var n=r(2265);let s=0,a=new Map,o=t=>{if(a.has(t))return;let e=setTimeout(()=>{a.delete(t),c({type:"REMOVE_TOAST",toastId:t})},1e6);a.set(t,e)},i=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{let{toastId:r}=e;return r?o(r):t.toasts.forEach(t=>{o(t.id)}),{...t,toasts:t.toasts.map(t=>t.id===r||void 0===r?{...t,open:!1}:t)}}case"REMOVE_TOAST":if(void 0===e.toastId)return{...t,toasts:[]};return{...t,toasts:t.toasts.filter(t=>t.id!==e.toastId)}}},u=[],d={toasts:[]};function c(t){d=i(d,t),u.forEach(t=>{t(d)})}function l(t){let{...e}=t,r=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),n=()=>c({type:"DISMISS_TOAST",toastId:r});return c({type:"ADD_TOAST",toast:{...e,id:r,open:!0,onOpenChange:t=>{t||n()}}}),{id:r,dismiss:n,update:t=>c({type:"UPDATE_TOAST",toast:{...t,id:r}})}}function f(){let[t,e]=n.useState(d);return n.useEffect(()=>(u.push(e),()=>{let t=u.indexOf(e);t>-1&&u.splice(t,1)}),[t]),{...t,toast:l,dismiss:t=>c({type:"DISMISS_TOAST",toastId:t})}}},94508:function(t,e,r){"use strict";r.d(e,{cn:function(){return a}});var n=r(61994),s=r(53335);function a(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return(0,s.m6)((0,n.W)(e))}}},function(t){t.O(0,[8407,8667,1915,2971,2117,1744],function(){return t(t.s=28661)}),_N_E=t.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,t,s){Promise.resolve().then(s.bind(s,31537))},31537:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ei}});var a,n,r=s(57437),i=s(917),l=s.n(i);s(97510);var o=s(2265),c=s(77992),d=s(56937),h=s(7436),u=s(67341),m=s(62869),x=s(26371),p=s(95186),f=s(66070),j=s(84190),g=s(94508);let b=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:t,className:(0,g.cn)("w-full caption-bottom text-sm",s),...a})})});b.displayName="Table",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("thead",{ref:t,className:(0,g.cn)("[&_tr]:border-b",s),...a})}).displayName="TableHeader";let w=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tbody",{ref:t,className:(0,g.cn)("[&_tr:last-child]:border-0",s),...a})});w.displayName="TableBody",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tfoot",{ref:t,className:(0,g.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a})}).displayName="TableFooter";let y=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tr",{ref:t,className:(0,g.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a})});y.displayName="TableRow",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("th",{ref:t,className:(0,g.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a})}).displayName="TableHead";let N=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("td",{ref:t,className:(0,g.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a})});N.displayName="TableCell",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("caption",{ref:t,className:(0,g.cn)("mt-4 text-sm text-muted-foreground",s),...a})}).displayName="TableCaption";var v=s(23518),_=s(87296),k=s(89203),S=s(57466),C=s(38513),T=s(19841),D=s(3894),E=s(37295),F=s(2049),P=s(50525),O=s(5147),A=s(80438),I=s(29975),z=s(47615),Y=s(47020),R=s(22345),K=s(75216),W=s(90483),Z=s(73925),M=s(54271),U=s(95656),L=s(58717),B=s(81228),V=s(88435),H=s(56777),G=s(97525),J=s(45178),$=s(92813),q=s(14308),X=s(34688),Q=s(59199),ee=s(37099),et=s(32759),es=s(27648);let ea=e=>{let{onClose:t}=e,[s,a]=(0,o.useState)([]),[n,i]=(0,o.useState)([]),[l,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,w]=(0,o.useState)(0),[y,N]=(0,o.useState)([]),D=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||w(0),j){let e=setInterval(()=>{w(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let t=await e.json();Array.isArray(t)?a(t.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[y]);let E=s.filter(e=>e.toLowerCase().includes(l.toLowerCase())),F=async()=>{let e=n.length>0?n:E;if(0!==e.length)try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(t=>t.filter(t=>!e.includes(t))),i([])}catch(e){console.error("Error deleting files:",e)}},P=async e=>{try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(t=>t.filter(t=>t!==e)),i(t=>t.filter(t=>t!==e))}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,Q.ko)(e,x,g,f,N)}return(0,r.jsxs)(v.m5,{open:!0,onOpenChange:t,children:[(0,r.jsx)(ee.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(ee._T,{children:[(0,r.jsx)(ee.fY,{children:(0,r.jsx)(ee.f$,{children:"Alert"})}),(0,r.jsx)(ee.yT,{children:u||p}),(0,r.jsx)(ee.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){D&&D.current&&D.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:D,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(et.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""," rounded-lg"),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(_.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(k.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(v.sZ,{placeholder:"Find synced files",value:l,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(v.e8,{children:[(0,r.jsx)(v.rb,{children:0===s.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(S.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(es.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(v.fu,{heading:"Synced files",children:E.map(e=>(0,r.jsx)(v.di,{value:e,onSelect:e=>{i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(C.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>P(e),className:"ml-auto",children:(0,r.jsx)(T.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:F,className:"mr-2",children:[(0,r.jsx)(T.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},en=e=>{var t,s;let{items:a,selected:n,callbackFunc:i}=e,[l,c]=(0,o.useState)(null!==(s=null==n?void 0:n.toString())&&void 0!==s?s:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(j.h_,{children:[(0,r.jsx)(j.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(t=a.find(e=>e.id.toString()===l))||void 0===t?void 0:t.name," ",(0,r.jsx)(D.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(j.AW,{style:{maxHeight:"200px",overflowY:"auto",minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:(0,r.jsx)(j._x,{value:l,onValueChange:async e=>{c(e),await i(e)},children:a.map(e=>(0,r.jsx)(j.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},er=()=>{let[e,t]=(0,o.useState)([]),{toast:s}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),s=await e.json();t(e=>[...e,s])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),s({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&t(t=>t.filter(t=>t.token!==e))}catch(e){console.error("Error deleting API key:",e)}},i=async()=>{try{let e=await fetch("/auth/token"),s=await e.json();(null==s?void 0:s.length)>0&&t(s)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{i()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function ei(){let[e,t]=(0,o.useState)("Settings"),{apiKeys:s,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:i}=er(),{userConfig:j}=(0,d.h2)(!0),[g,v]=(0,o.useState)(null),[C,D]=(0,o.useState)(void 0),[Q,ee]=(0,o.useState)(null),[et,es]=(0,o.useState)(void 0),[ei,el]=(0,o.useState)(""),[eo,ec]=(0,o.useState)("verified"),[ed,eh]=(0,o.useState)(!1),{toast:eu}=(0,c.pm)(),em=(0,h.IC)(),ex="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg border dark:border-none dark:bg-muted border-opacity-50";(0,o.useEffect)(()=>{var e;v(j),es(null==j?void 0:j.phone_number),ec((null==j?void 0:j.is_phone_number_verified)?"verified":(null==j?void 0:j.phone_number)?"otp":"setup"),D(null==j?void 0:j.given_name),ee(null!==(e=null==j?void 0:j.notion_token)&&void 0!==e?e:null)},[j]);let ep=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(et),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");ec("verify")}catch(e){console.error("Error sending OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},ef=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(ei),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");ec("verified"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},ej=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");es(void 0),ec("setup"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},eg=async e=>{try{if(!(await fetch("/api/subscription?operation=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");g&&(g.subscription_state="cancel"===e?d.o9.UNSUBSCRIBED:d.o9.SUBSCRIBED,v(g)),eu({title:"\uD83D\uDCB3 Subscription",description:(null==g?void 0:g.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(t){console.error("Error changing subscription:",t),eu({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{let e=await fetch("/api/subscription/trial",{method:"POST"});if(!e.ok)throw Error("Failed to enable free trial");if((await e.json()).trial_enabled&&g){g.subscription_state=d.o9.TRIAL;let e=new Date(Date.now()+864e5*g.length_of_free_trial);g.subscription_renewal_date=(e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"short",year:"numeric"}).format(t)})(e),g.subscription_enabled_trial_at=new Date().toISOString(),v(g),eu({title:"\uD83C\uDF89 Trial Enabled",description:"Your free trial will end on ".concat(g.subscription_renewal_date)})}}catch(e){console.error("Error enabling free trial:",e),eu({title:"⚠️ Failed to Enable Free Trial",description:"Failed to enable free trial. Try again or contact us at team@khoj.dev"})}},ew=async()=>{if(C)try{if(!(await fetch("/api/user/name?name=".concat(C),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");g&&(g.given_name=C,v(g)),eu({title:"✅ Updated Profile",description:"You name has been updated to ".concat(C)})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ey=e=>async t=>{if(!(null==g?void 0:g.is_active)){eu({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}try{if(!(await fetch("/api/model/".concat(e,"?id=")+t,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");eu({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(t){console.error("Failed to update ".concat(e," model:"),t),eu({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},eN=async()=>{if(Q)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Q})})).ok)throw Error("Failed to save Notion API key");g&&(g.notion_token=Q,v(g)),eu({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ev=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));eu({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(t){console.error("Error syncing content:",t),eu({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},e_=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));g&&("computer"===e?g.enabled_content_source.computer=!1:"notion"===e?(g.enabled_content_source.notion=!1,g.notion_token=null,ee(g.notion_token)):"github"===e&&(g.enabled_content_source.github=!1),v(g)),"computer"===e?eu({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):eu({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(t){console.error("Error disconnecting ".concat(e,":"),t),eu({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return g?(0,r.jsxs)("div",{className:l().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:l().sidePanel,children:(0,r.jsx)($.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:em})}),(0,r.jsx)("div",{className:l().content,children:(0,r.jsx)("div",{className:"".concat(l().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(q.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(E.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(p.I,{type:"text",onChange:e=>D(e.target.value),value:C,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ew,disabled:C===g.given_name,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(f.Zb,{id:"subscription",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(P.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(f.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a"," ",g.length_of_free_trial," day trial of the Khoj Futurist plan. Your trial ends on ",g.subscription_renewal_date,". Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"unsubscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"expired"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Humanist"}),g.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>eg("cancel"),children:[(0,r.jsx)(O.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>eg("resubscribe"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||g.subscription_enabled_trial_at&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(g.khoj_cloud_subscription_url,"?prefilled_email=").concat(g.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:eb,children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Enable Trial"]})})]})]})]}),ed&&(0,r.jsx)(ea,{onClose:()=>eh(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{id:"computer",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(I.I,{className:"h-8 w-8 mr-2"}),"Files",g.enabled_content_source.computer&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>eh(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.computer||"hidden"),onClick:()=>e_("computer"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"github",className:"".concat(ex," hidden"),children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(K.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:g.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"notion",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(Z.F,{className:"h-7 w-7 mr-2"}),"Notion",g.enabled_content_source.notion&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!g.notion_oauth_url&&(0,r.jsx)(p.I,{onChange:e=>ee(e.target.value),value:Q||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[g.notion_oauth_url&&!g.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(g.notion_oauth_url)},children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):g.enabled_content_source.notion&&Q===g.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ev("notion"),children:[(0,r.jsx)(M.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):g.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:eN,disabled:Q===g.notion_token,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-1"}),g.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.notion_token||"hidden"),onClick:()=>e_("notion"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[g.chat_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(U.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(en,{items:g.chat_model_options,selected:g.selected_chat_model_config,callbackFunc:ey("chat")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.paint_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(L.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(en,{items:g.paint_model_options,selected:g.selected_paint_model_config,callbackFunc:ey("paint")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.voice_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(_.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(en,{items:g.voice_model_options,selected:g.selected_voice_model_config,callbackFunc:ey("voice")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-col flex-wrap gap-8",children:[!g.anonymous_mode&&(0,r.jsxs)(f.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg dark:bg-muted dark:border-none border-opacity-50 lg:w-2/3",children:[(0,r.jsxs)(f.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)(B.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(k.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(b,{children:(0,r.jsx)(w,{children:s.map(e=>(0,r.jsxs)(y,{children:[(0,r.jsx)(N,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(N,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(V.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(T.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),i(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(f.Zb,{className:"".concat(ex," lg:w-2/3"),children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eo&&(0,r.jsx)(z.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eo&&(0,r.jsx)(S.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(X.Z,{initialValue:et||"",onChangeNumber:es,disabled:"verify"===eo,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(l().phoneInput)}}),"verify"===eo&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(et)}),(0,r.jsx)(x.Zn,{autoFocus:!0,maxLength:6,value:ei||"",onChange:el,onComplete:()=>ec("verify"),children:(0,r.jsxs)(x.hf,{children:[(0,r.jsx)(x.cY,{index:0}),(0,r.jsx)(x.cY,{index:1}),(0,r.jsx)(x.cY,{index:2}),(0,r.jsx)(x.cY,{index:3}),(0,r.jsx)(x.cY,{index:4}),(0,r.jsx)(x.cY,{index:5})]})})]})]})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:["verify"===eo&&(0,r.jsx)(m.z,{variant:"outline",onClick:ef,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!et||et===g.phone_number&&"verified"===eo||!(0,u.y)(et),onClick:ep,children:g.phone_number?et&&(et!==g.phone_number||"verified"!==eo)&&(0,u.y)(et)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(J.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eo&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>ej(),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(q.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},32759:function(e,t,s){"use strict";s.d(t,{E:function(){return l}});var a=s(57437),n=s(2265),r=s(60610),i=s(94508);let l=n.forwardRef((e,t)=>{let{className:s,value:n,indicatorColor:l,...o}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,i.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(l),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});l.displayName=r.fC.displayName},77992:function(e,t,s){"use strict";s.d(t,{pm:function(){return u}});var a=s(2265);let n=0,r=new Map,i=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?i(s):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},o=[],c={toasts:[]};function d(e){c=l(c,e),o.forEach(e=>{e(c)})}function h(e){let{...t}=e,s=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:s});return d({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||a()}}}),{id:s,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,t]=a.useState(c);return a.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},917:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[6008,5540,3194,8407,8667,5401,3091,2813,2971,2117,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7138,244,8459,3317],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,41694))},41694:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(22515),n=s.n(o),i=s(2265),l=s(92813),c=s(62264),d=s(14308);s(2446);var r=s(7436),h=s(56937),u=s(5477);function g(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[d,r]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),p=(0,i.useRef)(null),m=e.setQueryToProcess,f=e.streamedMessages,_=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(r(!0),m(t))},[t,m]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?r(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages,customClassName:_})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(_," mr-auto ml-auto"),children:(0,a.jsx)(u.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==h?void 0:h.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:p})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function p(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[c,u]=(0,i.useState)("Khoj AI - Chat"),[p,m]=(0,i.useState)(void 0),[f,_]=(0,i.useState)([]),[x,v]=(0,i.useState)(""),[j,S]=(0,i.useState)(null),[C,I]=(0,i.useState)(void 0),[b,y]=(0,i.useState)([]),B=(0,h.GW)(),N=(0,r.IC)();return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{o(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,r.EK)(),I(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{j&&localStorage.setItem("uploadedFiles",JSON.stringify(j))},[j]),(0,i.useEffect)(()=>{if(x&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(C),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{m(e.conversation_id),localStorage.setItem("message",x),b.length>0&&localStorage.setItem("images",JSON.stringify(b)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[x,p,C]),s)?(0,a.jsx)(d.Z,{}):C?(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:n().sidePanel,children:(0,a.jsx)(l.ZP,{conversationId:null!=p?p:null,uploadedFiles:[],isMobileWidth:N})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!N&&c&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:c&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:c})}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(g,{conversationId:p,streamedMessages:f,setQueryToProcess:v,isLoggedIn:null!==B,publicConversationSlug:C,chatOptionsData:e,setTitle:u,setUploadedFiles:S,isMobileWidth:N,setImages:y})})]})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},22515:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[9346,5540,3194,2664,3954,8407,8667,5401,6589,9058,2781,2813,5477,2264,2971,2117,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- div.sharedChat_main__7Nayy{height:100vh;color:hsla(var(--foreground))}.sharedChat_suggestions__V8kr_{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem;justify-content:center}div.sharedChat_inputBox__wRW5A{border:1px solid var(--border-color);margin-bottom:20px;gap:12px;align-content:center}input.sharedChat_inputBox__wRW5A{border:none}input.sharedChat_inputBox__wRW5A:focus{outline:none;background-color:transparent}div.sharedChat_inputBox__wRW5A:focus{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}div.sharedChat_chatBodyFull__O1MOv{display:grid;grid-template-columns:1fr;height:100%}button.sharedChat_inputBox__wRW5A{border:none;outline:none;background-color:transparent;cursor:pointer;border-radius:.5rem;padding:.5rem;background:linear-gradient(var(--calm-green),var(--calm-blue))}div.sharedChat_chatBody__OnHDL{display:grid;grid-template-columns:1fr 1fr;height:100%}.sharedChat_inputBox__wRW5A{color:hsla(var(--foreground))}div.sharedChat_chatLayout__gutlc{display:grid;grid-template-columns:auto 1fr;gap:1rem}div.sharedChat_chatBox__PmAPg{display:grid;height:100%}div.sharedChat_titleBar__vOHp_{display:grid;grid-template-columns:1fr auto}div.sharedChat_chatBoxBody__ef2Nl{display:grid;height:100%;width:95%;margin:auto}div.sharedChat_agentIndicator__ORCl4 a{display:flex;text-align:center;align-content:center;align-items:center}div.sharedChat_agentIndicator__ORCl4{padding:10px}@media (max-width:768px){div.sharedChat_chatBody__OnHDL{grid-template-columns:0fr 1fr}div.sharedChat_chatBox__PmAPg{padding:0;height:-moz-min-content;height:min-content}}@media screen and (max-width:768px){div.sharedChat_inputBox__wRW5A{margin-bottom:0}div.sharedChat_chatBoxBody__ef2Nl{width:100%}div.sharedChat_chatBox__PmAPg{padding:0;height:-moz-min-content;height:min-content}div.sharedChat_chatLayout__gutlc{gap:0;grid-template-columns:1fr}}
@@ -1 +0,0 @@
1
- div.page_main__nw1Wk{height:100dvh;color:hsla(var(--foreground))}div.page_suggestions__Y8EqU{overflow-x:none;height:-moz-fit-content;height:fit-content;padding:10px;white-space:nowrap;gap:1rem}div.page_inputBox__LrcZ4{border:1px solid var(--border-color);margin-bottom:20px;align-content:center}input.page_inputBox__LrcZ4{border:none}input.page_inputBox__LrcZ4:focus{outline:none;background-color:transparent}div.page_inputBox__LrcZ4:focus{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}div.page_chatBodyFull__Qu2T2{display:grid;grid-template-columns:1fr;height:100%}button.page_inputBox__LrcZ4{border:none;outline:none;background-color:transparent;cursor:pointer;border-radius:.5rem;padding:.5rem;background:linear-gradient(var(--calm-green),var(--calm-blue))}div.page_chatBody__IirQQ{display:grid;grid-template-columns:1fr 1fr;height:100%}.page_inputBox__LrcZ4{color:hsla(var(--foreground))}div.page_chatLayout__bJUjP{display:grid;grid-template-columns:1fr;gap:1rem}div.page_chatBox__gsR6V{display:grid}div.page_titleBar__3btUI{display:grid;grid-template-columns:1fr auto}div.page_chatBoxBody__xORKr,div.page_homeGreetings__VjQhh{display:grid;height:100%;margin:auto}div.page_homeGreetings__VjQhh{grid-template-rows:1fr 2fr}div.page_sidePanel__mxpxa{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.page_inputBox__LrcZ4{margin-bottom:0}div.page_chatBody__IirQQ{grid-template-columns:0fr 1fr}div.page_chatBoxBody__xORKr{width:100%;grid-template-rows:auto}div.page_sidePanel__mxpxa{position:relative}div.page_chatBox__gsR6V{padding:0;height:100%}div.page_chatLayout__bJUjP{gap:0;grid-template-columns:1fr}div.page_chatLayout__bJUjP,div.page_homeGreetings__VjQhh{grid-template-rows:auto 1fr}}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2) format("woff2"),url(/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff) format("woff"),url(/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Bold.d181c465.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff) format("woff"),url(/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Italic.8916142b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Italic.9024d815.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff) format("woff"),url(/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-Italic.5295ba48.woff) format("woff"),url(/_next/static/media/KaTeX_Math-Italic.939bc644.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2) format("woff2"),url(/_next/static/media/KaTeX_Script-Regular.07505710.woff) format("woff"),url(/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff) format("woff"),url(/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size2-Regular.57727022.woff) format("woff"),url(/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff) format("woff"),url(/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff) format("woff"),url(/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2) format("woff2"),url(/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff) format("woff"),url(/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.17"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.suggestions_card__fbiZo{border-radius:.5rem}.suggestions_title__vNozc{font-size:1rem}.suggestions_text__J_IfY{padding-top:.2rem;font-size:.9rem;white-space:wrap;padding-right:4px;color:#000}
@@ -1 +0,0 @@
1
- div.agents_titleBar__FzYbY{padding:16px 0;text-align:left}.agents_agentPersonality__o0Ysz p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agents_agentPersonality__o0Ysz{text-align:left;grid-column:span 3;overflow:hidden}div.agents_pageLayout__gR3S3{max-width:60vw;margin:auto auto 2rem}div.agents_sidePanel__wGVGc{position:fixed;height:100%;z-index:1}button.agents_infoButton__NqI7E{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}div.agents_agentList__XVx4A{display:grid;gap:20px;padding-top:30px;margin-right:auto;grid-auto-flow:row;grid-template-columns:1fr 1fr;margin-left:auto}@media only screen and (max-width:768px){div.agents_agentList__XVx4A{width:100%;padding:0;margin-right:auto;margin-left:auto;grid-template-columns:1fr}div.agents_pageLayout__gR3S3{max-width:90vw}div.agents_sidePanel__wGVGc{position:relative;height:100%}}