khoj 1.28.4.dev90__py3-none-any.whl → 1.29.0__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 (42) hide show
  1. khoj/interface/compiled/404/index.html +1 -1
  2. khoj/interface/compiled/_next/static/chunks/5538-32bd787d106700dc.js +1 -0
  3. khoj/interface/compiled/_next/static/chunks/{9417-d1db7464a0639806.js → 9417-32c4db52ca42e681.js} +1 -1
  4. khoj/interface/compiled/_next/static/chunks/app/agents/{page-ee4f0da14df15091.js → page-4353b1a532795ad1.js} +1 -1
  5. khoj/interface/compiled/_next/static/chunks/app/automations/{page-da59a2b9ec07da16.js → page-c9f13c865e739607.js} +1 -1
  6. khoj/interface/compiled/_next/static/chunks/app/chat/{page-90d3621e1e3f0cb2.js → page-45720e1ed71e3ef5.js} +1 -1
  7. khoj/interface/compiled/_next/static/chunks/app/{page-b4f76bc1b35170c4.js → page-ecb8e1c192aa8834.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/app/search/{page-4f44549ba3807021.js → page-8e28deacb61f75aa.js} +1 -1
  9. khoj/interface/compiled/_next/static/chunks/app/settings/page-610d33158b233b34.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-178afe8ed85593c4.js → page-30376aa7e9cfa342.js} +1 -1
  11. khoj/interface/compiled/_next/static/chunks/{webpack-d1bea816ba11738d.js → webpack-6e43825796b7dfa6.js} +1 -1
  12. khoj/interface/compiled/_next/static/css/2d097a35da6bfe8d.css +1 -0
  13. khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +1 -0
  14. khoj/interface/compiled/agents/index.html +1 -1
  15. khoj/interface/compiled/agents/index.txt +2 -2
  16. khoj/interface/compiled/automations/index.html +1 -1
  17. khoj/interface/compiled/automations/index.txt +2 -2
  18. khoj/interface/compiled/chat/index.html +1 -1
  19. khoj/interface/compiled/chat/index.txt +2 -2
  20. khoj/interface/compiled/index.html +1 -1
  21. khoj/interface/compiled/index.txt +2 -2
  22. khoj/interface/compiled/search/index.html +1 -1
  23. khoj/interface/compiled/search/index.txt +2 -2
  24. khoj/interface/compiled/settings/index.html +1 -1
  25. khoj/interface/compiled/settings/index.txt +2 -2
  26. khoj/interface/compiled/share/chat/index.html +1 -1
  27. khoj/interface/compiled/share/chat/index.txt +2 -2
  28. khoj/processor/conversation/utils.py +5 -2
  29. khoj/routers/api_chat.py +7 -2
  30. khoj/routers/api_subscription.py +2 -1
  31. khoj/routers/helpers.py +15 -8
  32. {khoj-1.28.4.dev90.dist-info → khoj-1.29.0.dist-info}/METADATA +1 -1
  33. {khoj-1.28.4.dev90.dist-info → khoj-1.29.0.dist-info}/RECORD +38 -38
  34. khoj/interface/compiled/_next/static/chunks/5538-36aa824a75519c5b.js +0 -1
  35. khoj/interface/compiled/_next/static/chunks/app/settings/page-88dbd5c184dcd1e3.js +0 -1
  36. khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css +0 -1
  37. khoj/interface/compiled/_next/static/css/9d45de78fba367c1.css +0 -1
  38. /khoj/interface/compiled/_next/static/{ihuek7ndseklii6SQK9rT → bM0HVaqXqBW3iL4kXivLq}/_buildManifest.js +0 -0
  39. /khoj/interface/compiled/_next/static/{ihuek7ndseklii6SQK9rT → bM0HVaqXqBW3iL4kXivLq}/_ssgManifest.js +0 -0
  40. {khoj-1.28.4.dev90.dist-info → khoj-1.29.0.dist-info}/WHEEL +0 -0
  41. {khoj-1.28.4.dev90.dist-info → khoj-1.29.0.dist-info}/entry_points.txt +0 -0
  42. {khoj-1.28.4.dev90.dist-info → khoj-1.29.0.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5455839c73f146e7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/0e9d53dcd7f11342.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/ed437164d77aa600.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d1bea816ba11738d.js"/><script src="/_next/static/chunks/fd9d1056-2b978342deb60015.js" async=""></script><script src="/_next/static/chunks/7023-a5bf5744d19b3bd3.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><meta name="robots" content="noindex"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI"/><meta name="twitter:description" content="Your Second Brain."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_af6c42"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-d1bea816ba11738d.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/5455839c73f146e7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/0e9d53dcd7f11342.css\",\"style\"]\n3:HL[\"/_next/static/css/ed437164d77aa600.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[95751,[],\"\"]\n6:I[39275,[],\"\"]\n7:I[61343,[],\"\"]\nd:I[76130,[],\"\"]\n8:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"ihuek7ndseklii6SQK9rT\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/0e9d53dcd7f11342.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/ed437164d77aa600.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"5:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5455839c73f146e7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/0e9d53dcd7f11342.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/ed437164d77aa600.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-6e43825796b7dfa6.js"/><script src="/_next/static/chunks/fd9d1056-2b978342deb60015.js" async=""></script><script src="/_next/static/chunks/7023-a5bf5744d19b3bd3.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><meta name="robots" content="noindex"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI"/><meta name="twitter:description" content="Your Second Brain."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_af6c42"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-6e43825796b7dfa6.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/5455839c73f146e7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/0e9d53dcd7f11342.css\",\"style\"]\n3:HL[\"/_next/static/css/ed437164d77aa600.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[95751,[],\"\"]\n6:I[39275,[],\"\"]\n7:I[61343,[],\"\"]\nd:I[76130,[],\"\"]\n8:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"bM0HVaqXqBW3iL4kXivLq\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/0e9d53dcd7f11342.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/ed437164d77aa600.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"5:null\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5538],{55538:function(e,t,a){"use strict";a.d(t,{Z:function(){return eC}});var n=a(57437),s=a(15238),o=a.n(s),l=a(2265),r=a(34531),c=a.n(r),i=a(14944),d=a(39952),u=a.n(d),h=a(34040);a(7395);var m=a(11961),g=a(26100),f=a(36013),p=a(13304),x=a(12218),v=a(74697),j=a(37440);let w=p.fC,b=p.xz;p.x8;let y=p.h_,C=l.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(p.aV,{className:(0,j.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});C.displayName=p.aV.displayName;let N=(0,x.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),M=l.forwardRef((e,t)=>{let{side:a="right",className:s,children:o,...l}=e;return(0,n.jsxs)(y,{children:[(0,n.jsx)(C,{}),(0,n.jsxs)(p.VY,{ref:t,className:(0,j.cn)(N({side:a}),s),...l,children:[o,(0,n.jsxs)(p.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,n.jsx)(v.Z,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});M.displayName=p.VY.displayName;let k=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,j.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};k.displayName="SheetHeader";let _=l.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(p.Dx,{ref:t,className:(0,j.cn)("text-lg font-semibold text-foreground",a),...s})});_.displayName=p.Dx.displayName;let R=l.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(p.dk,{ref:t,className:(0,j.cn)("text-sm text-muted-foreground",a),...s})});R.displayName=p.dk.displayName;var I=a(19573),T=a(11838),E=a.n(T),F=a(89417);let D=new i.Z({html:!0,linkify:!0,typographer:!0});function S(e){let t=(0,F.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?E().sanitize(D.render(t)):E().sanitize(t)}(e),[o,r]=(0,l.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(I.J2,{open:o&&!e.showFullContent,onOpenChange:r,children:[(0,n.jsx)(I.xo,{asChild:!0,children:(0,n.jsxs)(f.Zb,{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:[(0,n.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:a]}),(0,n.jsx)("p",{className:"text-sm ".concat(e.showFullContent?"overflow-x-auto block":"overflow-hidden line-clamp-2"),dangerouslySetInnerHTML:{__html:s}})]})}),(0,n.jsx)(I.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,n.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function L(e){var t,a,s,o,r,c;let i=(0,F.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=E().sanitize(e.code),[u,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(!1),x=e=>{let t="text/plain",a=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),a=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let n=new ArrayBuffer(a.length),s=new Uint8Array(n);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let o=new Blob([n],{type:t}),l=URL.createObjectURL(o),r=document.createElement("a");r.href=l,r.download=e.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)},v=(t,a)=>(null==t?void 0:t.length)==0?null:(0,n.jsx)("div",{className:"".concat(a||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,n.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,n.jsx)("button",{className:"".concat(a?"hidden":void 0),onClick:e=>{e.preventDefault(),x(t)},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),title:"Download file: ".concat(t.filename),children:(0,n.jsx)(m.b,{className:"w-4 h-4",weight:g?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,n.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,n.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(I.J2,{open:u&&!e.showFullContent,onOpenChange:h,children:[(0,n.jsx)(I.xo,{asChild:!0,children:(0,n.jsx)(f.Zb,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:(0,n.jsxs)("div",{className:"flex flex-col px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,n.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(a=e.output_files)||void 0===a?void 0:a.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&v(e.output_files,!1)]})})}),(0,n.jsx)(I.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(o=e.output_files)||void 0===o?void 0:o.length)>0?"artifact":""]})]}),(null===(r=e.output_files)||void 0===r?void 0:r.length)>0&&v(null===(c=e.output_files)||void 0===c?void 0:c.slice(0,1),!0)||(0,n.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 verflow-hidden line-clamp-10",children:d})]})})]})})}function O(e){let[t,a]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",o="unknown";try{o=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(o)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(I.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,n.jsx)(I.xo,{asChild:!0,children:(0,n.jsx)(f.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]})})})}),(0,n.jsx)(I.yk,{className:"w-[400px] mx-2",children:(0,n.jsx)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function B(e){let[t,a]=(0,l.useState)(3);(0,l.useEffect)(()=>{a(e.isMobileWidth?1:3)},[e.isMobileWidth]);let s=e.codeReferenceCardData.slice(0,t),o=e.notesReferenceCardData.slice(0,t-s.length),r=o.length+s.length<t?e.onlineReferenceCardData.slice(0,t-s.length-o.length):[],c=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,i=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===i?null:(0,n.jsxs)("div",{className:"pt-0 px-4 pb-4 md:px-6",children:[(0,n.jsxs)("h3",{className:"inline-flex items-center",children:["References",(0,n.jsxs)("p",{className:"text-gray-400 m-2",children:[i," sources"]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[s.map((e,t)=>(0,l.createElement)(L,{showFullContent:!1,...e,key:"code-".concat(t)})),o.map((e,t)=>(0,l.createElement)(S,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r.map((e,t)=>(0,l.createElement)(O,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),c&&(0,n.jsx)(q,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData})]})]})}function q(e){return e.notesReferenceCardData||e.onlineReferenceCardData?(0,n.jsxs)(w,{children:[(0,n.jsxs)(b,{className:"text-balance w-auto md:w-[200px] justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center !m-2 inline-flex",children:["View references",(0,n.jsx)(g.o,{className:"m-1"})]}),(0,n.jsxs)(M,{className:"overflow-y-scroll",children:[(0,n.jsxs)(k,{children:[(0,n.jsx)(_,{children:"References"}),(0,n.jsx)(R,{children:"View all references for this response"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(L,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(S,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(O,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]}):null}var H=a(9557),A=a(34149),W=a(29386),z=a(31784),U=a(60665),Z=a(96006),V=a(18444),$=a(35304),P=a(8589),G=a(13493),J=a(63205),Q=a(56698),Y=a(32970),K=a(84120),X=a(92880),ee=a(48408),et=a(55362),ea=a(67722),en=a(58485),es=a(58575),eo=a(25800);let el=(0,a(57818).default)(()=>Promise.all([a.e(6555),a.e(7293),a.e(1459),a.e(1210)]).then(a.bind(a,51210)).then(e=>e.default),{loadableGenerated:{webpack:()=>[51210]},ssr:!1});function er(e){return(0,n.jsx)(l.Suspense,{fallback:(0,n.jsx)(en.Z,{}),children:(0,n.jsx)(el,{data:e.data})})}var ec=a(90837),ei=a(69591),ed=a(94880);let eu=new i.Z({html:!0,linkify:!0,typographer:!0});function eh(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function em(e){let{uquery:t,kquery:a}=e,[s,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{o(null)},2e3)},[s]),(0,n.jsxs)("div",{className:"".concat(c().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,n.jsx)("button",{title:"Like",className:c().thumbsUpButton,disabled:null!==s,onClick:()=>{eh(t,a,"positive"),o(!0)},children:!0===s?(0,n.jsx)(A.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,n.jsx)(A.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,n.jsx)("button",{title:"Dislike",className:c().thumbsDownButton,disabled:null!==s,onClick:()=>{eh(t,a,"negative"),o(!1)},children:!1===s?(0,n.jsx)(W.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,n.jsx)(W.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function eg(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,n.jsx)(z.a,{className:"".concat(s)}):a.includes("generating")?(0,n.jsx)(U.Z,{className:"".concat(s)}):a.includes("data sources")||a.includes("notes")?(0,n.jsx)(Z.g,{className:"".concat(s)}):a.includes("read")?(0,n.jsx)(V.f,{className:"".concat(s)}):a.includes("search")?(0,n.jsx)($.Y,{className:"".concat(s)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,n.jsx)(P.u,{className:"".concat(s)}):a.includes("diagram")?(0,n.jsx)(G.j,{className:"".concat(s)}):a.includes("paint")?(0,n.jsx)(J.Y,{className:"".concat(s)}):a.includes("code")?(0,n.jsx)(Q.E,{className:"".concat(s)}):(0,n.jsx)(z.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,es.oz)(e.agentColor):"text-gray-500"),s=E().sanitize(eu.render(e.message));return s=s.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,n.jsxs)("div",{className:"".concat(c().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(c().trainOfThought," ").concat(e.primary?c().primary:""),children:[a,(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:s},className:"break-words"})]})}eu.use(u(),{inline:!0,code:!0});let ef=(0,l.forwardRef)((e,t)=>{var a,s;let o,r,i,d,u;let[m,g]=(0,l.useState)(!1),[f,x]=(0,l.useState)(!1),[v,j]=(0,l.useState)(""),[w,b]=(0,l.useState)(""),[y,C]=(0,l.useState)(!1),[N,M]=(0,l.useState)(!1),[k,_]=(0,l.useState)(""),R=(0,l.useRef)(!1),I=(0,l.useRef)(null);async function T(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;C(!0);let a=D(t[0]);for(let e=0;e<t.length&&!R.current;e++){let n=a;e<t.length-1&&(a=D(t[e+1]));try{let e=await n,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let n=new Audio(e);n.onended=t,n.onerror=a,n.play()})}(t)}catch(e){console.error("Error:",e);break}}C(!1),M(!1)}async function D(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{R.current=N},[N]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(I.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,eo.Z)(I.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return I.current&&e.observe(I.current,{childList:!0}),()=>e.disconnect()},[I.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.intent&&"excalidraw"==e.chatMessage.intent.type&&(t=e.chatMessage.intent["inferred-queries"][0],_(e.chatMessage.message)),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET");let a={"text-to-image":e=>"![generated image](data:image/png;base64,".concat(e,")"),"text-to-image2":e=>"![generated image](".concat(e,")"),"text-to-image-v3":e=>"![generated image](data:image/webp;base64,".concat(e,")"),excalidraw:e=>e};if(e.chatMessage.intent){let{type:n,"inferred-queries":s}=e.chatMessage.intent;n in a&&(t=a[n](t)),n.includes("text-to-image")&&(null==s?void 0:s.length)>0&&(t+="\n\n".concat(s[0]))}t=(0,H.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var a;let[n,s]=e;null===(a=s.results.output_files)||void 0===a||a.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes("![".concat(e.filename,"]("))&&(t+="\n\n![".concat(e.filename,"](data:image/png;base64,").concat(e.b64_data,")"))})});let n=t,s=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return E().sanitize(t)}),a=t.map((e,t)=>"![uploaded image ".concat(t+1,"](").concat(e,")")).join("\n"),o=t.map((e,t)=>'<div class="'.concat(c().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(c().imagesContainer,'">').concat(o,"</div>");n="".concat(a,"\n\n").concat(n),s="".concat(l).concat(s)}j(n);let o=eu.render(s);o=o.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),b(E().sanitize(o))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{m&&setTimeout(()=>{g(!1)},2e3)},[m]),(0,l.useEffect)(()=>{I.current&&(I.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(c().codeCopyButton))){let t=document.createElement("button"),a=(0,n.jsx)(Y.w,{size:24});(0,h.createRoot)(t).render(a),t.className="hljs ".concat(c().codeCopyButton),t.addEventListener("click",()=>{let a=e.textContent||"";a=(a=(a=a.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(a);let s=(0,n.jsx)(K.J,{size:24});(0,h.createRoot)(t).render(s)}),e.prepend(t)}}),(0,eo.Z)(I.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}))},[w,f,I]);let S=async t=>{let a=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:a})})).ok?e.onDeleteMessage(a):console.error("Failed to delete message")},L=function(e,t,a){let n=[],s=[],o=[];if(a)for(let[e,t]of Object.entries(a))t.results&&o.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[a,n]of Object.entries(t)){if(n.answerBox&&e.push({title:n.answerBox.title,description:n.answerBox.answer,link:n.answerBox.source}),n.knowledgeGraph&&e.push({title:n.knowledgeGraph.title,description:n.knowledgeGraph.description,link:n.knowledgeGraph.descriptionLink}),n.webpages){if(n.webpages instanceof Array){let t=n.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=n.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(n.organic){let t=n.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}n.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:n,codeReferenceCardData:o}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,n.jsxs)("div",{ref:t,className:(a=e.chatMessage,(o=[c().chatMessageContainer,"shadow-md"]).push(c()[a.by]),a.message||o.push(c().emptyChatMessage),e.customClassName&&o.push(c()["".concat(a.by).concat(e.customClassName)]),o.join(" ")),onMouseLeave:e=>x(!1),onMouseEnter:e=>x(!0),children:[(0,n.jsxs)("div",{className:(s=e.chatMessage,(r=[c().chatMessageWrapper]).push(c()[s.by]),"khoj"===s.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,n.jsxs)(ec.Vq,{children:[(0,n.jsx)(ec.hg,{asChild:!0,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:(0,F.Le)(e.file_type)}),(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,n.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,ei.xq)(e.size),")"]})]})}),(0,n.jsxs)(ec.cZ,{children:[(0,n.jsx)(ec.fK,{children:(0,n.jsx)(p.$N,{children:(0,n.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,n.jsx)(ec.Be,{children:(0,n.jsx)(ed.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,n.jsx)("div",{ref:I,className:c().chatMessage,dangerouslySetInnerHTML:{__html:w}}),k&&(0,n.jsx)(er,{data:k})]}),(0,n.jsx)("div",{className:c().teaserReferencesContainer,children:(0,n.jsx)(B,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:L.notesReferenceCardData,onlineReferenceCardData:L.onlineReferenceCardData,codeReferenceCardData:L.codeReferenceCardData})}),(0,n.jsx)("div",{className:c().chatFooter,children:(f||e.isMobileWidth||e.isLastMessage||y)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{title:(d=(i=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),u=i.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(d," on ").concat(u)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,n.jsxs)("div",{className:"".concat(c().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(y?N?(0,n.jsx)(en.l,{iconClassName:"p-0",className:"m-0"}):(0,n.jsx)("button",{title:"Pause Speech",onClick:e=>M(!0),children:(0,n.jsx)(X.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,n.jsx)("button",{title:"Speak",onClick:e=>T(),children:(0,n.jsx)(ee.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,n.jsx)("button",{title:"Delete",className:"".concat(c().deleteButton),onClick:()=>S(e.chatMessage),children:(0,n.jsx)(et.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),(0,n.jsx)("button",{title:"Copy",className:"".concat(c().copyButton),onClick:()=>{navigator.clipboard.writeText(v),g(!0)},children:m?(0,n.jsx)(ea.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,n.jsx)(ea.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,n.jsx)(em,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,n.jsx)(em,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});ef.displayName="ChatMessage";var ep=a(84511),ex=a(16288),ev=a(20721),ej=a(19666),ew=a(50495),eb=e=>{let{name:t,avatar:a,link:s,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(ej.pn,{children:(0,n.jsxs)(ej.u,{delayDuration:0,children:[(0,n.jsx)(ej.aJ,{asChild:!0,children:(0,n.jsxs)(ew.z,{variant:"ghost",className:"flex items-center justify-center",children:[a,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(ej._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[a,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(g.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})};function ey(e){let t=e.trainOfThought.length-1,[a,s]=(0,l.useState)(e.completed);return(0,n.jsxs)("div",{className:"".concat(a?"":o().trainOfThought+" shadow-sm"),children:[!e.completed&&(0,n.jsx)(en.l,{className:"float-right"}),e.completed&&(a?(0,n.jsx)(ew.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>s(!1),variant:"ghost",size:"sm",children:"What was my train of thought?"}):(0,n.jsxs)(ew.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>s(!0),variant:"ghost",size:"sm",children:[(0,n.jsx)(ep.a,{size:16,className:"mr-1"}),"Close"]})),!a&&e.trainOfThought.map((a,s)=>(0,n.jsx)(eg,{message:a,primary:s===t&&e.lastMessage&&!e.completed,agentColor:e.agentColor},"train-".concat(s)))]},e.keyId)}function eC(e){var t,a,s,r,c,i,d,u,h;let[m,g]=(0,l.useState)(null),[f,p]=(0,l.useState)(0),[x,v]=(0,l.useState)(!0),[j,w]=(0,l.useState)(null),b=(0,l.useRef)(null),y=(0,l.useRef)(null),C=(0,l.useRef)(null),N=(0,l.useRef)(null),[M,k]=(0,l.useState)(null),[_,R]=(0,l.useState)(!1),[I,T]=(0,l.useState)(!0),E=(0,ei.IC)(),D="[data-radix-scroll-area-viewport]";(0,l.useEffect)(()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(D);if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t;T(a-(e+n)<=50)};return t.addEventListener("scroll",a),()=>t.removeEventListener("scroll",a)},[]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&I&&L()},[e.incomingMessages,I]),(0,l.useEffect)(()=>{m&&m.chat&&m.chat.length>0&&f<2&&requestAnimationFrame(()=>{var e;null===(e=C.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[m,f]),(0,l.useEffect)(()=>{if(!x||_)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&x&&(R(!0),function(t){if(!x||_)return;let a=(t+1)*10,n="";if(e.conversationId)n="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(a);else{if(!e.publicConversationSlug)return;n="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(a)}fetch(n).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(p(Math.ceil(a.response.chat.length/10)),a.response.chat.length===(null==m?void 0:m.chat.length)){v(!1),R(!1);return}e.setAgent(a.response.agent),g(a.response),R(!1),0===t?L(!0):S()}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),g(t)}v(!1),R(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(f))},{threshold:1});return b.current&&t.observe(b.current),()=>t.disconnect()},[x,f,_]),(0,l.useEffect)(()=>{v(!0),R(!1),p(0),g(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(k(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&w(t.turnId))}},[e.incomingMessages]);let S=()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(D);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},L=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=null===(e=y.current)||void 0===e?void 0:e.querySelector(D);requestAnimationFrame(()=>{null==a||a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}),T(!0)},O=t=>{t&&(g(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(ed.x,{className:"h-[73vh] relative",ref:y,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"".concat(o().chatHistory," ").concat(e.customClassName),children:[(0,n.jsx)("div",{ref:b,style:{height:"1px"},children:_&&(0,n.jsx)(en.l,{className:"opacity-50"})}),m&&m.chat&&m.chat.map((t,a)=>{var s,o,l;return(0,n.jsxs)(n.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,n.jsx)(ey,{trainOfThought:null===(s=t.trainOfThought)||void 0===s?void 0:s.map(e=>e.data),lastMessage:!1,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:!0},"".concat(a,"trainOfThought")),(0,n.jsx)(ef,{ref:a===m.chat.length-2?C:a===m.chat.length-(f-1)*10?N:null,isMobileWidth:E,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(l=m.agent)||void 0===l?void 0:l.color,"-500"),isLastMessage:a===m.chat.length-1,onDeleteMessage:O,conversationId:e.conversationId},"".concat(a,"fullHistory"))]})}),e.incomingMessages&&e.incomingMessages.map((t,a)=>{var s,o,r,c,i;let d=null!==(i=null!==(c=t.turnId)&&void 0!==c?c:j)&&void 0!==i?i:void 0;return(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(ef,{isMobileWidth:E,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(s=m.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:O,conversationId:e.conversationId,turnId:d},"".concat(a,"outgoing")),t.trainOfThought&&(0,n.jsx)(ey,{trainOfThought:t.trainOfThought,lastMessage:a===M,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:t.completed},"".concat(a,"trainOfThought")),(0,n.jsx)(ef,{isMobileWidth:E,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:O,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(r=m.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:!0},"".concat(a,"incoming"))]},"incomingMessage".concat(a))}),e.pendingMessage&&(0,n.jsx)(ef,{isMobileWidth:E,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:O,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(t=m.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),m&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(eb,{name:m&&m.agent&&(null===(r=m.agent)||void 0===r?void 0:r.name)?null===(c=m.agent)||void 0===c?void 0:c.name:"Agent",link:m&&m.agent&&(null===(i=m.agent)||void 0===i?void 0:i.slug)?"/agents?agent=".concat(null===(d=m.agent)||void 0===d?void 0:d.slug):"/agents",avatar:(0,F.TI)(null===(a=m.agent)||void 0===a?void 0:a.icon,null===(s=m.agent)||void 0===s?void 0:s.color)||(0,n.jsx)(ex.v,{}),description:m&&m.agent&&(null===(u=m.agent)||void 0===u?void 0:u.persona)?null===(h=m.agent)||void 0===h?void 0:h.persona:"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,n.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!I&&(0,n.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{L(),T(!0)},children:(0,n.jsx)(ev.K,{size:24})})})]})}):null}},15238:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},34531:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9417],{58575:function(c,a,s){s.d(a,{Iu:function(){return r},Zc:function(){return o},oz:function(){return n},tp:function(){return e},xF:function(){return t}});let t=["red","yellow","green","blue","orange","purple","pink","teal","cyan","lime","indigo","fuchsia","rose","sky","amber","emerald"];function n(c){return t.includes(c)?"text-".concat(c,"-500"):"text-gray-500"}function e(c){return t.includes(c)?"bg-".concat(c,"-500 dark:bg-").concat(c,"-900 hover:bg-").concat(c,"-400 dark:hover:bg-").concat(c,"-800"):"bg-background"}function o(c){return"".concat(t.includes(c)?"bg-gradient-to-b from-[hsl(var(--background))] to-".concat(c,"-100/70 dark:from-[hsl(var(--background))] dark:to-").concat(c,"-950/30 "):"bg-gradient-to-b from-white to-orange-50"," dark:border dark:border-neutral-700")}function r(c){return t.includes(c)?"border-".concat(c,"-500"):"border-gray-500"}let l={};for(let c of t)l[c]=r(c)},89417:function(c,a,s){s.d(a,{BI:function(){return co},vH:function(){return ct},Le:function(){return ce},TI:function(){return cn}});var t=s(57437);s(2265);var n=s(58575),e=s(16288),o=s(55631),r=s(8589),l=s(82059),m=s(58410),i=s(81980),u=s(46503),d=s(32145),x=s(57421),j=s(56698),N=s(47483),f=s(14850),h=s(5989),g=s(63205),p=s(18444),k=s(39557),b=s(86545),z=s(88420),w=s(70177),M=s(41959),v=s(67267),C=s(48687),y=s(96185),W=s(8606),E=s(48855),L=s(67247),B=s(43743),H=s(11925),T=s(20908),_=s(84835),A=s(77514),G=s(8658),I=s(58573),O=s(42520),S=s(98743),Y=s(92648),D=s(77574),F=s(89475),P=s(5198),R=s(2861),X=s(359),Z=s(52731),J=s(13493),K=s(88145),U=s(58259),$=s(26100),q=s(20153),Q=s(27850),V=s(48988),cc=s(12835);function ca(c){let{className:a}=c;return(0,t.jsxs)("svg",{className:"".concat(null!=a?a:"w-6 h-6 text-muted-foreground inline-flex mr-1"),xmlns:"http://www.w3.org/2000/svg",width:"144.98",height:"160",viewBox:"-7.65 -13.389 144.98 160",children:[(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:"3",d:"M133.399 46.067c-.205-3.15-2.842-4.366-5.993-2.125-7.22-1.297-14.305-.687-17.8-.981-7.662-1.073-14.041-5.128-14.041-5.128.932-1.239.486-3.917-5.498-4.101-1.646-.542-3.336-1.327-4.933-1.979.544-1.145-.133-2.836-.133-2.836 2.435-.672 2.808-3.842 1.848-5.709 3.106.084 2.612-4.718 2.183-6.381 2.435-.923 2.77-3.831 1.763-6.129 2.938-.671 3.022-4.114 2.77-6.548 3.023-.168 2.604-5.457 2.604-6.549 2.604-1.679 2.016-3.946 2.425-6.573 1.605-3.25-.577-4.173-2.116-.71-1.651 3.001-3.77 4.311-3.75 6.528.755 1.259-5.625 3.106-3.61 7.052-1.428 1.763-4.785 4.03-3.592 6.733-.606 1.326-4.888 4.433-3.041 7.371-4.03 2.687-3.79 3.335-2.938 5.793-1.147.736-2.318 1.862-2.995 3.094-1.32-1.568-2.603-4.429-2.584-8.294 0-3.275-6.1.318-6.1 6.784 0 .556-.056 1.061-.134 1.542-2.11.243-4.751.707-8.08 1.494-.106.073-.157.186-.182.316a8.704 8.704 0 01-.277-1.553c-.582-3.79-4.934-9.56-7.057-2.434-1.096 2.611-1.74 4.392-2.115 5.789v0s-.336.226-.957.61c-2.62 1.622-3.562 6.686-13.075 9.883-3.211 1.079-7.4 1.945-12.96 2.395-9.57.773-27.887 17.314-29.114 33.097-.283 3.964.31 13.737 3.596 22.31l.005.02c.015.042.032.081.048.122.052.134.103.267.156.398.28.718.579 1.405.895 2.062 1.885 4.028 4.46 7.59 7.934 9.882a25.252 25.252 0 004.372 2.762c5.907 9.749 18.442 22.252 42.075 14.859 36.255-10.284 56.263 13.809 58.568 15.5 3.399 3.433-8.786-29.835-34.587-44.788-15.253-8.322-5.678-22.656-4.585-27.718 0 0 12.227 8.557 21.087-4.52 8.004 2.062 13.367-1.462 20.25 1.03 4.184 1.833 21.77.726 15.235-9.104 4.11-2.683 4.544-1.815 6.6-5.9 1.104-4.952-1.403-6.012-2.167-7.366zM63.106 32.768c-.041.018-.086.04-.125.056.039-.034.075-.062.115-.102l.01.046zm-13.413 4.523c-.073.429-.143.829-.212 1.216.037-.832.085-1.714.143-2.646.024.435.05.904.069 1.43zm10.693-6.333c.746 1.124 1.662 2.179 1.662 2.179s-.875-.79-1.662-2.179z"}),(0,t.jsx)("path",{fill:"#7a9",stroke:"#000",strokeWidth:".5",d:"M6.448 104.253s10.02 36.105 46.549 24.68c36.255-10.284 56.263 13.809 58.568 15.5 3.399 3.433-8.786-29.835-34.587-44.788-15.253-8.322-5.678-22.656-4.585-27.718 0 0 12.227 8.557 21.087-4.52 8.004 2.062 13.367-1.462 20.25 1.03 4.184 1.833 21.77.726 15.235-9.104 4.11-2.683 4.544-1.815 6.6-5.9 1.105-4.952-1.402-6.011-2.166-7.366-.205-3.15-2.842-4.366-5.993-2.125-7.22-1.297-14.305-.687-17.8-.981-7.662-1.073-14.041-5.128-14.041-5.128.932-1.239.486-3.917-5.498-4.101-3.287-1.082-6.752-3.136-9.288-3.162-2.567 0-2.914-2.537-2.914-2.537-1.606-.87-3.924-4.252-3.9-9.438 0-3.275-6.098.318-6.098 6.784s-5.818 7.758-5.818 7.758-2.55-2.281-2.855-5.958c-.582-3.79-4.934-9.56-7.057-2.434-3.226 7.646-3.485 9.43-4.115 13.154-1.31 7.711-.345 8.012-.345 8.012l-32.824 23.43z"}),(0,t.jsx)("path",{fill:"#314b49",stroke:"#314b49",strokeWidth:".75",strokeLinecap:"round",strokeLinejoin:"round",d:"M84.11 42.833c1.549-.562.897-.415 1.153-.581-2.96.575-9.635.614-14.317-1.133.392.23 2.568.962 2.845 1.128.218.715.1 1.438 2.932 2.709 2.559.793 5.845.461 6.835-.529.109-1.684.126-1.065.553-1.594z"}),(0,t.jsx)("path",{fill:"#314b49",stroke:"#314b49",strokeWidth:".5",d:"M116.479 61.979c-2.83-2.085-4.881-.264-6.47-.413.99-.645 3.763-2.062 8.246-2.062 2.532 0 3.879 2.196 5.57 2.207 1.14.007 4.472-1.71 5.14-2.378-.97.838.454 1.755-.49 3.003-.281.359-.836 1.511-2.662 2.051-2.05.971-5.411 1.762-9.334-2.408z"}),(0,t.jsx)("path",{fill:"#314b49",d:"M54.932 24.033s-3.355 7.996.312 15.329.522-6.829 4.688-4.162c3.397.385-2.387-3.215-2.033-7.819-.176-2.892-1.77-5.194-2.967-3.348zM119.336 50.417c0 1.121-1.363 2.03-3.045 2.03 3.573-1.121-.201-4.653-3.045-2.03 0-1.121 1.363-2.03 3.045-2.03s3.045.909 3.045 2.03z"}),(0,t.jsx)("path",{fill:"#314b49",d:"M114.169 47.833c3.772-.231 6.336.323 5.536 3.138.548-1.126 1.292-2.83-1.046-3.507-1.746-.388-3.3-.378-4.49.369z"}),(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:".5",d:"M59.929 69.234c0-3.521-1.51-7.166-7.04-14.583-1.635-2.192-2.62-4.336-3.211-6.275-1.401-3.295-3.426-8.019-.613-17.233 0 0 .62-.384 0 0-2.62 1.622-3.562 6.686-13.075 9.883-3.211 1.079-7.4 1.945-12.96 2.395-9.568.773-27.886 17.314-29.113 33.097-.283 3.964.31 13.737 3.596 22.31l.005.02c.015.042.032.081.048.122.052.134.103.267.156.398.28.718.579 1.405.895 2.062 1.885 4.028 4.46 7.59 7.934 9.882 3.084 2.404 5.606 3.306 5.606 3.306-2.588-3.578-3.77-7.562-2.263-12.32.65 2.637 1.903 4.162 3.646 4.777-.615-1.884-.827-3.549 0-4.651 2.567 6.734 5.353 9.031 8.17 10.686-2.63-4.914-4.031-10.005-3.77-15.337 2.569 6.028 6.596 9.945 10.56 13.954-3.78-5.966-6.911-12.104-6.977-19.046 1.693 2.778 3.935 4.932 6.6 6.601-1.683-2.709-2.505-5.51-2.263-8.423 4.424 4.945 9.36 6.607 14.332 8.046-5.197-3.625-9.843-7.537-12.32-12.572 2.972 1.464 5.948 1.693 8.926 1.383-3.706-1.872-5.07-5.252-5.783-9.052 5.177 5.279 10.587 8.827 16.09 11.692-5.455-5.26-9.478-10.65-11.565-16.218 2.1 1.18 4.157 1.736 6.16 1.509-2.766-3.124-3.465-6.182-4.211-9.241 2.637 3.916 4.959 6.022 7.103 7.103-2.19-4.482-2.034-8.432-.503-12.068 2.524 1.675 4.902 4.295 6.915 9.303.73-2.386-.447-6.364-1.886-10.56 2.175.622 4.779 3.351 8.17 9.932-.33-3.865-2.138-7.775-4.147-11.692 3.027 3.51 7.557 12.713 6.788 10.81z"}),(0,t.jsx)("path",{fill:"#796958",stroke:"#000",strokeWidth:".5",d:"M76.27 30.176s-.252 7.472 6.717 2.603c3.61.084 2.015-3.862 2.015-3.862 2.435-.672 2.808-3.842 1.848-5.709 3.106.084 2.612-4.718 2.183-6.381 2.435-.923 2.77-3.831 1.763-6.129 2.938-.671 3.022-4.114 2.77-6.548 3.023-.168 2.604-5.457 2.604-6.549 2.604-1.679 2.016-3.946 2.425-6.573 1.605-3.25-.577-4.173-2.116-.71-1.651 3.001-3.77 4.311-3.75 6.528.755 1.259-5.625 3.106-3.61 7.052-1.428 1.763-4.785 4.03-3.592 6.733-.606 1.326-4.888 4.433-3.041 7.371-4.03 2.687-3.79 3.335-2.938 5.793-2.155 1.38-4.41 4.131-3.278 6.381z"}),(0,t.jsx)("path",{fill:"#fff",d:"M94.094-5.087s-.735 1.324-.735 2.133c0 .809 2.185.568 2.927-.227-1.625.024-2.965.289-2.192-1.906zM89.833 1.183s-.812 1.068-.183 2.316c.392.98 2.807.962 3.549.167-1.625.024-4.14-.287-3.366-2.483zM86.698 7.638s-.998 1.346-.492 2.602c0 .809 2.838.956 3.58.161-1.625.022-3.645-.489-3.088-2.763zM83.62 14.8s-1.402 1.542-.148 2.945c1.438.809 3.744.049 4.486-.746-1.625.022-4.894.076-4.337-2.199zM80.616 20.521s-1.575 1.414-.02 3.312c1.438.809 4.57.198 5.312-.597-1.624.024-5.99-1.346-5.292-2.715zM77.469 27.262s-1.403 1.542-.15 2.945c1.439.809 6.037-.186 6.779-.981-1.625.023-7.185.311-6.63-1.964z"}),(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:".5",d:"M76.352 30.29c-.45-.45-.534-.896-.367-1.718 0 0 .369-4.107-16.333-.158-1.072.74 2.396 4.722 2.396 4.722s.418.215 1.047-.415c.253 1.123.852 4.081.233 4.579 1.245-.771 1.868-1.946 1.676-4.125 2.122.461 3.742 1.64 4.692 3.779.304-1.4.603-2.799-.384-4.126 2.182.285 3.88 1.496 5.362 3.124.22-.933.354-1.883 0-2.931 1.39.473 2.587 1.607 3.71 2.988 0 0 .21-3.862-2.032-5.719z"}),(0,t.jsx)("path",{opacity:".26",d:"M60.33 57.936s6.76 13.59 17.595 13.991c10.834.401 10.834-2.73 10.834-2.73s-15.527 3.048-28.43-11.261zM63.485 65.63c2.279 3.104 4.856 5.221 7.722 6.382 0 0-7.365 11.108-3.611 20.023s13.125 11.053 23.32 21.249c7.943 7.942 17.159 24.961 17.159 24.961s-17.834-14.176-29.42-13.479c0 0-2.687-9.668-10.585-17.566-11.244-11.245-16.168-25.875-4.585-41.57z"}),(0,t.jsx)("path",{opacity:".18",fill:"#fff",d:"M44.717 38.245c-3.874 2.501-8.42 7.096-24.415 8.083C3.252 53.112-7.131 73.013-3.475 86.792c1.348 7.317 3.89 14.18 3.89 14.18C-.47 95.053-.966 89.575 1.45 87.373c1.435 2.384 2.969 2.468 4.507 2.479-1.59-2.404-1.788-4.808 0-7.212 1.489 1.525 2.992 1.881 4.507 1.353-2.128-2.449-1.867-4.848 0-7.211 1.388 5.022 4.462 7.453 7.662 9.689-2.208-4.333-4.166-8.672-2.93-13.07 1.323.729 2.595.644 3.83 0-1.256-1.576-.924-3.153 0-4.732 2.948 3.04 6.214 3.724 9.466 4.507-2.661-2.454-5.543-4.527-6.761-9.465 1.5-1.811 3.269-2.685 5.408-2.253-1.901-1.167-1.65-2.543 0-4.057 2.089 1.104 4.195 1.352 6.31 1.127-2.807-1.68-8.424-4.994 11.269-20.283z"}),(0,t.jsx)("path",{opacity:".27",fill:"#fff",d:"M71.278 19.389c.996-.963 1.146-.65.854.285-.982 2.36.353 4.647.797 6.206l-3.871.114c.108-2.271.247-4.794 2.22-6.605z"})]})}let cs={Lightbulb:(c,a,s)=>(0,t.jsx)(e.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Robot:(c,a,s)=>(0,t.jsx)(o.H,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Aperture:(c,a,s)=>(0,t.jsx)(r.u,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),GraduationCap:(c,a,s)=>(0,t.jsx)(l.X,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Jeep:(c,a,s)=>(0,t.jsx)(m.s,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Island:(c,a,s)=>(0,t.jsx)(i.W,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),MathOperations:(c,a,s)=>(0,t.jsx)(u.M,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Asclepius:(c,a,s)=>(0,t.jsx)(d.N,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Couch:(c,a,s)=>(0,t.jsx)(x.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Code:(c,a,s)=>(0,t.jsx)(j.E,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Atom:(c,a,s)=>(0,t.jsx)(N.h,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),ClockCounterClockwise:(c,a,s)=>(0,t.jsx)(f.y,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Globe:(c,a,s)=>(0,t.jsx)(h.T,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Palette:(c,a,s)=>(0,t.jsx)(g.Y,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Book:(c,a,s)=>(0,t.jsx)(p.f,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Confetti:(c,a,s)=>(0,t.jsx)(k.D,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),House:(c,a,s)=>(0,t.jsx)(b.T,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Translate:(c,a,s)=>(0,t.jsx)(z.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),BowlFood:(c,a,s)=>(0,t.jsx)(w.a,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Lectern:(c,a,s)=>(0,t.jsx)(M.G,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Wallet:(c,a,s)=>(0,t.jsx)(v.w,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),PencilLine:(c,a,s)=>(0,t.jsx)(C.z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Chalkboard:(c,a,s)=>(0,t.jsx)(y.a,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Cigarette:(c,a,s)=>(0,t.jsx)(W.m,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),CraneTower:(c,a,s)=>(0,t.jsx)(E.E,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Heart:(c,a,s)=>(0,t.jsx)(L.X,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Leaf:(c,a,s)=>(0,t.jsx)(B.B,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),NewspaperClipping:(c,a,s)=>(0,t.jsx)(H.g,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),OrangeSlice:(c,a,s)=>(0,t.jsx)(T.R,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),SmileyMelting:(c,a,s)=>(0,t.jsx)(_.N,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),YinYang:(c,a,s)=>(0,t.jsx)(A.x,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),SneakerMove:(c,a,s)=>(0,t.jsx)(G.D,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Student:(c,a,s)=>(0,t.jsx)(I.Z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Oven:(c,a,s)=>(0,t.jsx)(O.o,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Gavel:(c,a,s)=>(0,t.jsx)(S._,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Broadcast:(c,a,s)=>(0,t.jsx)(Y.z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")})};function ct(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=null!=a?a:"h-4 w-4";return c.includes("summarize")?(0,t.jsx)(D.U,{className:s}):c.includes("help")?(0,t.jsx)(F.H,{className:s}):c.includes("automation")?(0,t.jsx)(o.H,{className:s}):c.includes("webpage")?(0,t.jsx)(P.A,{className:s}):c.includes("notes")?(0,t.jsx)(R.a,{className:s}):c.includes("image")?(0,t.jsx)(X.E,{className:s}):c.includes("default")?(0,t.jsx)(Z.E,{className:s}):c.includes("diagram")?(0,t.jsx)(J.j,{className:s}):c.includes("general")?(0,t.jsx)(K.K,{className:s}):c.includes("online")?(0,t.jsx)(U.u,{className:s}):c.includes("text")?(0,t.jsx)(C.z,{className:s}):(0,t.jsx)($.o,{className:s})}function cn(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"gray",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"w-6",t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"h-6",e=cs[c],o=a.toLowerCase(),r=(0,n.oz)(o);return e?e(r,s,t):null}function ce(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"w-6 h-6 text-muted-foreground inline-flex mr-1";switch(c.split(".").pop()){case"org":return(0,t.jsx)(ca,{className:a});case"markdown":case"md":return(0,t.jsx)(q.Y,{className:a});case"pdf":return(0,t.jsx)(Q.y,{className:a});case"doc":case"docx":return(0,t.jsx)(V.t,{className:a});case"csv":case"json":return(0,t.jsx)(u.M,{className:a});case"txt":return(0,t.jsx)(R.a,{className:a});case"py":return(0,t.jsx)(j.E,{className:a});case"jpg":case"jpeg":case"png":case"webp":return(0,t.jsx)(X.E,{className:a,weight:"fill"});default:return(0,t.jsx)(cc.$,{className:a,weight:"fill"})}}function co(){return Object.keys(cs)}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9417],{58575:function(c,a,s){s.d(a,{Iu:function(){return r},Zc:function(){return o},oz:function(){return n},tp:function(){return e},xF:function(){return t}});let t=["red","yellow","green","blue","orange","purple","pink","teal","cyan","lime","indigo","fuchsia","rose","sky","amber","emerald"];function n(c){return t.includes(c)?"text-".concat(c,"-500"):"text-gray-500"}function e(c){return t.includes(c)?"bg-".concat(c,"-500 dark:bg-").concat(c,"-900 hover:bg-").concat(c,"-400 dark:hover:bg-").concat(c,"-800"):"bg-background"}function o(c){return"".concat(t.includes(c)?"bg-gradient-to-b from-[hsl(var(--background))] to-".concat(c,"-100/70 dark:from-[hsl(var(--background))] dark:to-").concat(c,"-950/30 "):"bg-gradient-to-b from-white to-orange-50"," dark:border dark:border-neutral-700")}function r(c){return t.includes(c)?"border-".concat(c,"-500"):"border-gray-500"}let l={};for(let c of t)l[c]=r(c)},89417:function(c,a,s){s.d(a,{BI:function(){return co},vH:function(){return ct},Le:function(){return ce},TI:function(){return cn}});var t=s(57437);s(2265);var n=s(58575),e=s(16288),o=s(55631),r=s(8589),l=s(82059),m=s(58410),i=s(81980),u=s(46503),d=s(32145),x=s(57421),j=s(56698),N=s(47483),f=s(14850),h=s(5989),g=s(63205),p=s(18444),k=s(39557),b=s(86545),z=s(88420),w=s(70177),M=s(41959),v=s(67267),C=s(48687),y=s(96185),E=s(8606),W=s(48855),L=s(67247),B=s(43743),H=s(11925),T=s(20908),_=s(84835),A=s(77514),G=s(8658),I=s(58573),O=s(42520),S=s(98743),Y=s(92648),D=s(77574),F=s(89475),P=s(5198),R=s(2861),X=s(359),Z=s(52731),J=s(13493),K=s(88145),U=s(58259),$=s(26100),q=s(20153),Q=s(27850),V=s(48988),cc=s(12835);function ca(c){let{className:a}=c;return(0,t.jsxs)("svg",{className:"".concat(null!=a?a:"w-6 h-6 text-muted-foreground inline-flex mr-1"),xmlns:"http://www.w3.org/2000/svg",width:"144.98",height:"160",viewBox:"-7.65 -13.389 144.98 160",children:[(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:"3",d:"M133.399 46.067c-.205-3.15-2.842-4.366-5.993-2.125-7.22-1.297-14.305-.687-17.8-.981-7.662-1.073-14.041-5.128-14.041-5.128.932-1.239.486-3.917-5.498-4.101-1.646-.542-3.336-1.327-4.933-1.979.544-1.145-.133-2.836-.133-2.836 2.435-.672 2.808-3.842 1.848-5.709 3.106.084 2.612-4.718 2.183-6.381 2.435-.923 2.77-3.831 1.763-6.129 2.938-.671 3.022-4.114 2.77-6.548 3.023-.168 2.604-5.457 2.604-6.549 2.604-1.679 2.016-3.946 2.425-6.573 1.605-3.25-.577-4.173-2.116-.71-1.651 3.001-3.77 4.311-3.75 6.528.755 1.259-5.625 3.106-3.61 7.052-1.428 1.763-4.785 4.03-3.592 6.733-.606 1.326-4.888 4.433-3.041 7.371-4.03 2.687-3.79 3.335-2.938 5.793-1.147.736-2.318 1.862-2.995 3.094-1.32-1.568-2.603-4.429-2.584-8.294 0-3.275-6.1.318-6.1 6.784 0 .556-.056 1.061-.134 1.542-2.11.243-4.751.707-8.08 1.494-.106.073-.157.186-.182.316a8.704 8.704 0 01-.277-1.553c-.582-3.79-4.934-9.56-7.057-2.434-1.096 2.611-1.74 4.392-2.115 5.789v0s-.336.226-.957.61c-2.62 1.622-3.562 6.686-13.075 9.883-3.211 1.079-7.4 1.945-12.96 2.395-9.57.773-27.887 17.314-29.114 33.097-.283 3.964.31 13.737 3.596 22.31l.005.02c.015.042.032.081.048.122.052.134.103.267.156.398.28.718.579 1.405.895 2.062 1.885 4.028 4.46 7.59 7.934 9.882a25.252 25.252 0 004.372 2.762c5.907 9.749 18.442 22.252 42.075 14.859 36.255-10.284 56.263 13.809 58.568 15.5 3.399 3.433-8.786-29.835-34.587-44.788-15.253-8.322-5.678-22.656-4.585-27.718 0 0 12.227 8.557 21.087-4.52 8.004 2.062 13.367-1.462 20.25 1.03 4.184 1.833 21.77.726 15.235-9.104 4.11-2.683 4.544-1.815 6.6-5.9 1.104-4.952-1.403-6.012-2.167-7.366zM63.106 32.768c-.041.018-.086.04-.125.056.039-.034.075-.062.115-.102l.01.046zm-13.413 4.523c-.073.429-.143.829-.212 1.216.037-.832.085-1.714.143-2.646.024.435.05.904.069 1.43zm10.693-6.333c.746 1.124 1.662 2.179 1.662 2.179s-.875-.79-1.662-2.179z"}),(0,t.jsx)("path",{fill:"#7a9",stroke:"#000",strokeWidth:".5",d:"M6.448 104.253s10.02 36.105 46.549 24.68c36.255-10.284 56.263 13.809 58.568 15.5 3.399 3.433-8.786-29.835-34.587-44.788-15.253-8.322-5.678-22.656-4.585-27.718 0 0 12.227 8.557 21.087-4.52 8.004 2.062 13.367-1.462 20.25 1.03 4.184 1.833 21.77.726 15.235-9.104 4.11-2.683 4.544-1.815 6.6-5.9 1.105-4.952-1.402-6.011-2.166-7.366-.205-3.15-2.842-4.366-5.993-2.125-7.22-1.297-14.305-.687-17.8-.981-7.662-1.073-14.041-5.128-14.041-5.128.932-1.239.486-3.917-5.498-4.101-3.287-1.082-6.752-3.136-9.288-3.162-2.567 0-2.914-2.537-2.914-2.537-1.606-.87-3.924-4.252-3.9-9.438 0-3.275-6.098.318-6.098 6.784s-5.818 7.758-5.818 7.758-2.55-2.281-2.855-5.958c-.582-3.79-4.934-9.56-7.057-2.434-3.226 7.646-3.485 9.43-4.115 13.154-1.31 7.711-.345 8.012-.345 8.012l-32.824 23.43z"}),(0,t.jsx)("path",{fill:"#314b49",stroke:"#314b49",strokeWidth:".75",strokeLinecap:"round",strokeLinejoin:"round",d:"M84.11 42.833c1.549-.562.897-.415 1.153-.581-2.96.575-9.635.614-14.317-1.133.392.23 2.568.962 2.845 1.128.218.715.1 1.438 2.932 2.709 2.559.793 5.845.461 6.835-.529.109-1.684.126-1.065.553-1.594z"}),(0,t.jsx)("path",{fill:"#314b49",stroke:"#314b49",strokeWidth:".5",d:"M116.479 61.979c-2.83-2.085-4.881-.264-6.47-.413.99-.645 3.763-2.062 8.246-2.062 2.532 0 3.879 2.196 5.57 2.207 1.14.007 4.472-1.71 5.14-2.378-.97.838.454 1.755-.49 3.003-.281.359-.836 1.511-2.662 2.051-2.05.971-5.411 1.762-9.334-2.408z"}),(0,t.jsx)("path",{fill:"#314b49",d:"M54.932 24.033s-3.355 7.996.312 15.329.522-6.829 4.688-4.162c3.397.385-2.387-3.215-2.033-7.819-.176-2.892-1.77-5.194-2.967-3.348zM119.336 50.417c0 1.121-1.363 2.03-3.045 2.03 3.573-1.121-.201-4.653-3.045-2.03 0-1.121 1.363-2.03 3.045-2.03s3.045.909 3.045 2.03z"}),(0,t.jsx)("path",{fill:"#314b49",d:"M114.169 47.833c3.772-.231 6.336.323 5.536 3.138.548-1.126 1.292-2.83-1.046-3.507-1.746-.388-3.3-.378-4.49.369z"}),(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:".5",d:"M59.929 69.234c0-3.521-1.51-7.166-7.04-14.583-1.635-2.192-2.62-4.336-3.211-6.275-1.401-3.295-3.426-8.019-.613-17.233 0 0 .62-.384 0 0-2.62 1.622-3.562 6.686-13.075 9.883-3.211 1.079-7.4 1.945-12.96 2.395-9.568.773-27.886 17.314-29.113 33.097-.283 3.964.31 13.737 3.596 22.31l.005.02c.015.042.032.081.048.122.052.134.103.267.156.398.28.718.579 1.405.895 2.062 1.885 4.028 4.46 7.59 7.934 9.882 3.084 2.404 5.606 3.306 5.606 3.306-2.588-3.578-3.77-7.562-2.263-12.32.65 2.637 1.903 4.162 3.646 4.777-.615-1.884-.827-3.549 0-4.651 2.567 6.734 5.353 9.031 8.17 10.686-2.63-4.914-4.031-10.005-3.77-15.337 2.569 6.028 6.596 9.945 10.56 13.954-3.78-5.966-6.911-12.104-6.977-19.046 1.693 2.778 3.935 4.932 6.6 6.601-1.683-2.709-2.505-5.51-2.263-8.423 4.424 4.945 9.36 6.607 14.332 8.046-5.197-3.625-9.843-7.537-12.32-12.572 2.972 1.464 5.948 1.693 8.926 1.383-3.706-1.872-5.07-5.252-5.783-9.052 5.177 5.279 10.587 8.827 16.09 11.692-5.455-5.26-9.478-10.65-11.565-16.218 2.1 1.18 4.157 1.736 6.16 1.509-2.766-3.124-3.465-6.182-4.211-9.241 2.637 3.916 4.959 6.022 7.103 7.103-2.19-4.482-2.034-8.432-.503-12.068 2.524 1.675 4.902 4.295 6.915 9.303.73-2.386-.447-6.364-1.886-10.56 2.175.622 4.779 3.351 8.17 9.932-.33-3.865-2.138-7.775-4.147-11.692 3.027 3.51 7.557 12.713 6.788 10.81z"}),(0,t.jsx)("path",{fill:"#796958",stroke:"#000",strokeWidth:".5",d:"M76.27 30.176s-.252 7.472 6.717 2.603c3.61.084 2.015-3.862 2.015-3.862 2.435-.672 2.808-3.842 1.848-5.709 3.106.084 2.612-4.718 2.183-6.381 2.435-.923 2.77-3.831 1.763-6.129 2.938-.671 3.022-4.114 2.77-6.548 3.023-.168 2.604-5.457 2.604-6.549 2.604-1.679 2.016-3.946 2.425-6.573 1.605-3.25-.577-4.173-2.116-.71-1.651 3.001-3.77 4.311-3.75 6.528.755 1.259-5.625 3.106-3.61 7.052-1.428 1.763-4.785 4.03-3.592 6.733-.606 1.326-4.888 4.433-3.041 7.371-4.03 2.687-3.79 3.335-2.938 5.793-2.155 1.38-4.41 4.131-3.278 6.381z"}),(0,t.jsx)("path",{fill:"#fff",d:"M94.094-5.087s-.735 1.324-.735 2.133c0 .809 2.185.568 2.927-.227-1.625.024-2.965.289-2.192-1.906zM89.833 1.183s-.812 1.068-.183 2.316c.392.98 2.807.962 3.549.167-1.625.024-4.14-.287-3.366-2.483zM86.698 7.638s-.998 1.346-.492 2.602c0 .809 2.838.956 3.58.161-1.625.022-3.645-.489-3.088-2.763zM83.62 14.8s-1.402 1.542-.148 2.945c1.438.809 3.744.049 4.486-.746-1.625.022-4.894.076-4.337-2.199zM80.616 20.521s-1.575 1.414-.02 3.312c1.438.809 4.57.198 5.312-.597-1.624.024-5.99-1.346-5.292-2.715zM77.469 27.262s-1.403 1.542-.15 2.945c1.439.809 6.037-.186 6.779-.981-1.625.023-7.185.311-6.63-1.964z"}),(0,t.jsx)("path",{fill:"#a04d32",stroke:"#000",strokeWidth:".5",d:"M76.352 30.29c-.45-.45-.534-.896-.367-1.718 0 0 .369-4.107-16.333-.158-1.072.74 2.396 4.722 2.396 4.722s.418.215 1.047-.415c.253 1.123.852 4.081.233 4.579 1.245-.771 1.868-1.946 1.676-4.125 2.122.461 3.742 1.64 4.692 3.779.304-1.4.603-2.799-.384-4.126 2.182.285 3.88 1.496 5.362 3.124.22-.933.354-1.883 0-2.931 1.39.473 2.587 1.607 3.71 2.988 0 0 .21-3.862-2.032-5.719z"}),(0,t.jsx)("path",{opacity:".26",d:"M60.33 57.936s6.76 13.59 17.595 13.991c10.834.401 10.834-2.73 10.834-2.73s-15.527 3.048-28.43-11.261zM63.485 65.63c2.279 3.104 4.856 5.221 7.722 6.382 0 0-7.365 11.108-3.611 20.023s13.125 11.053 23.32 21.249c7.943 7.942 17.159 24.961 17.159 24.961s-17.834-14.176-29.42-13.479c0 0-2.687-9.668-10.585-17.566-11.244-11.245-16.168-25.875-4.585-41.57z"}),(0,t.jsx)("path",{opacity:".18",fill:"#fff",d:"M44.717 38.245c-3.874 2.501-8.42 7.096-24.415 8.083C3.252 53.112-7.131 73.013-3.475 86.792c1.348 7.317 3.89 14.18 3.89 14.18C-.47 95.053-.966 89.575 1.45 87.373c1.435 2.384 2.969 2.468 4.507 2.479-1.59-2.404-1.788-4.808 0-7.212 1.489 1.525 2.992 1.881 4.507 1.353-2.128-2.449-1.867-4.848 0-7.211 1.388 5.022 4.462 7.453 7.662 9.689-2.208-4.333-4.166-8.672-2.93-13.07 1.323.729 2.595.644 3.83 0-1.256-1.576-.924-3.153 0-4.732 2.948 3.04 6.214 3.724 9.466 4.507-2.661-2.454-5.543-4.527-6.761-9.465 1.5-1.811 3.269-2.685 5.408-2.253-1.901-1.167-1.65-2.543 0-4.057 2.089 1.104 4.195 1.352 6.31 1.127-2.807-1.68-8.424-4.994 11.269-20.283z"}),(0,t.jsx)("path",{opacity:".27",fill:"#fff",d:"M71.278 19.389c.996-.963 1.146-.65.854.285-.982 2.36.353 4.647.797 6.206l-3.871.114c.108-2.271.247-4.794 2.22-6.605z"})]})}let cs={Lightbulb:(c,a,s)=>(0,t.jsx)(e.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Robot:(c,a,s)=>(0,t.jsx)(o.H,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Aperture:(c,a,s)=>(0,t.jsx)(r.u,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),GraduationCap:(c,a,s)=>(0,t.jsx)(l.X,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Jeep:(c,a,s)=>(0,t.jsx)(m.s,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Island:(c,a,s)=>(0,t.jsx)(i.W,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),MathOperations:(c,a,s)=>(0,t.jsx)(u.M,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Asclepius:(c,a,s)=>(0,t.jsx)(d.N,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Couch:(c,a,s)=>(0,t.jsx)(x.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Code:(c,a,s)=>(0,t.jsx)(j.E,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Atom:(c,a,s)=>(0,t.jsx)(N.h,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),ClockCounterClockwise:(c,a,s)=>(0,t.jsx)(f.y,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Globe:(c,a,s)=>(0,t.jsx)(h.T,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Palette:(c,a,s)=>(0,t.jsx)(g.Y,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Book:(c,a,s)=>(0,t.jsx)(p.f,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Confetti:(c,a,s)=>(0,t.jsx)(k.D,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),House:(c,a,s)=>(0,t.jsx)(b.T,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Translate:(c,a,s)=>(0,t.jsx)(z.v,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),BowlFood:(c,a,s)=>(0,t.jsx)(w.a,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Lectern:(c,a,s)=>(0,t.jsx)(M.G,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Wallet:(c,a,s)=>(0,t.jsx)(v.w,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),PencilLine:(c,a,s)=>(0,t.jsx)(C.z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Chalkboard:(c,a,s)=>(0,t.jsx)(y.a,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Cigarette:(c,a,s)=>(0,t.jsx)(E.m,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),CraneTower:(c,a,s)=>(0,t.jsx)(W.E,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Heart:(c,a,s)=>(0,t.jsx)(L.X,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Leaf:(c,a,s)=>(0,t.jsx)(B.B,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),NewspaperClipping:(c,a,s)=>(0,t.jsx)(H.g,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),OrangeSlice:(c,a,s)=>(0,t.jsx)(T.R,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),SmileyMelting:(c,a,s)=>(0,t.jsx)(_.N,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),YinYang:(c,a,s)=>(0,t.jsx)(A.x,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),SneakerMove:(c,a,s)=>(0,t.jsx)(G.D,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Student:(c,a,s)=>(0,t.jsx)(I.Z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Oven:(c,a,s)=>(0,t.jsx)(O.o,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Gavel:(c,a,s)=>(0,t.jsx)(S._,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")}),Broadcast:(c,a,s)=>(0,t.jsx)(Y.z,{className:"".concat(a," ").concat(s," ").concat(c," mr-2")})};function ct(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=null!=a?a:"h-4 w-4";return c.includes("summarize")?(0,t.jsx)(D.U,{className:s}):c.includes("help")?(0,t.jsx)(F.H,{className:s}):c.includes("automation")?(0,t.jsx)(o.H,{className:s}):c.includes("webpage")?(0,t.jsx)(P.A,{className:s}):c.includes("notes")?(0,t.jsx)(R.a,{className:s}):c.includes("image")?(0,t.jsx)(X.E,{className:s}):c.includes("default")?(0,t.jsx)(Z.E,{className:s}):c.includes("diagram")?(0,t.jsx)(J.j,{className:s}):c.includes("general")?(0,t.jsx)(K.K,{className:s}):c.includes("online")?(0,t.jsx)(U.u,{className:s}):c.includes("text")?(0,t.jsx)(C.z,{className:s}):c.includes("code")?(0,t.jsx)(j.E,{className:s}):(0,t.jsx)($.o,{className:s})}function cn(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"gray",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"w-6",t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"h-6",e=cs[c],o=a.toLowerCase(),r=(0,n.oz)(o);return e?e(r,s,t):null}function ce(c){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"w-6 h-6 text-muted-foreground inline-flex mr-1";switch(c.split(".").pop()){case"org":return(0,t.jsx)(ca,{className:a});case"markdown":case"md":return(0,t.jsx)(q.Y,{className:a});case"pdf":return(0,t.jsx)(Q.y,{className:a});case"doc":case"docx":return(0,t.jsx)(V.t,{className:a});case"csv":case"json":return(0,t.jsx)(u.M,{className:a});case"txt":return(0,t.jsx)(R.a,{className:a});case"py":return(0,t.jsx)(j.E,{className:a});case"jpg":case"jpeg":case"png":case"webp":return(0,t.jsx)(X.E,{className:a,weight:"fill"});default:return(0,t.jsx)(cc.$,{className:a,weight:"fill"})}}function co(){return Object.keys(cs)}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,t,n){Promise.resolve().then(n.bind(n,89915))},89915:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var a=n(57437),l=n(15283),o=n.n(l),s=n(29039),i=n(2265),r=n(79306),d=n(35418),c=n(64945),u=n(90837),p=n(66820),m=n(58485),f=n(48861),h=n(47412),g=n(69591),x=n(81970),v=n(39343),j=n(31014);let b=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),_=e=>fetch(e).then(e=>e.json());function y(e){let[t,n]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),[s,r]=(0,i.useState)(!0),c=(0,v.cI)({resolver:(0,j.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,a.jsxs)(u.Vq,{open:t,onOpenChange:n,children:[(0,a.jsx)(u.hg,{children:(0,a.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,a.jsx)(d.v,{}),"Create Agent"]})}),(0,a.jsxs)(u.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,a.jsx)(u.fK,{children:"Create Agent"}),!e.userProfile&&s&&(0,a.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:r}),(0,a.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(),n(!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:n}=(0,s.ZP)("agents",b,{revalidateOnFocus:!1}),l=(0,r.GW)(),{userConfig:d}=(0,r.h2)(!0),[u,v]=(0,i.useState)(!1),j=(0,g.IC)(),[O,w]=(0,i.useState)([]),[N,L]=(0,i.useState)([]),[M,C]=(0,i.useState)(null),{data:E,error:S}=(0,s.ZP)(d?"/api/content/computer":null,_),{data:Z,error:P}=(0,s.ZP)("/api/agents/options",_),[A,T]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{A&&(n(),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));L(t);{let n=new URLSearchParams(window.location.search).get("agent");if(n){C(n);let a=e.find(e=>e.slug===n);a||(a=t.find(e=>e.slug===n)),a||fetch("/api/agents/".concat(n)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&L(t=>[...t,e])})}}}},[e,l]),t)return(0,a.jsxs)("main",{className:o().main,children:[(0,a.jsx)("div",{className:"".concat(o().titleBar," text-5xl"),children:"Agents"}),(0,a.jsx)("div",{className:o().agentList,children:"Error loading agents"})]});if(!e)return(0,a.jsx)("main",{className:o().main,children:(0,a.jsxs)("div",{className:o().agentList,children:[(0,a.jsx)(m.l,{})," booting up your agents"]})});let R=(null==d?void 0:d.chat_model_options)||[],k=(null==d?void 0:d.selected_chat_model_config)||0,z=(0,r.T8)(d),F=R.find(e=>e.id===k);return(0,a.jsx)("main",{className:"w-full mx-auto",children:(0,a.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,a.jsx)("div",{className:"".concat(o().sidePanel," top-0"),children:(0,a.jsx)(f.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:j})}),(0,a.jsxs)("div",{className:"".concat(o().pageLayout," w-full"),children:[(0,a.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,a.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,a.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,a.jsx)(y,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:j,filesOptions:E||[],modelOptions:(null==d?void 0:d.chat_model_options)||[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}})})]}),u&&(0,a.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:v}),(0,a.jsx)(h.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(h.X,{children:[(0,a.jsx)(c.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,a.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,a.jsx)("div",{className:"pt-6 md:pt-8",children:(0,a.jsx)("div",{className:"".concat(o().agentList),children:O.map(e=>(0,a.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:j,filesOptions:null!=E?E:[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],editCard:!0,agentSlug:M||"",inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}},e.slug))})}),(0,a.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,a.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,a.jsx)("div",{className:"".concat(o().agentList),children:N.map(e=>(0,a.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:j,editCard:!1,filesOptions:null!=E?E:[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],agentSlug:M||"",inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}},e.slug))})]})]})]})})}},66820:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(57437),l=n(6780),o=n(87138);function s(e){return(0,a.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,a.jsxs)(l._T,{children:[(0,a.jsx)(l.fY,{children:(0,a.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,a.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,a.jsx)(o.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,a.jsxs)(l.xo,{children:[(0,a.jsx)(l.le,{children:"Dismiss"}),(0,a.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,a.jsxs)(o.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var a=n(57437),l=n(2265),o=n(52431),s=n(37440);let i=l.forwardRef((e,t)=>{let{className:n,value:l,indicatorColor:i,...r}=e;return(0,a.jsx)(o.fC,{ref:t,className:(0,s.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...r,children:(0,a.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},93146:function(e,t,n){"use strict";n.d(t,{g:function(){return s}});var a=n(57437),l=n(2265),o=n(37440);let s=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,a.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",n),ref:t,...l})});s.displayName="Textarea"},19666:function(e,t,n){"use strict";n.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return r}});var a=n(57437),l=n(2265),o=n(27071),s=n(37440);let i=o.zt,r=o.fC,d=o.xz,c=l.forwardRef((e,t)=>{let{className:n,sideOffset:l=4,...i}=e;return(0,a.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",n),...i})});c.displayName=o.VY.displayName},15283: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"}},64945:function(e,t,n){"use strict";n.d(t,{B:function(){return h}});var a=n(2265),l=n(52195);let o=new Map([["bold",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&p(e,n,t[n]);if(d)for(var n of d(t))u.call(t,n)&&p(e,n,t[n]);return e},f=(e,t)=>i(e,r(t));let h=(0,a.forwardRef)((e,t)=>a.createElement(l.Z,f(m({ref:t},e),{weights:o})));h.displayName="Lightning"}},function(e){e.O(0,[9848,9001,3062,3124,3803,5512,4602,1603,9417,1970,2971,7023,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,t,n){Promise.resolve().then(n.bind(n,89915))},89915:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var a=n(57437),l=n(15283),o=n.n(l),s=n(29039),i=n(2265),r=n(79306),d=n(35418),c=n(64945),u=n(90837),p=n(66820),m=n(58485),f=n(48861),h=n(47412),g=n(69591),x=n(81970),v=n(39343),j=n(31014);let b=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),_=e=>fetch(e).then(e=>e.json());function y(e){let[t,n]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),[s,r]=(0,i.useState)(!0),c=(0,v.cI)({resolver:(0,j.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,a.jsxs)(u.Vq,{open:t,onOpenChange:n,children:[(0,a.jsx)(u.hg,{children:(0,a.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,a.jsx)(d.v,{}),"Create Agent"]})}),(0,a.jsxs)(u.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,a.jsx)(u.fK,{children:"Create Agent"}),!e.userProfile&&s&&(0,a.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:r}),(0,a.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(),n(!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:n}=(0,s.ZP)("agents",b,{revalidateOnFocus:!1}),l=(0,r.GW)(),{userConfig:d}=(0,r.h2)(!0),[u,v]=(0,i.useState)(!1),j=(0,g.IC)(),[O,w]=(0,i.useState)([]),[N,L]=(0,i.useState)([]),[M,C]=(0,i.useState)(null),{data:E,error:S}=(0,s.ZP)(d?"/api/content/computer":null,_),{data:Z,error:P}=(0,s.ZP)("/api/agents/options",_),[A,T]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{A&&(n(),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));L(t);{let n=new URLSearchParams(window.location.search).get("agent");if(n){C(n);let a=e.find(e=>e.slug===n);a||(a=t.find(e=>e.slug===n)),a||fetch("/api/agents/".concat(n)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&L(t=>[...t,e])})}}}},[e,l]),t)return(0,a.jsxs)("main",{className:o().main,children:[(0,a.jsx)("div",{className:"".concat(o().titleBar," text-5xl"),children:"Agents"}),(0,a.jsx)("div",{className:o().agentList,children:"Error loading agents"})]});if(!e)return(0,a.jsx)("main",{className:o().main,children:(0,a.jsxs)("div",{className:o().agentList,children:[(0,a.jsx)(m.l,{})," booting up your agents"]})});let R=(null==d?void 0:d.chat_model_options)||[],k=(null==d?void 0:d.selected_chat_model_config)||0,z=(0,r.T8)(d),F=R.find(e=>e.id===k);return(0,a.jsx)("main",{className:"w-full mx-auto",children:(0,a.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,a.jsx)("div",{className:"".concat(o().sidePanel," top-0"),children:(0,a.jsx)(f.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:j})}),(0,a.jsxs)("div",{className:"".concat(o().pageLayout," w-full"),children:[(0,a.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,a.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,a.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,a.jsx)(y,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:j,filesOptions:E||[],modelOptions:(null==d?void 0:d.chat_model_options)||[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}})})]}),u&&(0,a.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:v}),(0,a.jsx)(h.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(h.X,{children:[(0,a.jsx)(c.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,a.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,a.jsx)("div",{className:"pt-6 md:pt-8",children:(0,a.jsx)("div",{className:"".concat(o().agentList),children:O.map(e=>(0,a.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:j,filesOptions:null!=E?E:[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],editCard:!0,agentSlug:M||"",inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}},e.slug))})}),(0,a.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,a.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,a.jsx)("div",{className:"".concat(o().agentList),children:N.map(e=>(0,a.jsx)(x.EY,{data:e,userProfile:l,isMobileWidth:j,editCard:!1,filesOptions:null!=E?E:[],selectedChatModelOption:(null==F?void 0:F.name)||"",isSubscribed:z,setAgentChangeTriggered:T,modelOptions:(null==d?void 0:d.chat_model_options)||[],agentSlug:M||"",inputToolOptions:(null==Z?void 0:Z.input_tools)||{},outputModeOptions:(null==Z?void 0:Z.output_modes)||{}},e.slug))})]})]})]})})}},66820:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(57437),l=n(6780),o=n(87138);function s(e){return(0,a.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,a.jsxs)(l._T,{children:[(0,a.jsx)(l.fY,{children:(0,a.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,a.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,a.jsx)(o.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,a.jsxs)(l.xo,{children:[(0,a.jsx)(l.le,{children:"Dismiss"}),(0,a.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,a.jsxs)(o.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var a=n(57437),l=n(2265),o=n(52431),s=n(37440);let i=l.forwardRef((e,t)=>{let{className:n,value:l,indicatorColor:i,...r}=e;return(0,a.jsx)(o.fC,{ref:t,className:(0,s.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...r,children:(0,a.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},93146:function(e,t,n){"use strict";n.d(t,{g:function(){return s}});var a=n(57437),l=n(2265),o=n(37440);let s=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,a.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",n),ref:t,...l})});s.displayName="Textarea"},19666:function(e,t,n){"use strict";n.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return r}});var a=n(57437),l=n(2265),o=n(27071),s=n(37440);let i=o.zt,r=o.fC,d=o.xz,c=l.forwardRef((e,t)=>{let{className:n,sideOffset:l=4,...i}=e;return(0,a.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",n),...i})});c.displayName=o.VY.displayName},15283: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"}},64945:function(e,t,n){"use strict";n.d(t,{B:function(){return h}});var a=n(2265),l=n(52195);let o=new Map([["bold",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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",a.createElement(a.Fragment,null,a.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,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&p(e,n,t[n]);if(d)for(var n of d(t))u.call(t,n)&&p(e,n,t[n]);return e},f=(e,t)=>i(e,r(t));let h=(0,a.forwardRef)((e,t)=>a.createElement(l.Z,f(m({ref:t},e),{weights:o})));h.displayName="Lightning"}},function(e){e.O(0,[9460,9448,9001,3062,3124,3803,5512,4602,1603,9417,1970,2971,7023,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4371],{2743:function(e,t,a){Promise.resolve().then(a.bind(a,19648))},19648:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ex}});var n=a(57437),s=a(29039),r=a(58485),o=a(36013),i=a(50495),l=a(46294),c=a(18760),d=a.n(c),u=a(31014),m=a(39343),h=a(59772),x=a(2265),f=a(32653),p=a(83102),g=a(90837),j=a(13304),y=a(93146),w=a(69591),v=a(23611),N=a.n(v),b=a(18642),D=a(16463),C=a(19573),k=a(20319),S=a(22049),_=a(55362),I=a(13537),A=a(76082),M=a(52674),R=a(23751),T=a(83522),z=a(8837),P=a(21819),L=a(35418),O=a(64945),W=a(79306),q=a(66820),E=a(35657),U=a(50151),F=a(47412),B=a(48861),V=a(7951);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 Y(e){return d().toString(e)}let $=["Day","Week","Month"],H=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:"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:"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:"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:"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,x.useState)(!1),[s,r]=(0,x.useState)(null),[l,c]=(0,x.useState)(!1),[d,u]=(0,x.useState)(""),{toast:m}=(0,E.pm)(),h=e.automation,[f,p]=(0,x.useState)(""),[g,j]=(0,x.useState)("");return((0,x.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,x.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:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border ".concat(N().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)(C.J2,{children:[(0,n.jsx)(C.xo,{asChild:!0,children:(0,n.jsx)(i.z,{className:"bg-background",variant:"ghost",children:(0,n.jsx)(k.F,{className:"h-4 w-4"})})}),(0,n.jsxs)(C.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)(b.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)(S.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:f})]}),(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,D.useSearchParams)(),[a,s]=(0,x.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:Y(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:Y(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,x.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)(f.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)(f.xJ,{className:"space-y-1",children:(0,n.jsxs)(f.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",children:[(0,n.jsx)(T.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",children:[(0,n.jsx)(z.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",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)(f.Wi,{control:e.form.control,name:"subject",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"space-y-1",children:[(0,n.jsx)(f.lX,{children:"Subject"}),(0,n.jsx)(f.pf,{children:"This is the subject of the email you will receive."}),(0,n.jsx)(f.NI,{children:(0,n.jsx)(p.I,{placeholder:"Digest of Healthcare AI trends",...a})}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.subject)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(f.Wi,{control:e.form.control,name:"everyBlah",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.lX,{children:"Frequency"}),(0,n.jsx)(f.pf,{children:"How often should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(f.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:$.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.everyBlah)||void 0===t?void 0:t.message})]})}}),"Week"===e.form.watch("everyBlah")&&(0,n.jsx)(f.Wi,{control:e.form.control,name:"dayOfWeek",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.dayOfWeek)||void 0===t?void 0:t.message})]})}}),"Month"===e.form.watch("everyBlah")&&(0,n.jsx)(f.Wi,{control:e.form.control,name:"dayOfMonth",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.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)(f.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:H.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.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)(f.Wi,{control:e.form.control,name:"timeRecurrence",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.lX,{children:"Time"}),(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.timeRecurrence)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(f.Wi,{control:e.form.control,name:"queryToRun",render:t=>{var a;let{field:s}=t;return(0,n.jsxs)(f.xJ,{className:"space-y-1",children:[(0,n.jsx)(f.lX,{children:"Instructions"}),(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.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)(V.dy,{open:e.isCreating,onOpenChange:t=>{e.setIsCreating(t)},children:[(0,n.jsx)(V.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)(V.sc,{className:"p-2",children:[(0,n.jsx)(V.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 ex(){let e=(0,W.GW)(),{data:t,error:a,isLoading:o}=(0,s.ZP)(e?"automations":null,G,{revalidateOnFocus:!1}),[l,c]=(0,x.useState)(!1),[d,u]=(0,x.useState)(null),[m,h]=(0,x.useState)([]),[f,p]=(0,x.useState)([]),[g,j]=(0,x.useState)(!1),y=(0,w.IC)(),v=(0,w.k6)();return((0,x.useEffect)(()=>{d&&(h([...m,d]),u(null))},[d,m]),(0,x.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(N().sidePanel," top-0"),children:(0,n.jsx)(B.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:y})}),(0,n.jsxs)("div",{className:"".concat(N().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",children:[(0,n.jsx)(T.w,{className:"h-4 w-4 mr-2 inline text-orange-500 shadow-sm"}),e.email]}):null,v&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",children:[(0,n.jsx)(z.x,{className:"h-4 w-4 mr-2 inline text-purple-500"}),v?"".concat(v.city,", ").concat(v.country):"Unknown"]}),v&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",children:[(0,n.jsx)(P.S,{className:"h-4 w-4 mr-2 inline text-green-500"}),v?"".concat(v.timezone):"Unknown"]})]})]}),g&&(0,n.jsx)(q.Z,{loginRedirectMessage:"Create an account to make your own automation",onOpenChange:j}),(0,n.jsx)(F.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(F.X,{children:[(0,n.jsx)(O.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.jsxs)("div",{className:"flex justify-between items-center py-4",children:[(0,n.jsx)("h3",{className:"text-xl",children:"Your Creations"}),e?(0,n.jsx)(eh,{isMobileWidth:y,callToAction:"Create Automation",createNew:!0,setIsCreating:c,setShowLoginPrompt:j,setNewAutomationData:u,authenticatedData:e,isCreating:l,ipLocationData:v}):(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)(x.Suspense,{children:(0,n.jsx)(ec,{isMobileWidth:y,authenticatedData:e,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j,setNewAutomationData:u})}),(!t||0===t.length)&&0==m.length&&!o&&(0,n.jsxs)("div",{className:"px-4",children:["So empty! Create your own automation to get started.",(0,n.jsx)("div",{className:"mt-4",children:e?(0,n.jsx)(eh,{isMobileWidth:y,callToAction:"Design Automation",createNew:!0,setIsCreating:c,setShowLoginPrompt:j,setNewAutomationData:u,authenticatedData:e,isCreating:l,ipLocationData:v}):(0,n.jsx)(i.z,{onClick:()=>j(!0),variant:"default",children:"Design"})})]}),o&&(0,n.jsx)(r.l,{message:"booting up your automations"}),(0,n.jsxs)("div",{className:"".concat(N().automationsLayout),children:[t&&t.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j},t.id)),m.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j},t.id))]}),(0,n.jsx)("h3",{className:"text-xl py-4",children:"Try these out"}),(0,n.jsx)("div",{className:"".concat(N().automationsLayout),children:f.map(t=>(0,n.jsx)(el,{isMobileWidth:y,setNewAutomationData:u,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j,suggestedCard:!0},t.id))})]})]})})}},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var n=a(57437),s=a(6780),r=a(87138);function o(e){return(0,n.jsx)(s.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,n.jsxs)(s._T,{children:[(0,n.jsx)(s.fY,{children:(0,n.jsx)(s.f$,{children:"Sign in to Khoj to continue"})}),(0,n.jsxs)(s.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,n.jsx)(r.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,n.jsxs)(s.xo,{children:[(0,n.jsx)(s.le,{children:"Dismiss"}),(0,n.jsx)(s.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,n.jsxs)(r.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},18642:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var n=a(57437),s=a(90837),r=a(50495),o=a(83102),i=a(67135),l=a(34797);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"})})]})]})]})}},47412: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(12218),o=a(37440);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"},32653:function(e,t,a){"use strict";a.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return g},xJ:function(){return x},zG:function(){return j}});var n=a(57437),s=a(2265),r=a(71538),o=a(39343),i=a(37440),l=a(67135);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({}),x=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})})});x.displayName="FormItem";let f=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})});f.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"},67135:function(e,t,a){"use strict";a.d(t,{_:function(){return c}});var n=a(57437),s=a(2265),r=a(38364),o=a(12218),i=a(37440);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},46294:function(e,t,a){"use strict";a.d(t,{Bw:function(){return f},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(77539),o=a(42421),i=a(14392),l=a(22468),c=a(37440);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 x=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"})})});x.displayName=r.$G.displayName;let f=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)(x,{})]})})});f.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},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var n=a(57437),s=a(2265),r=a(37440);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"},50151:function(e,t,a){"use strict";a.d(t,{FN:function(){return m},Mi:function(){return f},VW:function(){return c},_i:function(){return d},gD:function(){return h},lj:function(){return p},sA:function(){return x}});var n=a(57437),s=a(2265),r=a(44504),o=a(12218),i=a(74697),l=a(37440);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 x=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"})})});x.displayName=r.x8.displayName;let f=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})});f.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},35657: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})}}},23611: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,[2734,9848,9001,3062,5512,4504,1279,1603,2971,7023,1744],function(){return e(e.s=2743)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4371],{2743:function(e,t,a){Promise.resolve().then(a.bind(a,19648))},19648:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ex}});var n=a(57437),s=a(29039),r=a(58485),o=a(36013),i=a(50495),l=a(46294),c=a(18760),d=a.n(c),u=a(31014),m=a(39343),h=a(59772),x=a(2265),f=a(32653),p=a(83102),g=a(90837),j=a(13304),y=a(93146),w=a(69591),v=a(23611),N=a.n(v),b=a(18642),D=a(16463),C=a(19573),k=a(20319),S=a(22049),_=a(55362),I=a(13537),A=a(76082),M=a(52674),R=a(23751),T=a(83522),z=a(8837),P=a(21819),L=a(35418),O=a(64945),W=a(79306),q=a(66820),E=a(35657),U=a(50151),F=a(47412),B=a(48861),V=a(7951);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 Y(e){return d().toString(e)}let $=["Day","Week","Month"],H=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:"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:"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:"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:"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,x.useState)(!1),[s,r]=(0,x.useState)(null),[l,c]=(0,x.useState)(!1),[d,u]=(0,x.useState)(""),{toast:m}=(0,E.pm)(),h=e.automation,[f,p]=(0,x.useState)(""),[g,j]=(0,x.useState)("");return((0,x.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,x.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:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border ".concat(N().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)(C.J2,{children:[(0,n.jsx)(C.xo,{asChild:!0,children:(0,n.jsx)(i.z,{className:"bg-background",variant:"ghost",children:(0,n.jsx)(k.F,{className:"h-4 w-4"})})}),(0,n.jsxs)(C.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)(b.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)(S.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:f})]}),(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,D.useSearchParams)(),[a,s]=(0,x.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:Y(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:Y(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,x.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)(f.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)(f.xJ,{className:"space-y-1",children:(0,n.jsxs)(f.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",children:[(0,n.jsx)(T.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",children:[(0,n.jsx)(z.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",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)(f.Wi,{control:e.form.control,name:"subject",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"space-y-1",children:[(0,n.jsx)(f.lX,{children:"Subject"}),(0,n.jsx)(f.pf,{children:"This is the subject of the email you will receive."}),(0,n.jsx)(f.NI,{children:(0,n.jsx)(p.I,{placeholder:"Digest of Healthcare AI trends",...a})}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.subject)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(f.Wi,{control:e.form.control,name:"everyBlah",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.lX,{children:"Frequency"}),(0,n.jsx)(f.pf,{children:"How often should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(f.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:$.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.everyBlah)||void 0===t?void 0:t.message})]})}}),"Week"===e.form.watch("everyBlah")&&(0,n.jsx)(f.Wi,{control:e.form.control,name:"dayOfWeek",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.dayOfWeek)||void 0===t?void 0:t.message})]})}}),"Month"===e.form.watch("everyBlah")&&(0,n.jsx)(f.Wi,{control:e.form.control,name:"dayOfMonth",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.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)(f.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:H.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(f.zG,{}),o.subject&&(0,n.jsx)(f.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)(f.Wi,{control:e.form.control,name:"timeRecurrence",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(f.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(f.lX,{children:"Time"}),(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.zG,{children:null===(t=o.timeRecurrence)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(f.Wi,{control:e.form.control,name:"queryToRun",render:t=>{var a;let{field:s}=t;return(0,n.jsxs)(f.xJ,{className:"space-y-1",children:[(0,n.jsx)(f.lX,{children:"Instructions"}),(0,n.jsx)(f.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)(f.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)(f.zG,{}),o.subject&&(0,n.jsx)(f.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)(V.dy,{open:e.isCreating,onOpenChange:t=>{e.setIsCreating(t)},children:[(0,n.jsx)(V.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)(V.sc,{className:"p-2",children:[(0,n.jsx)(V.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 ex(){let e=(0,W.GW)(),{data:t,error:a,isLoading:o}=(0,s.ZP)(e?"automations":null,G,{revalidateOnFocus:!1}),[l,c]=(0,x.useState)(!1),[d,u]=(0,x.useState)(null),[m,h]=(0,x.useState)([]),[f,p]=(0,x.useState)([]),[g,j]=(0,x.useState)(!1),y=(0,w.IC)(),v=(0,w.k6)();return((0,x.useEffect)(()=>{d&&(h([...m,d]),u(null))},[d,m]),(0,x.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(N().sidePanel," top-0"),children:(0,n.jsx)(B.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:y})}),(0,n.jsxs)("div",{className:"".concat(N().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",children:[(0,n.jsx)(T.w,{className:"h-4 w-4 mr-2 inline text-orange-500 shadow-sm"}),e.email]}):null,v&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",children:[(0,n.jsx)(z.x,{className:"h-4 w-4 mr-2 inline text-purple-500"}),v?"".concat(v.city,", ").concat(v.country):"Unknown"]}),v&&(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",children:[(0,n.jsx)(P.S,{className:"h-4 w-4 mr-2 inline text-green-500"}),v?"".concat(v.timezone):"Unknown"]})]})]}),g&&(0,n.jsx)(q.Z,{loginRedirectMessage:"Create an account to make your own automation",onOpenChange:j}),(0,n.jsx)(F.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(F.X,{children:[(0,n.jsx)(O.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.jsxs)("div",{className:"flex justify-between items-center py-4",children:[(0,n.jsx)("h3",{className:"text-xl",children:"Your Creations"}),e?(0,n.jsx)(eh,{isMobileWidth:y,callToAction:"Create Automation",createNew:!0,setIsCreating:c,setShowLoginPrompt:j,setNewAutomationData:u,authenticatedData:e,isCreating:l,ipLocationData:v}):(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)(x.Suspense,{children:(0,n.jsx)(ec,{isMobileWidth:y,authenticatedData:e,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j,setNewAutomationData:u})}),(!t||0===t.length)&&0==m.length&&!o&&(0,n.jsxs)("div",{className:"px-4",children:["So empty! Create your own automation to get started.",(0,n.jsx)("div",{className:"mt-4",children:e?(0,n.jsx)(eh,{isMobileWidth:y,callToAction:"Design Automation",createNew:!0,setIsCreating:c,setShowLoginPrompt:j,setNewAutomationData:u,authenticatedData:e,isCreating:l,ipLocationData:v}):(0,n.jsx)(i.z,{onClick:()=>j(!0),variant:"default",children:"Design"})})]}),o&&(0,n.jsx)(r.l,{message:"booting up your automations"}),(0,n.jsxs)("div",{className:"".concat(N().automationsLayout),children:[t&&t.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j},t.id)),m.map(t=>(0,n.jsx)(el,{isMobileWidth:y,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j},t.id))]}),(0,n.jsx)("h3",{className:"text-xl py-4",children:"Try these out"}),(0,n.jsx)("div",{className:"".concat(N().automationsLayout),children:f.map(t=>(0,n.jsx)(el,{isMobileWidth:y,setNewAutomationData:u,authenticatedData:e,automation:t,locationData:v,isLoggedIn:!!e,setShowLoginPrompt:j,suggestedCard:!0},t.id))})]})]})})}},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var n=a(57437),s=a(6780),r=a(87138);function o(e){return(0,n.jsx)(s.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,n.jsxs)(s._T,{children:[(0,n.jsx)(s.fY,{children:(0,n.jsx)(s.f$,{children:"Sign in to Khoj to continue"})}),(0,n.jsxs)(s.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,n.jsx)(r.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,n.jsxs)(s.xo,{children:[(0,n.jsx)(s.le,{children:"Dismiss"}),(0,n.jsx)(s.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,n.jsxs)(r.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},18642:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var n=a(57437),s=a(90837),r=a(50495),o=a(83102),i=a(67135),l=a(34797);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"})})]})]})]})}},47412: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(12218),o=a(37440);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"},32653:function(e,t,a){"use strict";a.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return g},xJ:function(){return x},zG:function(){return j}});var n=a(57437),s=a(2265),r=a(71538),o=a(39343),i=a(37440),l=a(67135);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({}),x=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})})});x.displayName="FormItem";let f=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})});f.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"},67135:function(e,t,a){"use strict";a.d(t,{_:function(){return c}});var n=a(57437),s=a(2265),r=a(38364),o=a(12218),i=a(37440);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},46294:function(e,t,a){"use strict";a.d(t,{Bw:function(){return f},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(77539),o=a(42421),i=a(14392),l=a(22468),c=a(37440);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 x=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"})})});x.displayName=r.$G.displayName;let f=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)(x,{})]})})});f.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},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var n=a(57437),s=a(2265),r=a(37440);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"},50151:function(e,t,a){"use strict";a.d(t,{FN:function(){return m},Mi:function(){return f},VW:function(){return c},_i:function(){return d},gD:function(){return h},lj:function(){return p},sA:function(){return x}});var n=a(57437),s=a(2265),r=a(44504),o=a(12218),i=a(74697),l=a(37440);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 x=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"})})});x.displayName=r.x8.displayName;let f=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})});f.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},35657: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})}}},23611: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,[9448,9001,3062,5512,4504,1279,1603,2971,7023,1744],function(){return e(e.s=2743)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(65104),n=s.n(o),i=s(2265),r=s(48861),c=s(55538),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(38423),g=s(79306);function f(e){let t=(0,l.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,_]=(0,i.useState)(!1),x=(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")&&_(!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)(c.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:x,isResearchModeEnabled:p})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,c]=(0,i.useState)(!0),[l,m]=(0,i.useState)(e),[p,_]=(0,i.useState)(null),[x,y]=(0,i.useState)([]),[w,S]=(0,i.useState)(""),[I,v]=(0,i.useState)(!1),[b,j]=(0,i.useState)(void 0),[B,C]=(0,i.useState)([]),M=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},E=(0,g.GW)(),F=(0,h.IC)();async function T(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:c,value:l}=await t.read();if(c){S(""),v(!1),C([]),p&&(0,u.tQ)(p,m);break}for(o+=s.decode(l,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=x.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([...x])}}}}async function k(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...M&&{city:M.city,region:M.region,country:M.country,country_code:M.countryCode,timezone:M.timezone},...B.length>0&&{images:B},...b&&{files:b}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await T(t)}catch(o){let e=await t.json();console.error(e);let s=x.find(e=>!e.completed);if(!s)return;let a=o.message;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?":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([...x]),S(""),v(!1)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},codeContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",images:B,queryFiles:b};y(t=>[...t,e]),v(!0)}},[w]),(0,i.useEffect)(()=>{I&&k()},[I]),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(l&&l!==e?": ".concat(l):"")}),(0,a.jsx)("div",{children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:[],isMobileWidth:F})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!F&&p&&(0,a.jsxs)("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:[l&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:l}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==E,streamedMessages:x,setStreamedMessages:y,chatOptionsData:t,setTitle:m,setQueryToProcess:S,setUploadedFiles:j,isMobileWidth:F,onConversationIdChange:e=>{_(e)},setImages:C})})]})})]})}},16463:function(e,t,s){"use strict";var a=s(71169);s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},65104: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,[7812,9848,4836,3954,9001,3062,3124,3803,2261,5961,1603,9417,8423,5538,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(65104),n=s.n(o),i=s(2265),r=s(48861),c=s(55538),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(38423),g=s(79306);function f(e){let t=(0,l.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,_]=(0,i.useState)(!1),x=(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")&&_(!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)(c.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:x,isResearchModeEnabled:p})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,c]=(0,i.useState)(!0),[l,m]=(0,i.useState)(e),[p,_]=(0,i.useState)(null),[x,y]=(0,i.useState)([]),[w,S]=(0,i.useState)(""),[I,v]=(0,i.useState)(!1),[b,j]=(0,i.useState)(void 0),[B,C]=(0,i.useState)([]),M=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},E=(0,g.GW)(),F=(0,h.IC)();async function T(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:c,value:l}=await t.read();if(c){S(""),v(!1),C([]),p&&(0,u.tQ)(p,m);break}for(o+=s.decode(l,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=x.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([...x])}}}}async function k(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...M&&{city:M.city,region:M.region,country:M.country,country_code:M.countryCode,timezone:M.timezone},...B.length>0&&{images:B},...b&&{files:b}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await T(t)}catch(o){let e=await t.json();console.error(e);let s=x.find(e=>!e.completed);if(!s)return;let a=o.message;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?":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([...x]),S(""),v(!1)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},codeContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",images:B,queryFiles:b};y(t=>[...t,e]),v(!0)}},[w]),(0,i.useEffect)(()=>{I&&k()},[I]),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(l&&l!==e?": ".concat(l):"")}),(0,a.jsx)("div",{children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:[],isMobileWidth:F})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!F&&p&&(0,a.jsxs)("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:[l&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:l}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==E,streamedMessages:x,setStreamedMessages:y,chatOptionsData:t,setTitle:m,setQueryToProcess:S,setUploadedFiles:j,isMobileWidth:F,onConversationIdChange:e=>{_(e)},setImages:C})})]})})]})}},16463:function(e,t,s){"use strict";var a=s(71169);s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},65104: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,[7812,9448,4836,3954,9001,3062,3124,3803,2261,5961,1603,9417,8423,5538,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);