khoj 1.27.2.dev12__py3-none-any.whl → 1.27.2.dev13__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 (41) hide show
  1. khoj/interface/compiled/404/index.html +1 -1
  2. khoj/interface/compiled/_next/static/chunks/{9479-4b443fdcc99141c9.js → 9479-ff7d8c4dae2014d1.js} +1 -1
  3. khoj/interface/compiled/_next/static/chunks/app/agents/{page-2beaba7c9bb750bd.js → page-5ae1e540bb5be8a9.js} +1 -1
  4. khoj/interface/compiled/_next/static/chunks/app/automations/{page-9b5c77e0b0dd772c.js → page-774ae3e033f938cd.js} +1 -1
  5. khoj/interface/compiled/_next/static/chunks/app/chat/{page-151232d8417a1ea1.js → page-97f5b61aaf46d364.js} +1 -1
  6. khoj/interface/compiled/_next/static/chunks/app/factchecker/{page-798904432c2417c4.js → page-d82403db2866bad8.js} +1 -1
  7. khoj/interface/compiled/_next/static/chunks/app/{page-8f22b790e50dd722.js → page-4dc472cf6d674004.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/app/search/{page-ab2995529ece3140.js → page-9b64f61caa5bd7f9.js} +1 -1
  9. khoj/interface/compiled/_next/static/chunks/app/settings/{page-7946cabb9c54e22d.js → page-7a8c382af2a7e870.js} +1 -1
  10. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-6a01e07fb244c10c.js → page-eb9e282691858f2e.js} +1 -1
  11. khoj/interface/compiled/_next/static/chunks/{webpack-17202cfae517c5de.js → webpack-70a1cd2ad6a1952c.js} +1 -1
  12. khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css +1 -0
  13. khoj/interface/compiled/_next/static/css/ddcc0cf73e062476.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/factchecker/index.html +1 -1
  21. khoj/interface/compiled/factchecker/index.txt +2 -2
  22. khoj/interface/compiled/index.html +1 -1
  23. khoj/interface/compiled/index.txt +2 -2
  24. khoj/interface/compiled/search/index.html +1 -1
  25. khoj/interface/compiled/search/index.txt +2 -2
  26. khoj/interface/compiled/settings/index.html +1 -1
  27. khoj/interface/compiled/settings/index.txt +2 -2
  28. khoj/interface/compiled/share/chat/index.html +1 -1
  29. khoj/interface/compiled/share/chat/index.txt +2 -2
  30. {khoj-1.27.2.dev12.dist-info → khoj-1.27.2.dev13.dist-info}/METADATA +1 -1
  31. {khoj-1.27.2.dev12.dist-info → khoj-1.27.2.dev13.dist-info}/RECORD +39 -39
  32. khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +0 -1
  33. khoj/interface/compiled/_next/static/css/b70402177a7c3207.css +0 -1
  34. /khoj/interface/compiled/_next/static/chunks/{1970-1d6d0c1b00b4f343.js → 1970-60c96aed937a4928.js} +0 -0
  35. /khoj/interface/compiled/_next/static/chunks/{3423-8e9c420574a9fbe3.js → 3423-0b533af8bf6ac218.js} +0 -0
  36. /khoj/interface/compiled/_next/static/chunks/{9417-759984ad62caa3dc.js → 9417-2ca87207387fc790.js} +0 -0
  37. /khoj/interface/compiled/_next/static/{kul3DNllWR6eaUDc4X0eU → rYy0jmrIYv76V-iyorQim}/_buildManifest.js +0 -0
  38. /khoj/interface/compiled/_next/static/{kul3DNllWR6eaUDc4X0eU → rYy0jmrIYv76V-iyorQim}/_ssgManifest.js +0 -0
  39. {khoj-1.27.2.dev12.dist-info → khoj-1.27.2.dev13.dist-info}/WHEEL +0 -0
  40. {khoj-1.27.2.dev12.dist-info → khoj-1.27.2.dev13.dist-info}/entry_points.txt +0 -0
  41. {khoj-1.27.2.dev12.dist-info → khoj-1.27.2.dev13.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/0e790e04fd40ad16-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/467a524c75e7d7c0.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/76d55eb435962b19.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-17202cfae517c5de.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 - Home"/><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 - Home"/><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_e594dd"><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-17202cfae517c5de.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/0e790e04fd40ad16-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/467a524c75e7d7c0.css\",\"style\"]\n3:HL[\"/_next/static/css/76d55eb435962b19.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\":\"kul3DNllWR6eaUDc4X0eU\",\"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/467a524c75e7d7c0.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/76d55eb435962b19.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_e594dd\",\"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 - Home\"}],[\"$\",\"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 - Home\"}],[\"$\",\"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/0e790e04fd40ad16-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/467a524c75e7d7c0.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/76d55eb435962b19.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-70a1cd2ad6a1952c.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 - Home"/><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 - Home"/><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_e594dd"><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-70a1cd2ad6a1952c.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/0e790e04fd40ad16-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/467a524c75e7d7c0.css\",\"style\"]\n3:HL[\"/_next/static/css/76d55eb435962b19.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\":\"rYy0jmrIYv76V-iyorQim\",\"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/467a524c75e7d7c0.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/76d55eb435962b19.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_e594dd\",\"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 - Home\"}],[\"$\",\"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 - Home\"}],[\"$\",\"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 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9479],{59479:function(e,t,a){"use strict";a.d(t,{a:function(){return eL}});var r=a(57437),l=a(37649),n=a.n(l),o=a(2265),s=a(11838),i=a.n(s);a(7395);var c=a(52195);let d=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var u=Object.defineProperty,m=Object.defineProperties,h=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,b=(e,t,a)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,x=(e,t)=>{for(var a in t||(t={}))f.call(t,a)&&b(e,a,t[a]);if(p)for(var a of p(t))g.call(t,a)&&b(e,a,t[a]);return e},j=(e,t)=>m(e,h(t));let v=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,j(x({ref:t},e),{weights:d})));v.displayName="Paperclip";let y=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var w=Object.defineProperty,E=Object.defineProperties,L=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,M=(e,t,a)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,V=(e,t)=>{for(var a in t||(t={}))O.call(t,a)&&M(e,a,t[a]);if(A)for(var a of A(t))Z.call(t,a)&&M(e,a,t[a]);return e},N=(e,t)=>E(e,L(t));let F=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,N(V({ref:t},e),{weights:y})));F.displayName="X";let C=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z"}))]]);var H=Object.defineProperty,k=Object.defineProperties,P=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,T=(e,t,a)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&T(e,a,t[a]);if(D)for(var a of D(t))R.call(t,a)&&T(e,a,t[a]);return e},z=(e,t)=>k(e,P(t));let _=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,z(I({ref:t},e),{weights:C})));_.displayName="Stop";let U=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]);var Y=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,X=(e,t,a)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,q=(e,t)=>{for(var a in t||(t={}))K.call(t,a)&&X(e,a,t[a]);if(J)for(var a of J(t))B.call(t,a)&&X(e,a,t[a]);return e},G=(e,t)=>W(e,$(t));let Q=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,G(q({ref:t},e),{weights:U})));Q.displayName="Microphone";let ee=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var et=Object.defineProperty,ea=Object.defineProperties,er=Object.getOwnPropertyDescriptors,el=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,es=(e,t,a)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ei=(e,t)=>{for(var a in t||(t={}))en.call(t,a)&&es(e,a,t[a]);if(el)for(var a of el(t))eo.call(t,a)&&es(e,a,t[a]);return e},ec=(e,t)=>ea(e,er(t));let ed=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,ec(ei({ref:t},e),{weights:ee})));ed.displayName="ArrowUp";var eu=a(42491),em=a(6780),eh=a(50495),ep=a(70571),ef=a(19573),eg=a(61485),eb=a(93146),ex=a(19666),ej=a(58575),ev=a(66820),ey=a(9557),ew=a(58485),eE=a(89417);let eL=(0,o.forwardRef)((e,t)=>{let[a,l]=(0,o.useState)(""),s=(0,o.useRef)(null),[c,d]=(0,o.useState)(null),[u,m]=(0,o.useState)(null),[h,p]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[b,x]=(0,o.useState)(!1),[j,y]=(0,o.useState)(!1),[w,E]=(0,o.useState)([]),[L,A]=(0,o.useState)([]),[O,Z]=(0,o.useState)(!1),[M,V]=(0,o.useState)(null),[N,C]=(0,o.useState)(0),[H,k]=(0,o.useState)(!1);function P(){if(j&&(y(!1),E([]),L.forEach(t=>e.sendImage(t))),a.trim()){if(!e.isLoggedIn){g("Hey there, you need to be signed in to send messages to Khoj AI"),x(!0);return}e.sendMessage(a.trim()),l("")}}function D(a){var r,l;if(!e.isLoggedIn){g("Please login to chat with your files"),x(!0);return}let n=["jpg","jpeg","png","webp"],o=[];for(let e=0;e<a.length;e++){let t=a[e],r=t.name.split(".").pop();n.includes(r||"")&&o.push(i().sanitize(URL.createObjectURL(t)))}if(o.length>0){y(!0),E(e=>[...e,...o]),null==t||null===(l=t.current)||void 0===l||l.focus();return}(0,ey.ko)(a,d,p,m,e.setUploadedFiles,e.conversationId),null==t||null===(r=t.current)||void 0===r||r.focus()}async function S(){try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:"audio/webm"}),a=[];t.ondataavailable=async e=>{a.push(e.data);let t=new Blob(a,{type:"audio/webm"}),r=new FormData;r.append("file",t);try{let e=await fetch("/api/transcribe",{method:"POST",body:r});if(!e.ok)throw Error("Network response was not ok");let t=await e.json();l(t.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},t.start(1500),t.onstop=async()=>{let e=new Blob(a,{type:"audio/webm"}),r=new FormData;r.append("file",e);try{let e=await fetch("/api/transcribe",{method:"POST",body:r});if(!e.ok)throw Error("Network response was not ok");let a=await e.json();t.stream.getTracks().forEach(e=>e.stop()),V(null),l(a.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},V(t)}catch(e){console.error("Error getting microphone",e)}}return(0,o.useEffect)(()=>{if(h||C(0),h){let e=setInterval(()=>{C(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[h]),(0,o.useEffect)(()=>{async function e(){w.length>0&&A(await Promise.all(w.map(async e=>{let t=await fetch(e),a=await t.blob();return new Promise(e=>{let t=new FileReader;t.onload=()=>e(t.result),t.readAsDataURL(a)})}))),p(!1)}p(!0),e()},[w]),(0,o.useEffect)(()=>{!O&&M&&M.stop(),O&&!M&&S()},[O,M]),(0,o.useEffect)(()=>{(null==t?void 0:t.current)&&(t.current.style.height="auto",t.current.style.height=Math.max(t.current.scrollHeight-24,64)+"px")},[a]),(0,r.jsxs)(r.Fragment,{children:[b&&f&&(0,r.jsx)(ev.Z,{onOpenChange:x,loginRedirectMessage:f}),h&&(0,r.jsx)(em.aR,{open:h,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Uploading data. Please wait."})}),(0,r.jsx)(em.yT,{children:(0,r.jsx)(ep.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:N})}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>p(!1),children:"Dismiss"})]})}),c&&(0,r.jsx)(em.aR,{open:null!==c,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Data Upload Warning"})}),(0,r.jsx)(em.yT,{children:c}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>d(null),children:"Close"})]})}),u&&(0,r.jsx)(em.aR,{open:null!==u,children:(0,r.jsxs)(em._T,{children:[(0,r.jsxs)(em.fY,{children:[(0,r.jsx)(em.f$,{children:"Oh no!"}),(0,r.jsx)(em.yT,{children:"Something went wrong while uploading your data"})]}),(0,r.jsx)(em.yT,{children:u}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>m(null),children:"Close"})]})}),a.startsWith("/")&&1===a.split(" ").length&&(0,r.jsx)("div",{className:"flex justify-center text-center",children:(0,r.jsxs)(ef.J2,{open:a.startsWith("/"),children:[(0,r.jsx)(eg.xo,{className:"flex justify-center text-center"}),(0,r.jsx)(ef.yk,{onOpenAutoFocus:e=>e.preventDefault(),className:"".concat(e.isMobileWidth?"w-[100vw]":"w-full"," rounded-md"),children:(0,r.jsxs)(eu.mY,{className:"max-w-full",children:[(0,r.jsx)(eu.sZ,{placeholder:"Type a command or search...",value:a,className:"hidden"}),(0,r.jsxs)(eu.e8,{children:[(0,r.jsx)(eu.rb,{children:"No matching commands."}),(0,r.jsx)(eu.fu,{heading:"Agent Tools",children:e.chatOptionsData&&Object.entries(e.chatOptionsData).map(e=>{let[t,a]=e;return(0,r.jsx)(eu.di,{className:"text-md",onSelect:()=>{l("/".concat(t," "))},children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,r.jsxs)("div",{className:"font-bold flex items-center",children:[(0,eE.vH)(t,"h-4 w-4 mr-2"),"/",t]}),(0,r.jsx)("div",{children:a})]})},t)})}),(0,r.jsx)(eu.zz,{})]})]})})]})}),(0,r.jsxs)("div",{className:"".concat(n().actualInputArea," justify-between dark:bg-neutral-700 relative ").concat(H&&"animate-pulse"),onDragOver:function(e){e.preventDefault(),k(!0)},onDragLeave:function(e){e.preventDefault(),k(!1)},onDrop:function(e){e.preventDefault(),k(!1),e.dataTransfer.files&&D(e.dataTransfer.files)},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:s,onChange:function(e){e.target.files&&D(e.target.files)},style:{display:"none"}}),(0,r.jsx)("div",{className:"flex items-end pb-4",children:(0,r.jsx)(eh.z,{variant:"ghost",className:"!bg-none p-0 m-2 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500",disabled:e.sendDisabled,onClick:function(){s.current&&s.current.click()},children:(0,r.jsx)(v,{className:"w-8 h-8"})})}),(0,r.jsxs)("div",{className:"flex-grow flex flex-col w-full gap-1.5 relative pb-2",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:j&&w.map((e,t)=>(0,r.jsxs)("div",{className:"relative flex-shrink-0 pb-3 pt-2 group",children:[(0,r.jsx)("img",{src:e,alt:"img-".concat(t),className:"w-auto h-16 object-cover rounded-xl"}),(0,r.jsx)(eh.z,{variant:"ghost",size:"icon",className:"absolute -top-0 -right-2 h-5 w-5 rounded-full bg-neutral-200 dark:bg-neutral-600 hover:bg-neutral-300 dark:hover:bg-neutral-500 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{E(e=>e.filter((e,a)=>a!==t)),A(e=>e.filter((e,a)=>a!==t)),1===w.length&&y(!1)},children:(0,r.jsx)(F,{className:"h-3 w-3"})})]},t))}),(0,r.jsx)(eb.g,{ref:t,className:"border-none w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700 ".concat(e.isMobileWidth?"text-md":"text-lg"),placeholder:"Type / to see a list of commands",id:"message",autoFocus:!0,value:a,onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||e.isMobileWidth||(y(!1),E([]),t.preventDefault(),P())},onChange:e=>l(e.target.value),disabled:e.sendDisabled||O})]}),(0,r.jsxs)("div",{className:"flex items-end pb-4",children:[O?(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!O&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{Z(!O)},disabled:e.sendDisabled,children:(0,r.jsx)(_,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to stop recording and transcribe your voice."})]})}):M?(0,r.jsx)(ew.l,{}):(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!a||O||"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{l("Listening..."),Z(!O)},disabled:e.sendDisabled,children:(0,r.jsx)(Q,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to transcribe your message with voice."})]})}),(0,r.jsx)(eh.z,{className:"".concat((!a||O)&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:P,disabled:e.sendDisabled,children:(0,r.jsx)(ed,{className:"w-6 h-6",weight:"bold"})})]})]})]})});eL.displayName="ChatInputArea"},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var r=a(57437),l=a(6780),n=a(87138);function o(e){return(0,r.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,r.jsxs)(l._T,{children:[(0,r.jsx)(l.fY,{children:(0,r.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,r.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,r.jsx)(n.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,r.jsxs)(l.xo,{children:[(0,r.jsx)(l.le,{children:"Dismiss"}),(0,r.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,r.jsxs)(n.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,a){"use strict";a.d(t,{E:function(){return s}});var r=a(57437),l=a(2265),n=a(52431),o=a(37440);let s=l.forwardRef((e,t)=>{let{className:a,value:l,indicatorColor:s,...i}=e;return(0,r.jsx)(n.fC,{ref:t,className:(0,o.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...i,children:(0,r.jsx)(n.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(s),style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});s.displayName=n.fC.displayName},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var r=a(57437),l=a(2265),n=a(37440);let o=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,r.jsx)("textarea",{className:(0,n.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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});o.displayName="Textarea"},19666:function(e,t,a){"use strict";a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return s},u:function(){return i}});var r=a(57437),l=a(2265),n=a(27071),o=a(37440);let s=n.zt,i=n.fC,c=n.xz,d=l.forwardRef((e,t)=>{let{className:a,sideOffset:l=4,...s}=e;return(0,r.jsx)(n.VY,{ref:t,sideOffset:l,className:(0,o.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s})});d.displayName=n.VY.displayName},37649:function(e){e.exports={actualInputArea:"chatInputArea_actualInputArea__Ha6cN"}}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9479],{59479:function(e,t,a){"use strict";a.d(t,{a:function(){return eL}});var r=a(57437),n=a(37649),l=a.n(n),o=a(2265),s=a(11838),i=a.n(s);a(7395);var c=a(52195);let d=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var u=Object.defineProperty,m=Object.defineProperties,h=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,b=(e,t,a)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,x=(e,t)=>{for(var a in t||(t={}))f.call(t,a)&&b(e,a,t[a]);if(p)for(var a of p(t))g.call(t,a)&&b(e,a,t[a]);return e},j=(e,t)=>m(e,h(t));let v=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,j(x({ref:t},e),{weights:d})));v.displayName="Paperclip";let y=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var w=Object.defineProperty,E=Object.defineProperties,L=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,M=(e,t,a)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,V=(e,t)=>{for(var a in t||(t={}))O.call(t,a)&&M(e,a,t[a]);if(A)for(var a of A(t))Z.call(t,a)&&M(e,a,t[a]);return e},N=(e,t)=>E(e,L(t));let F=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,N(V({ref:t},e),{weights:y})));F.displayName="X";let C=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z"}))]]);var H=Object.defineProperty,k=Object.defineProperties,P=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,I=(e,t,a)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,T=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&I(e,a,t[a]);if(D)for(var a of D(t))R.call(t,a)&&I(e,a,t[a]);return e},z=(e,t)=>k(e,P(t));let _=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,z(T({ref:t},e),{weights:C})));_.displayName="Stop";let U=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]);var Y=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,X=(e,t,a)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,q=(e,t)=>{for(var a in t||(t={}))K.call(t,a)&&X(e,a,t[a]);if(J)for(var a of J(t))B.call(t,a)&&X(e,a,t[a]);return e},G=(e,t)=>W(e,$(t));let Q=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,G(q({ref:t},e),{weights:U})));Q.displayName="Microphone";let ee=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var et=Object.defineProperty,ea=Object.defineProperties,er=Object.getOwnPropertyDescriptors,en=Object.getOwnPropertySymbols,el=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,es=(e,t,a)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ei=(e,t)=>{for(var a in t||(t={}))el.call(t,a)&&es(e,a,t[a]);if(en)for(var a of en(t))eo.call(t,a)&&es(e,a,t[a]);return e},ec=(e,t)=>ea(e,er(t));let ed=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,ec(ei({ref:t},e),{weights:ee})));ed.displayName="ArrowUp";var eu=a(42491),em=a(6780),eh=a(50495),ep=a(70571),ef=a(19573),eg=a(61485),eb=a(93146),ex=a(19666),ej=a(58575),ev=a(66820),ey=a(9557),ew=a(58485),eE=a(89417);let eL=(0,o.forwardRef)((e,t)=>{let[a,n]=(0,o.useState)(""),s=(0,o.useRef)(null),[c,d]=(0,o.useState)(null),[u,m]=(0,o.useState)(null),[h,p]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[b,x]=(0,o.useState)(!1),[j,y]=(0,o.useState)(!1),[w,E]=(0,o.useState)([]),[L,A]=(0,o.useState)([]),[O,Z]=(0,o.useState)(!1),[M,V]=(0,o.useState)(null),[N,C]=(0,o.useState)(0),[H,k]=(0,o.useState)(!1);function P(){if(j&&(y(!1),E([]),L.forEach(t=>e.sendImage(t))),a.trim()){if(!e.isLoggedIn){g("Hey there, you need to be signed in to send messages to Khoj AI"),x(!0);return}e.sendMessage(a.trim()),n("")}}function D(a){var r,n;if(!e.isLoggedIn){g("Please login to chat with your files"),x(!0);return}let l=["jpg","jpeg","png","webp"],o=[];for(let e=0;e<a.length;e++){let t=a[e],r=t.name.split(".").pop();l.includes(r||"")&&o.push(i().sanitize(URL.createObjectURL(t)))}if(o.length>0){y(!0),E(e=>[...e,...o]),null==t||null===(n=t.current)||void 0===n||n.focus();return}(0,ey.ko)(a,d,p,m,e.setUploadedFiles,e.conversationId),null==t||null===(r=t.current)||void 0===r||r.focus()}async function S(){try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:"audio/webm"}),a=[];t.ondataavailable=async e=>{a.push(e.data);let t=new Blob(a,{type:"audio/webm"}),r=new FormData;r.append("file",t);try{let e=await fetch("/api/transcribe",{method:"POST",body:r});if(!e.ok)throw Error("Network response was not ok");let t=await e.json();n(t.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},t.start(1500),t.onstop=async()=>{let e=new Blob(a,{type:"audio/webm"}),r=new FormData;r.append("file",e);try{let e=await fetch("/api/transcribe",{method:"POST",body:r});if(!e.ok)throw Error("Network response was not ok");let a=await e.json();t.stream.getTracks().forEach(e=>e.stop()),V(null),n(a.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},V(t)}catch(e){console.error("Error getting microphone",e)}}return(0,o.useEffect)(()=>{if(h||C(0),h){let e=setInterval(()=>{C(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[h]),(0,o.useEffect)(()=>{async function e(){w.length>0&&A(await Promise.all(w.map(async e=>{let t=await fetch(e),a=await t.blob();return new Promise(e=>{let t=new FileReader;t.onload=()=>e(t.result),t.readAsDataURL(a)})}))),p(!1)}p(!0),e()},[w]),(0,o.useEffect)(()=>{!O&&M&&M.stop(),O&&!M&&S()},[O,M]),(0,o.useEffect)(()=>{(null==t?void 0:t.current)&&(t.current.style.height="auto",t.current.style.height=Math.max(t.current.scrollHeight-24,64)+"px")},[a]),(0,r.jsxs)(r.Fragment,{children:[b&&f&&(0,r.jsx)(ev.Z,{onOpenChange:x,loginRedirectMessage:f}),h&&(0,r.jsx)(em.aR,{open:h,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Uploading data. Please wait."})}),(0,r.jsx)(em.yT,{children:(0,r.jsx)(ep.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:N})}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>p(!1),children:"Dismiss"})]})}),c&&(0,r.jsx)(em.aR,{open:null!==c,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Data Upload Warning"})}),(0,r.jsx)(em.yT,{children:c}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>d(null),children:"Close"})]})}),u&&(0,r.jsx)(em.aR,{open:null!==u,children:(0,r.jsxs)(em._T,{children:[(0,r.jsxs)(em.fY,{children:[(0,r.jsx)(em.f$,{children:"Oh no!"}),(0,r.jsx)(em.yT,{children:"Something went wrong while uploading your data"})]}),(0,r.jsx)(em.yT,{children:u}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>m(null),children:"Close"})]})}),a.startsWith("/")&&1===a.split(" ").length&&(0,r.jsx)("div",{className:"flex justify-center text-center",children:(0,r.jsxs)(ef.J2,{open:a.startsWith("/"),children:[(0,r.jsx)(eg.xo,{className:"flex justify-center text-center"}),(0,r.jsx)(ef.yk,{onOpenAutoFocus:e=>e.preventDefault(),className:"".concat(e.isMobileWidth?"w-[100vw]":"w-full"," rounded-md"),side:"top",align:"center",sideOffset:e.conversationId?0:80,alignOffset:0,children:(0,r.jsxs)(eu.mY,{className:"max-w-full",children:[(0,r.jsx)(eu.sZ,{placeholder:"Type a command or search...",value:a,className:"hidden"}),(0,r.jsxs)(eu.e8,{children:[(0,r.jsx)(eu.rb,{children:"No matching commands."}),(0,r.jsx)(eu.fu,{heading:"Agent Tools",children:e.chatOptionsData&&Object.entries(e.chatOptionsData).map(e=>{let[t,a]=e;return(0,r.jsx)(eu.di,{className:"text-md",onSelect:()=>{n("/".concat(t," "))},children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,r.jsxs)("div",{className:"font-bold flex items-center",children:[(0,eE.vH)(t,"h-4 w-4 mr-2"),"/",t]}),(0,r.jsx)("div",{children:a})]})},t)})}),(0,r.jsx)(eu.zz,{})]})]})})]})}),(0,r.jsxs)("div",{className:"".concat(l().actualInputArea," justify-between dark:bg-neutral-700 relative ").concat(H&&"animate-pulse"),onDragOver:function(e){e.preventDefault(),k(!0)},onDragLeave:function(e){e.preventDefault(),k(!1)},onDrop:function(e){e.preventDefault(),k(!1),e.dataTransfer.files&&D(e.dataTransfer.files)},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:s,onChange:function(e){e.target.files&&D(e.target.files)},style:{display:"none"}}),(0,r.jsx)("div",{className:"flex items-end pb-4",children:(0,r.jsx)(eh.z,{variant:"ghost",className:"!bg-none p-0 m-2 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500",disabled:e.sendDisabled,onClick:function(){s.current&&s.current.click()},children:(0,r.jsx)(v,{className:"w-8 h-8"})})}),(0,r.jsxs)("div",{className:"flex-grow flex flex-col w-full gap-1.5 relative pb-2",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:j&&w.map((e,t)=>(0,r.jsxs)("div",{className:"relative flex-shrink-0 pb-3 pt-2 group",children:[(0,r.jsx)("img",{src:e,alt:"img-".concat(t),className:"w-auto h-16 object-cover rounded-xl"}),(0,r.jsx)(eh.z,{variant:"ghost",size:"icon",className:"absolute -top-0 -right-2 h-5 w-5 rounded-full bg-neutral-200 dark:bg-neutral-600 hover:bg-neutral-300 dark:hover:bg-neutral-500 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{E(e=>e.filter((e,a)=>a!==t)),A(e=>e.filter((e,a)=>a!==t)),1===w.length&&y(!1)},children:(0,r.jsx)(F,{className:"h-3 w-3"})})]},t))}),(0,r.jsx)(eb.g,{ref:t,className:"border-none w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700 ".concat(e.isMobileWidth?"text-md":"text-lg"),placeholder:"Type / to see a list of commands",id:"message",autoFocus:!0,value:a,onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||e.isMobileWidth||(y(!1),E([]),t.preventDefault(),P())},onChange:e=>n(e.target.value),disabled:e.sendDisabled||O})]}),(0,r.jsxs)("div",{className:"flex items-end pb-4",children:[O?(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!O&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{Z(!O)},disabled:e.sendDisabled,children:(0,r.jsx)(_,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to stop recording and transcribe your voice."})]})}):M?(0,r.jsx)(ew.l,{}):(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!a||O||"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{n("Listening..."),Z(!O)},disabled:e.sendDisabled,children:(0,r.jsx)(Q,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to transcribe your message with voice."})]})}),(0,r.jsx)(eh.z,{className:"".concat((!a||O)&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:P,disabled:e.sendDisabled,children:(0,r.jsx)(ed,{className:"w-6 h-6",weight:"bold"})})]})]})]})});eL.displayName="ChatInputArea"},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var r=a(57437),n=a(6780),l=a(87138);function o(e){return(0,r.jsx)(n.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,r.jsxs)(n._T,{children:[(0,r.jsx)(n.fY,{children:(0,r.jsx)(n.f$,{children:"Sign in to Khoj to continue"})}),(0,r.jsxs)(n.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,r.jsx)(l.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,r.jsxs)(n.xo,{children:[(0,r.jsx)(n.le,{children:"Dismiss"}),(0,r.jsx)(n.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,r.jsxs)(l.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,a){"use strict";a.d(t,{E:function(){return s}});var r=a(57437),n=a(2265),l=a(52431),o=a(37440);let s=n.forwardRef((e,t)=>{let{className:a,value:n,indicatorColor:s,...i}=e;return(0,r.jsx)(l.fC,{ref:t,className:(0,o.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...i,children:(0,r.jsx)(l.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(s),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});s.displayName=l.fC.displayName},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var r=a(57437),n=a(2265),l=a(37440);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("textarea",{className:(0,l.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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...n})});o.displayName="Textarea"},19666:function(e,t,a){"use strict";a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return s},u:function(){return i}});var r=a(57437),n=a(2265),l=a(27071),o=a(37440);let s=l.zt,i=l.fC,c=l.xz,d=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...s}=e;return(0,r.jsx)(l.VY,{ref:t,sideOffset:n,className:(0,o.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s})});d.displayName=l.VY.displayName},37649:function(e){e.exports={actualInputArea:"chatInputArea_actualInputArea__Ha6cN"}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,t,a){Promise.resolve().then(a.bind(a,89915))},89915:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return _}});var n=a(57437),l=a(15283),o=a.n(l),r=a(29039),i=a(2265),s=a(79306),c=a(35418),d=a(64945),u=a(90837),p=a(66820),h=a(58485),m=a(48861),f=a(47412),g=a(69591),v=a(81970),x=a(39343),b=a(31014);let A=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),j=e=>fetch(e).then(e=>e.json());function y(e){let[t,a]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),[r,s]=(0,i.useState)(!0),d=(0,x.cI)({resolver:(0,b.F)(v.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)(()=>{d.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,n.jsxs)(u.Vq,{open:t,onOpenChange:a,children:[(0,n.jsx)(u.hg,{children:(0,n.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,n.jsx)(c.v,{}),"Create Agent"]})}),(0,n.jsxs)(u.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,n.jsx)(u.fK,{children:"Create Agent"}),!e.userProfile&&r&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:s}),(0,n.jsx)(v.ks,{form:d,onSubmit:t=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>{200===t.status?(d.reset(),a(!1),o(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),e.error&&o(e.error)})}).catch(e=>{console.error("Error:",e),o(e)})},create:!0,errors:l,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function _(){let{data:e,error:t,mutate:a}=(0,r.ZP)("agents",A,{revalidateOnFocus:!1}),l=(0,s.GW)(),{userConfig:c}=(0,s.h2)(!0),[u,x]=(0,i.useState)(!1),b=(0,g.IC)(),[_,O]=(0,i.useState)([]),[Z,w]=(0,i.useState)([]),[M,E]=(0,i.useState)(null),{data:V,error:N}=(0,r.ZP)(c?"/api/content/computer":null,j),{data:L,error:C}=(0,r.ZP)("/api/agents/options",j),[P,S]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{P&&(a(),S(!1))},[P]),(0,i.useEffect)(()=>{if(e){O(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));w(t);{let a=new URLSearchParams(window.location.search).get("agent");if(a){E(a);let n=e.find(e=>e.slug===a);n||(n=t.find(e=>e.slug===a)),n||fetch("/api/agents/".concat(a)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&w(t=>[...t,e])})}}}},[e,l]),t)return(0,n.jsxs)("main",{className:o().main,children:[(0,n.jsx)("div",{className:"".concat(o().titleBar," text-5xl"),children:"Agents"}),(0,n.jsx)("div",{className:o().agentList,children:"Error loading agents"})]});if(!e)return(0,n.jsx)("main",{className:o().main,children:(0,n.jsxs)("div",{className:o().agentList,children:[(0,n.jsx)(h.l,{})," booting up your agents"]})});let F=(null==c?void 0:c.chat_model_options)||[],T=(null==c?void 0:c.selected_chat_model_config)||0,R=(0,s.T8)(c),H=F.find(e=>e.id===T);return(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(o().sidePanel," top-0"),children:(0,n.jsx)(m.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:b})}),(0,n.jsxs)("div",{className:"".concat(o().pageLayout," w-full"),children:[(0,n.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,n.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,n.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,n.jsx)(y,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:b,filesOptions:V||[],modelOptions:(null==c?void 0:c.chat_model_options)||[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}})})]}),u&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:x}),(0,n.jsx)(f.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(f.X,{children:[(0,n.jsx)(d.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,n.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,n.jsx)("div",{className:"pt-6 md:pt-8",children:(0,n.jsx)("div",{className:"".concat(o().agentList),children:_.map(e=>(0,n.jsx)(v.EY,{data:e,userProfile:l,isMobileWidth:b,filesOptions:null!=V?V:[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,modelOptions:(null==c?void 0:c.chat_model_options)||[],editCard:!0,agentSlug:M||"",inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}},e.slug))})}),(0,n.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,n.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,n.jsx)("div",{className:"".concat(o().agentList),children:Z.map(e=>(0,n.jsx)(v.EY,{data:e,userProfile:l,isMobileWidth:b,editCard:!1,filesOptions:null!=V?V:[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,modelOptions:(null==c?void 0:c.chat_model_options)||[],agentSlug:M||"",inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}},e.slug))})]})]})]})})}},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var n=a(57437),l=a(6780),o=a(87138);function r(e){return(0,n.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,n.jsxs)(l._T,{children:[(0,n.jsx)(l.fY,{children:(0,n.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,n.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,n.jsx)(o.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,n.jsxs)(l.xo,{children:[(0,n.jsx)(l.le,{children:"Dismiss"}),(0,n.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,n.jsxs)(o.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,a){"use strict";a.d(t,{E:function(){return i}});var n=a(57437),l=a(2265),o=a(52431),r=a(37440);let i=l.forwardRef((e,t)=>{let{className:a,value:l,indicatorColor:i,...s}=e;return(0,n.jsx)(o.fC,{ref:t,className:(0,r.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...s,children:(0,n.jsx)(o.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});i.displayName=o.fC.displayName},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return r}});var n=a(57437),l=a(2265),o=a(37440);let r=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,n.jsx)("textarea",{className:(0,o.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});r.displayName="Textarea"},19666:function(e,t,a){"use strict";a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return i},u:function(){return s}});var n=a(57437),l=a(2265),o=a(27071),r=a(37440);let i=o.zt,s=o.fC,c=o.xz,d=l.forwardRef((e,t)=>{let{className:a,sideOffset:l=4,...i}=e;return(0,n.jsx)(o.VY,{ref:t,sideOffset:l,className:(0,r.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});d.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"}},31784:function(e,t,a){"use strict";a.d(t,{a:function(){return f}});var n=a(2265),l=a(52195);let o=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M252,124a60.14,60.14,0,0,0-32-53.08,52,52,0,0,0-92-32.11A52,52,0,0,0,36,70.92a60,60,0,0,0,0,106.14,52,52,0,0,0,92,32.13,52,52,0,0,0,92-32.13A60.05,60.05,0,0,0,252,124ZM88,204a28,28,0,0,1-26.85-20.07c1,0,1.89.07,2.85.07h8a12,12,0,0,0,0-24H64A36,36,0,0,1,52,90.05a12,12,0,0,0,8-11.32V72a28,28,0,0,1,56,0v60.18a51.61,51.61,0,0,0-7.2-3.85,12,12,0,1,0-9.6,22A28,28,0,0,1,88,204Zm104-44h-8a12,12,0,0,0,0,24h8c1,0,1.9,0,2.85-.07a28,28,0,1,1-38-33.61,12,12,0,1,0-9.6-22,51.61,51.61,0,0,0-7.2,3.85V72a28,28,0,0,1,56,0v6.73a12,12,0,0,0,8,11.32,36,36,0,0,1-12,70Zm16-44a12,12,0,0,1-12,12,40,40,0,0,1-40-40V84a12,12,0,0,1,24,0v4a16,16,0,0,0,16,16A12,12,0,0,1,208,116ZM100,88a40,40,0,0,1-40,40,12,12,0,0,1,0-24A16,16,0,0,0,76,88V84a12,12,0,0,1,24,0Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240,124a48,48,0,0,1-32,45.27h0V176a40,40,0,0,1-80,0,40,40,0,0,1-80,0v-6.73h0a48,48,0,0,1,0-90.54V72a40,40,0,0,1,80,0,40,40,0,0,1,80,0v6.73A48,48,0,0,1,240,124Z",opacity:"0.2"}),n.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M212,76V72a44,44,0,0,0-74.86-31.31,3.93,3.93,0,0,0-1.14,2.8v88.72a4,4,0,0,0,6.2,3.33A47.67,47.67,0,0,1,167.68,128a8.18,8.18,0,0,1,8.31,7.58,8,8,0,0,1-8,8.42,32,32,0,0,0-32,32v33.88a4,4,0,0,0,1.49,3.12,47.92,47.92,0,0,0,74.21-17.16,4,4,0,0,0-4.49-5.56A68.06,68.06,0,0,1,192,192h-7.73a8.18,8.18,0,0,1-8.25-7.47,8,8,0,0,1,8-8.53h8a51.6,51.6,0,0,0,24-5.88v0A52,52,0,0,0,212,76Zm-12,36h-4a36,36,0,0,1-36-36V72a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4a8,8,0,0,1,0,16ZM88,28A44.05,44.05,0,0,0,44,72v4a52,52,0,0,0-4,94.12h0A51.6,51.6,0,0,0,64,176h7.73A8.18,8.18,0,0,1,80,183.47,8,8,0,0,1,72,192H64a67.48,67.48,0,0,1-15.21-1.73,4,4,0,0,0-4.5,5.55A47.93,47.93,0,0,0,118.51,213a4,4,0,0,0,1.49-3.12V176a32,32,0,0,0-32-32,8,8,0,0,1-8-8.42A8.18,8.18,0,0,1,88.32,128a47.67,47.67,0,0,1,25.48,7.54,4,4,0,0,0,6.2-3.33V43.49a4,4,0,0,0-1.14-2.81A43.85,43.85,0,0,0,88,28Zm8,48a36,36,0,0,1-36,36H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,76V72a8,8,0,0,1,16,0Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M246,124a54.13,54.13,0,0,0-32-49.33V72a46,46,0,0,0-86-22.67A46,46,0,0,0,42,72v2.67a54,54,0,0,0,0,98.63V176a46,46,0,0,0,86,22.67A46,46,0,0,0,214,176v-2.7A54.07,54.07,0,0,0,246,124ZM88,210a34,34,0,0,1-34-32.94A53.67,53.67,0,0,0,64,178h8a6,6,0,0,0,0-12H64A42,42,0,0,1,50,84.39a6,6,0,0,0,4-5.66V72a34,34,0,0,1,68,0v73.05A45.89,45.89,0,0,0,88,130a6,6,0,0,0,0,12,34,34,0,0,1,0,68Zm104-44h-8a6,6,0,0,0,0,12h8a53.67,53.67,0,0,0,10-.94A34,34,0,1,1,168,142a6,6,0,0,0,0-12,45.89,45.89,0,0,0-34,15.05V72a34,34,0,0,1,68,0v6.73a6,6,0,0,0,4,5.66A42,42,0,0,1,192,166Zm14-54a6,6,0,0,1-6,6h-4a34,34,0,0,1-34-34V80a6,6,0,0,1,12,0v4a22,22,0,0,0,22,22h4A6,6,0,0,1,206,112ZM60,118H56a6,6,0,0,1,0-12h4A22,22,0,0,0,82,84V80a6,6,0,0,1,12,0v4A34,34,0,0,1,60,118Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M244,124a52.1,52.1,0,0,0-32-48V72a44,44,0,0,0-84-18.3A44,44,0,0,0,44,72v4a52,52,0,0,0,0,96v4a44,44,0,0,0,84,18.3A44,44,0,0,0,212,176v-4A52.07,52.07,0,0,0,244,124ZM88,212a36,36,0,0,1-36-36v-1.41A52.13,52.13,0,0,0,64,176h8a4,4,0,0,0,0-8H64A44,44,0,0,1,49.33,82.5,4,4,0,0,0,52,78.73V72a36,36,0,0,1,72,0v78.75A44,44,0,0,0,88,132a4,4,0,0,0,0,8,36,36,0,0,1,0,72Zm104-44h-8a4,4,0,0,0,0,8h8a52.13,52.13,0,0,0,12-1.41V176a36,36,0,1,1-36-36,4,4,0,0,0,0-8,44,44,0,0,0-36,18.75V72a36,36,0,0,1,72,0v6.73a4,4,0,0,0,2.67,3.77A44,44,0,0,1,192,168Zm12-56a4,4,0,0,1-4,4h-4a32,32,0,0,1-32-32V80a4,4,0,0,1,8,0v4a24,24,0,0,0,24,24h4A4,4,0,0,1,204,112ZM92,84a32,32,0,0,1-32,32H56a4,4,0,0,1,0-8h4A24,24,0,0,0,84,84V80a4,4,0,0,1,8,0Z"}))]]);var r=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))d.call(t,a)&&p(e,a,t[a]);if(c)for(var a of c(t))u.call(t,a)&&p(e,a,t[a]);return e},m=(e,t)=>i(e,s(t));let f=(0,n.forwardRef)((e,t)=>n.createElement(l.Z,m(h({ref:t},e),{weights:o})));f.displayName="Brain"},64945:function(e,t,a){"use strict";a.d(t,{B:function(){return f}});var n=a(2265),l=a(52195);let o=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]);var r=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))d.call(t,a)&&p(e,a,t[a]);if(c)for(var a of c(t))u.call(t,a)&&p(e,a,t[a]);return e},m=(e,t)=>i(e,s(t));let f=(0,n.forwardRef)((e,t)=>n.createElement(l.Z,m(h({ref:t},e),{weights:o})));f.displayName="Lightning"}},function(e){e.O(0,[9460,9448,9001,3062,8840,3110,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,a){Promise.resolve().then(a.bind(a,89915))},89915:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return _}});var n=a(57437),l=a(15283),o=a.n(l),r=a(29039),i=a(2265),s=a(79306),c=a(35418),d=a(64945),u=a(90837),p=a(66820),h=a(58485),m=a(48861),f=a(47412),g=a(69591),v=a(81970),x=a(39343),b=a(31014);let A=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),j=e=>fetch(e).then(e=>e.json());function y(e){let[t,a]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),[r,s]=(0,i.useState)(!0),d=(0,x.cI)({resolver:(0,b.F)(v.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)(()=>{d.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,n.jsxs)(u.Vq,{open:t,onOpenChange:a,children:[(0,n.jsx)(u.hg,{children:(0,n.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,n.jsx)(c.v,{}),"Create Agent"]})}),(0,n.jsxs)(u.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,n.jsx)(u.fK,{children:"Create Agent"}),!e.userProfile&&r&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:s}),(0,n.jsx)(v.ks,{form:d,onSubmit:t=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>{200===t.status?(d.reset(),a(!1),o(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),e.error&&o(e.error)})}).catch(e=>{console.error("Error:",e),o(e)})},create:!0,errors:l,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function _(){let{data:e,error:t,mutate:a}=(0,r.ZP)("agents",A,{revalidateOnFocus:!1}),l=(0,s.GW)(),{userConfig:c}=(0,s.h2)(!0),[u,x]=(0,i.useState)(!1),b=(0,g.IC)(),[_,O]=(0,i.useState)([]),[Z,w]=(0,i.useState)([]),[M,E]=(0,i.useState)(null),{data:V,error:N}=(0,r.ZP)(c?"/api/content/computer":null,j),{data:L,error:C}=(0,r.ZP)("/api/agents/options",j),[P,S]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{P&&(a(),S(!1))},[P]),(0,i.useEffect)(()=>{if(e){O(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));w(t);{let a=new URLSearchParams(window.location.search).get("agent");if(a){E(a);let n=e.find(e=>e.slug===a);n||(n=t.find(e=>e.slug===a)),n||fetch("/api/agents/".concat(a)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&w(t=>[...t,e])})}}}},[e,l]),t)return(0,n.jsxs)("main",{className:o().main,children:[(0,n.jsx)("div",{className:"".concat(o().titleBar," text-5xl"),children:"Agents"}),(0,n.jsx)("div",{className:o().agentList,children:"Error loading agents"})]});if(!e)return(0,n.jsx)("main",{className:o().main,children:(0,n.jsxs)("div",{className:o().agentList,children:[(0,n.jsx)(h.l,{})," booting up your agents"]})});let F=(null==c?void 0:c.chat_model_options)||[],T=(null==c?void 0:c.selected_chat_model_config)||0,R=(0,s.T8)(c),H=F.find(e=>e.id===T);return(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(o().sidePanel," top-0"),children:(0,n.jsx)(m.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:b})}),(0,n.jsxs)("div",{className:"".concat(o().pageLayout," w-full"),children:[(0,n.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,n.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,n.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,n.jsx)(y,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:b,filesOptions:V||[],modelOptions:(null==c?void 0:c.chat_model_options)||[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}})})]}),u&&(0,n.jsx)(p.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:x}),(0,n.jsx)(f.bZ,{className:"bg-secondary border-none my-4",children:(0,n.jsxs)(f.X,{children:[(0,n.jsx)(d.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,n.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,n.jsx)("div",{className:"pt-6 md:pt-8",children:(0,n.jsx)("div",{className:"".concat(o().agentList),children:_.map(e=>(0,n.jsx)(v.EY,{data:e,userProfile:l,isMobileWidth:b,filesOptions:null!=V?V:[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,modelOptions:(null==c?void 0:c.chat_model_options)||[],editCard:!0,agentSlug:M||"",inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}},e.slug))})}),(0,n.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,n.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,n.jsx)("div",{className:"".concat(o().agentList),children:Z.map(e=>(0,n.jsx)(v.EY,{data:e,userProfile:l,isMobileWidth:b,editCard:!1,filesOptions:null!=V?V:[],selectedChatModelOption:(null==H?void 0:H.name)||"",isSubscribed:R,setAgentChangeTriggered:S,modelOptions:(null==c?void 0:c.chat_model_options)||[],agentSlug:M||"",inputToolOptions:(null==L?void 0:L.input_tools)||{},outputModeOptions:(null==L?void 0:L.output_modes)||{}},e.slug))})]})]})]})})}},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var n=a(57437),l=a(6780),o=a(87138);function r(e){return(0,n.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,n.jsxs)(l._T,{children:[(0,n.jsx)(l.fY,{children:(0,n.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,n.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,n.jsx)(o.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,n.jsxs)(l.xo,{children:[(0,n.jsx)(l.le,{children:"Dismiss"}),(0,n.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,n.jsxs)(o.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,a){"use strict";a.d(t,{E:function(){return i}});var n=a(57437),l=a(2265),o=a(52431),r=a(37440);let i=l.forwardRef((e,t)=>{let{className:a,value:l,indicatorColor:i,...s}=e;return(0,n.jsx)(o.fC,{ref:t,className:(0,r.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...s,children:(0,n.jsx)(o.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});i.displayName=o.fC.displayName},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return r}});var n=a(57437),l=a(2265),o=a(37440);let r=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,n.jsx)("textarea",{className:(0,o.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});r.displayName="Textarea"},19666:function(e,t,a){"use strict";a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return i},u:function(){return s}});var n=a(57437),l=a(2265),o=a(27071),r=a(37440);let i=o.zt,s=o.fC,c=o.xz,d=l.forwardRef((e,t)=>{let{className:a,sideOffset:l=4,...i}=e;return(0,n.jsx)(o.VY,{ref:t,sideOffset:l,className:(0,r.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});d.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"}},31784:function(e,t,a){"use strict";a.d(t,{a:function(){return f}});var n=a(2265),l=a(52195);let o=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M252,124a60.14,60.14,0,0,0-32-53.08,52,52,0,0,0-92-32.11A52,52,0,0,0,36,70.92a60,60,0,0,0,0,106.14,52,52,0,0,0,92,32.13,52,52,0,0,0,92-32.13A60.05,60.05,0,0,0,252,124ZM88,204a28,28,0,0,1-26.85-20.07c1,0,1.89.07,2.85.07h8a12,12,0,0,0,0-24H64A36,36,0,0,1,52,90.05a12,12,0,0,0,8-11.32V72a28,28,0,0,1,56,0v60.18a51.61,51.61,0,0,0-7.2-3.85,12,12,0,1,0-9.6,22A28,28,0,0,1,88,204Zm104-44h-8a12,12,0,0,0,0,24h8c1,0,1.9,0,2.85-.07a28,28,0,1,1-38-33.61,12,12,0,1,0-9.6-22,51.61,51.61,0,0,0-7.2,3.85V72a28,28,0,0,1,56,0v6.73a12,12,0,0,0,8,11.32,36,36,0,0,1-12,70Zm16-44a12,12,0,0,1-12,12,40,40,0,0,1-40-40V84a12,12,0,0,1,24,0v4a16,16,0,0,0,16,16A12,12,0,0,1,208,116ZM100,88a40,40,0,0,1-40,40,12,12,0,0,1,0-24A16,16,0,0,0,76,88V84a12,12,0,0,1,24,0Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240,124a48,48,0,0,1-32,45.27h0V176a40,40,0,0,1-80,0,40,40,0,0,1-80,0v-6.73h0a48,48,0,0,1,0-90.54V72a40,40,0,0,1,80,0,40,40,0,0,1,80,0v6.73A48,48,0,0,1,240,124Z",opacity:"0.2"}),n.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M212,76V72a44,44,0,0,0-74.86-31.31,3.93,3.93,0,0,0-1.14,2.8v88.72a4,4,0,0,0,6.2,3.33A47.67,47.67,0,0,1,167.68,128a8.18,8.18,0,0,1,8.31,7.58,8,8,0,0,1-8,8.42,32,32,0,0,0-32,32v33.88a4,4,0,0,0,1.49,3.12,47.92,47.92,0,0,0,74.21-17.16,4,4,0,0,0-4.49-5.56A68.06,68.06,0,0,1,192,192h-7.73a8.18,8.18,0,0,1-8.25-7.47,8,8,0,0,1,8-8.53h8a51.6,51.6,0,0,0,24-5.88v0A52,52,0,0,0,212,76Zm-12,36h-4a36,36,0,0,1-36-36V72a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4a8,8,0,0,1,0,16ZM88,28A44.05,44.05,0,0,0,44,72v4a52,52,0,0,0-4,94.12h0A51.6,51.6,0,0,0,64,176h7.73A8.18,8.18,0,0,1,80,183.47,8,8,0,0,1,72,192H64a67.48,67.48,0,0,1-15.21-1.73,4,4,0,0,0-4.5,5.55A47.93,47.93,0,0,0,118.51,213a4,4,0,0,0,1.49-3.12V176a32,32,0,0,0-32-32,8,8,0,0,1-8-8.42A8.18,8.18,0,0,1,88.32,128a47.67,47.67,0,0,1,25.48,7.54,4,4,0,0,0,6.2-3.33V43.49a4,4,0,0,0-1.14-2.81A43.85,43.85,0,0,0,88,28Zm8,48a36,36,0,0,1-36,36H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,76V72a8,8,0,0,1,16,0Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M246,124a54.13,54.13,0,0,0-32-49.33V72a46,46,0,0,0-86-22.67A46,46,0,0,0,42,72v2.67a54,54,0,0,0,0,98.63V176a46,46,0,0,0,86,22.67A46,46,0,0,0,214,176v-2.7A54.07,54.07,0,0,0,246,124ZM88,210a34,34,0,0,1-34-32.94A53.67,53.67,0,0,0,64,178h8a6,6,0,0,0,0-12H64A42,42,0,0,1,50,84.39a6,6,0,0,0,4-5.66V72a34,34,0,0,1,68,0v73.05A45.89,45.89,0,0,0,88,130a6,6,0,0,0,0,12,34,34,0,0,1,0,68Zm104-44h-8a6,6,0,0,0,0,12h8a53.67,53.67,0,0,0,10-.94A34,34,0,1,1,168,142a6,6,0,0,0,0-12,45.89,45.89,0,0,0-34,15.05V72a34,34,0,0,1,68,0v6.73a6,6,0,0,0,4,5.66A42,42,0,0,1,192,166Zm14-54a6,6,0,0,1-6,6h-4a34,34,0,0,1-34-34V80a6,6,0,0,1,12,0v4a22,22,0,0,0,22,22h4A6,6,0,0,1,206,112ZM60,118H56a6,6,0,0,1,0-12h4A22,22,0,0,0,82,84V80a6,6,0,0,1,12,0v4A34,34,0,0,1,60,118Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M244,124a52.1,52.1,0,0,0-32-48V72a44,44,0,0,0-84-18.3A44,44,0,0,0,44,72v4a52,52,0,0,0,0,96v4a44,44,0,0,0,84,18.3A44,44,0,0,0,212,176v-4A52.07,52.07,0,0,0,244,124ZM88,212a36,36,0,0,1-36-36v-1.41A52.13,52.13,0,0,0,64,176h8a4,4,0,0,0,0-8H64A44,44,0,0,1,49.33,82.5,4,4,0,0,0,52,78.73V72a36,36,0,0,1,72,0v78.75A44,44,0,0,0,88,132a4,4,0,0,0,0,8,36,36,0,0,1,0,72Zm104-44h-8a4,4,0,0,0,0,8h8a52.13,52.13,0,0,0,12-1.41V176a36,36,0,1,1-36-36,4,4,0,0,0,0-8,44,44,0,0,0-36,18.75V72a36,36,0,0,1,72,0v6.73a4,4,0,0,0,2.67,3.77A44,44,0,0,1,192,168Zm12-56a4,4,0,0,1-4,4h-4a32,32,0,0,1-32-32V80a4,4,0,0,1,8,0v4a24,24,0,0,0,24,24h4A4,4,0,0,1,204,112ZM92,84a32,32,0,0,1-32,32H56a4,4,0,0,1,0-8h4A24,24,0,0,0,84,84V80a4,4,0,0,1,8,0Z"}))]]);var r=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))d.call(t,a)&&p(e,a,t[a]);if(c)for(var a of c(t))u.call(t,a)&&p(e,a,t[a]);return e},m=(e,t)=>i(e,s(t));let f=(0,n.forwardRef)((e,t)=>n.createElement(l.Z,m(h({ref:t},e),{weights:o})));f.displayName="Brain"},64945:function(e,t,a){"use strict";a.d(t,{B:function(){return f}});var n=a(2265),l=a(52195);let o=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]);var r=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,t,a)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))d.call(t,a)&&p(e,a,t[a]);if(c)for(var a of c(t))u.call(t,a)&&p(e,a,t[a]);return e},m=(e,t)=>i(e,s(t));let f=(0,n.forwardRef)((e,t)=>n.createElement(l.Z,m(h({ref:t},e),{weights:o})));f.displayName="Lightning"}},function(e){e.O(0,[9848,9001,3062,8840,3110,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 ef}});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),f=a(2265),x=a(32653),p=a(83102),g=a(90837),j=a(13304),y=a(93146),w=a(69591),v=a(23611),b=a.n(v),N=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,f.useState)(!1),[s,r]=(0,f.useState)(null),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(""),{toast:m}=(0,E.pm)(),h=e.automation,[x,p]=(0,f.useState)(""),[g,j]=(0,f.useState)("");return((0,f.useEffect)(()=>{let e=s||h;p(Q(e.crontime));let t=Z(e.crontime);if("Day"===t)j("Daily");else if("Week"===t){let t=J(e.crontime);void 0===t?j("Weekly"):j("".concat(K[t]))}else if("Month"===t){let t=X(e.crontime);j("Monthly on the ".concat(t))}},[s,h]),(0,f.useEffect)(()=>{let e="Automation: ".concat((null==s?void 0:s.subject)||h.subject);d&&(m({title:e,description:d,action:(0,n.jsx)(U.gD,{altText:"Dismiss",children:"Ok"})}),u(""))},[d,s,h,m]),l)?null:(0,n.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border ".concat(b().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)(N.Z,{buttonTitle:"Share",includeIcon:!0,buttonClassName:"justify-start px-4 py-2 h-10",buttonVariant:"outline",title:"Share Automation",description:"Copy the link below and share it with your coworkers or friends.",url:ei(h),onShare:()=>{navigator.clipboard.writeText(ei(h))}}),!e.suggestedCard&&(0,n.jsxs)(i.z,{variant:"outline",className:"justify-start",onClick:()=>{!function(e,t){fetch("/api/trigger/automation?automation_id=".concat(e),{method:"POST"}).then(e=>{if(!e.ok)throw Error("Network response was not ok");return e}).then(e=>{t("Automation triggered. Check your inbox in a few minutes!")}).catch(e=>{t("Sorry, something went wrong. Try again later.")})}(h.id.toString(),u)},children:[(0,n.jsx)(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:x})]}),(0,n.jsxs)("div",{className:"flex items-center bg-purple-50 rounded-lg p-1.5 border-purple-200 border dark:bg-purple-800 dark:border-purple-500",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 text-purple-700 dark:text-purple-300"}),(0,n.jsx)("div",{className:"text-s text-purple-700 dark:text-purple-300",children:g})]})]}),e.suggestedCard&&e.setNewAutomationData&&(0,n.jsx)(eh,{isMobileWidth:e.isMobileWidth,callToAction:"Add",createNew:!0,setIsCreating:a,setShowLoginPrompt:e.setShowLoginPrompt,setNewAutomationData:e.setNewAutomationData,authenticatedData:e.authenticatedData,isCreating:t,automation:h,ipLocationData:e.locationData})]})]})}function ec(e){let t=(0,D.useSearchParams)(),[a,s]=(0,f.useState)(!0),r=t.get("subject"),o=t.get("query"),i=t.get("crontime");if(!r||!o||!i)return null;let l={id:0,subject:decodeURIComponent(r),query_to_run:decodeURIComponent(o),scheduling_request:"",schedule: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,f.useState)(!1),{errors:o}=e.form.formState,c=["Make a picture of","Generate a summary of","Create a newsletter of","Notify me when"];return(0,n.jsx)(x.l0,{...e.form,children:(0,n.jsxs)("form",{onSubmit:e.form.handleSubmit(t=>{e.onSubmit(t),r(!0)}),className:"space-y-6",children:[(0,n.jsx)(x.xJ,{className:"space-y-1",children:(0,n.jsxs)(x.pf,{children:["Emails will be sent to this address. Timezone and location data will be used to schedule automations.",e.locationData&&(t=e.locationData,a=e.authenticatedData,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center justify-start",children:[a?(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",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)(x.Wi,{control:e.form.control,name:"subject",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Subject"}),(0,n.jsx)(x.pf,{children:"This is the subject of the email you will receive."}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(p.I,{placeholder:"Digest of Healthcare AI trends",...a})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.subject)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"everyBlah",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Frequency"}),(0,n.jsx)(x.pf,{children:"How often should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(M.W,{className:"h-4 w-4 mr-2 inline"}),"Every"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:$.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.everyBlah)||void 0===t?void 0:t.message})]})}}),"Week"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfWeek",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every week, on which day should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:e=>a.onChange(Number(e)),defaultValue:String(a.value),children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:K.map((e,t)=>(0,n.jsx)(l.Ql,{value:String(t),children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfWeek)||void 0===t?void 0:t.message})]})}}),"Month"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfMonth",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every month, on which day should the automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On the"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:H.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfMonth)||void 0===t?void 0:t.message})]})}}),("Day"===e.form.watch("everyBlah")||"Week"==e.form.watch("everyBlah")||"Month"==e.form.watch("everyBlah"))&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"timeRecurrence",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Time"}),(0,n.jsx)(x.pf,{children:"On the days this automation runs, at what time should it run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 inline"}),"At"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:ee.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.timeRecurrence)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"queryToRun",render:t=>{var a;let{field:s}=t;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Instructions"}),(0,n.jsx)(x.pf,{children:"What do you want Khoj to do?"}),e.create&&(0,n.jsx)("div",{children:c.map(e=>{var t;return t=s.onChange,(0,n.jsxs)(i.z,{className:"text-xs bg-slate-50 dark:bg-slate-950 h-auto p-1.5 m-1 rounded-full",variant:"ghost",onClick:a=>{a.preventDefault(),t({target:{value:e}},a)},children:[e,"..."]},e)})}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(y.g,{placeholder:"Create a summary of the latest news about AI in healthcare.",value:s.value,onChange:s.onChange})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(a=o.queryToRun)||void 0===a?void 0:a.message})]})}}),(0,n.jsx)("fieldset",{disabled:s,children:e.isLoggedIn?s?(0,n.jsx)(i.z,{type:"submit",disabled:!0,children:"Saving..."}):(0,n.jsx)(i.z,{type:"submit",children:"Save"}):(0,n.jsx)(i.z,{onClick:t=>{t.preventDefault(),e.setShowLoginPrompt(!0)},variant:"default",children:"Login to Save"})})]})})}function eh(e){return e.isMobileWidth?(0,n.jsxs)(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 ef(){let e=(0,W.GW)(),{data:t,error:a,isLoading:o}=(0,s.ZP)(e?"automations":null,G,{revalidateOnFocus:!1}),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(null),[m,h]=(0,f.useState)([]),[x,p]=(0,f.useState)([]),[g,j]=(0,f.useState)(!1),y=(0,w.IC)(),v=(0,w.k6)();return((0,f.useEffect)(()=>{d&&(h([...m,d]),u(null))},[d,m]),(0,f.useEffect)(()=>{let e=t?t.concat(m):m;e&&p(eo.filter(t=>void 0===e.find(e=>t.subject===e.subject)))},[t,m]),a)?(0,n.jsx)(r.l,{message:"Oops, something went wrong. Please refresh the page."}):(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(b().sidePanel," top-0"),children:(0,n.jsx)(B.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:y})}),(0,n.jsxs)("div",{className:"".concat(b().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)(f.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(b().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(b().automationsLayout),children:x.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 x},pf:function(){return g},xJ:function(){return f},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({}),f=s.forwardRef((e,t)=>{let{className:a,...r}=e,o=s.useId();return(0,n.jsx)(h.Provider,{value:{id:o},children:(0,n.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",a),...r})})});f.displayName="FormItem";let x=s.forwardRef((e,t)=>{let{className:a,...s}=e,{error:r,formItemId:o}=m();return(0,n.jsx)(l._,{ref:t,className:(0,i.cn)(r&&"text-destructive",a),htmlFor:o,...s})});x.displayName="FormLabel";let p=s.forwardRef((e,t)=>{let{...a}=e,{error:s,formItemId:o,formDescriptionId:i,formMessageId:l}=m();return(0,n.jsx)(r.g7,{ref:t,id:o,"aria-describedby":s?"".concat(i," ").concat(l):"".concat(i),"aria-invalid":!!s,...a})});p.displayName="FormControl";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e,{formDescriptionId:r}=m();return(0,n.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});g.displayName="FormDescription";let j=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e,{error:o,formMessageId:l}=m(),c=o?String(null==o?void 0:o.message):s;return c?(0,n.jsx)("p",{ref:t,id:l,className:(0,i.cn)("text-sm font-medium text-destructive",a),...r,children:c}):null});j.displayName="FormMessage"},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 x},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return u}});var n=a(57437),s=a(2265),r=a(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 f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})});f.displayName=r.$G.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,position:o="popper",...i}=e;return(0,n.jsx)(r.h_,{children:(0,n.jsxs)(r.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:o,...i,children:[(0,n.jsx)(h,{}),(0,n.jsx)(r.l_,{className:(0,c.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,n.jsx)(f,{})]})})});x.displayName=r.VY.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})}).displayName=r.__.displayName;let p=s.forwardRef((e,t)=>{let{className:a,children:s,...o}=e;return(0,n.jsxs)(r.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(r.wU,{children:(0,n.jsx)(l.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(r.eT,{children:s})]})});p.displayName=r.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=r.Z0.displayName},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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 x},VW:function(){return c},_i:function(){return d},gD:function(){return h},lj:function(){return p},sA:function(){return f}});var n=a(57437),s=a(2265),r=a(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 f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.x8,{ref:t,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});f.displayName=r.x8.displayName;let x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Dx,{ref:t,className:(0,l.cn)("text-sm font-semibold",a),...s})});x.displayName=r.Dx.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.dk,{ref:t,className:(0,l.cn)("text-sm opacity-90",a),...s})});p.displayName=r.dk.displayName},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
+ (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 ef}});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),f=a(2265),x=a(32653),p=a(83102),g=a(90837),j=a(13304),y=a(93146),w=a(69591),v=a(23611),b=a.n(v),N=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,f.useState)(!1),[s,r]=(0,f.useState)(null),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(""),{toast:m}=(0,E.pm)(),h=e.automation,[x,p]=(0,f.useState)(""),[g,j]=(0,f.useState)("");return((0,f.useEffect)(()=>{let e=s||h;p(Q(e.crontime));let t=Z(e.crontime);if("Day"===t)j("Daily");else if("Week"===t){let t=J(e.crontime);void 0===t?j("Weekly"):j("".concat(K[t]))}else if("Month"===t){let t=X(e.crontime);j("Monthly on the ".concat(t))}},[s,h]),(0,f.useEffect)(()=>{let e="Automation: ".concat((null==s?void 0:s.subject)||h.subject);d&&(m({title:e,description:d,action:(0,n.jsx)(U.gD,{altText:"Dismiss",children:"Ok"})}),u(""))},[d,s,h,m]),l)?null:(0,n.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border ".concat(b().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)(N.Z,{buttonTitle:"Share",includeIcon:!0,buttonClassName:"justify-start px-4 py-2 h-10",buttonVariant:"outline",title:"Share Automation",description:"Copy the link below and share it with your coworkers or friends.",url:ei(h),onShare:()=>{navigator.clipboard.writeText(ei(h))}}),!e.suggestedCard&&(0,n.jsxs)(i.z,{variant:"outline",className:"justify-start",onClick:()=>{!function(e,t){fetch("/api/trigger/automation?automation_id=".concat(e),{method:"POST"}).then(e=>{if(!e.ok)throw Error("Network response was not ok");return e}).then(e=>{t("Automation triggered. Check your inbox in a few minutes!")}).catch(e=>{t("Sorry, something went wrong. Try again later.")})}(h.id.toString(),u)},children:[(0,n.jsx)(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:x})]}),(0,n.jsxs)("div",{className:"flex items-center bg-purple-50 rounded-lg p-1.5 border-purple-200 border dark:bg-purple-800 dark:border-purple-500",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 text-purple-700 dark:text-purple-300"}),(0,n.jsx)("div",{className:"text-s text-purple-700 dark:text-purple-300",children:g})]})]}),e.suggestedCard&&e.setNewAutomationData&&(0,n.jsx)(eh,{isMobileWidth:e.isMobileWidth,callToAction:"Add",createNew:!0,setIsCreating:a,setShowLoginPrompt:e.setShowLoginPrompt,setNewAutomationData:e.setNewAutomationData,authenticatedData:e.authenticatedData,isCreating:t,automation:h,ipLocationData:e.locationData})]})]})}function ec(e){let t=(0,D.useSearchParams)(),[a,s]=(0,f.useState)(!0),r=t.get("subject"),o=t.get("query"),i=t.get("crontime");if(!r||!o||!i)return null;let l={id:0,subject:decodeURIComponent(r),query_to_run:decodeURIComponent(o),scheduling_request:"",schedule: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,f.useState)(!1),{errors:o}=e.form.formState,c=["Make a picture of","Generate a summary of","Create a newsletter of","Notify me when"];return(0,n.jsx)(x.l0,{...e.form,children:(0,n.jsxs)("form",{onSubmit:e.form.handleSubmit(t=>{e.onSubmit(t),r(!0)}),className:"space-y-6",children:[(0,n.jsx)(x.xJ,{className:"space-y-1",children:(0,n.jsxs)(x.pf,{children:["Emails will be sent to this address. Timezone and location data will be used to schedule automations.",e.locationData&&(t=e.locationData,a=e.authenticatedData,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center justify-start",children:[a?(0,n.jsxs)("span",{className:"rounded-lg text-sm border-secondary border p-1 flex items-center shadow-sm",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)(x.Wi,{control:e.form.control,name:"subject",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Subject"}),(0,n.jsx)(x.pf,{children:"This is the subject of the email you will receive."}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(p.I,{placeholder:"Digest of Healthcare AI trends",...a})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.subject)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"everyBlah",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Frequency"}),(0,n.jsx)(x.pf,{children:"How often should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(M.W,{className:"h-4 w-4 mr-2 inline"}),"Every"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:$.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.everyBlah)||void 0===t?void 0:t.message})]})}}),"Week"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfWeek",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every week, on which day should this automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:e=>a.onChange(Number(e)),defaultValue:String(a.value),children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:K.map((e,t)=>(0,n.jsx)(l.Ql,{value:String(t),children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfWeek)||void 0===t?void 0:t.message})]})}}),"Month"===e.form.watch("everyBlah")&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"dayOfMonth",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.pf,{children:"Every month, on which day should the automation run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(R.n,{className:"h-4 w-4 mr-2 inline"}),"On the"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:H.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.dayOfMonth)||void 0===t?void 0:t.message})]})}}),("Day"===e.form.watch("everyBlah")||"Week"==e.form.watch("everyBlah")||"Month"==e.form.watch("everyBlah"))&&(0,n.jsx)(x.Wi,{control:e.form.control,name:"timeRecurrence",render:e=>{var t;let{field:a}=e;return(0,n.jsxs)(x.xJ,{className:"w-full space-y-1",children:[(0,n.jsx)(x.lX,{children:"Time"}),(0,n.jsx)(x.pf,{children:"On the days this automation runs, at what time should it run?"}),(0,n.jsxs)(l.Ph,{onValueChange:a.onChange,defaultValue:a.value,children:[(0,n.jsx)(x.NI,{children:(0,n.jsxs)(l.i4,{className:"w-[200px]",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(A.u,{className:"h-4 w-4 mr-2 inline"}),"At"]}),(0,n.jsx)(l.ki,{placeholder:""})]})}),(0,n.jsx)(l.Bw,{children:ee.map(e=>(0,n.jsx)(l.Ql,{value:e,children:e},e))})]}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(t=o.timeRecurrence)||void 0===t?void 0:t.message})]})}}),(0,n.jsx)(x.Wi,{control:e.form.control,name:"queryToRun",render:t=>{var a;let{field:s}=t;return(0,n.jsxs)(x.xJ,{className:"space-y-1",children:[(0,n.jsx)(x.lX,{children:"Instructions"}),(0,n.jsx)(x.pf,{children:"What do you want Khoj to do?"}),e.create&&(0,n.jsx)("div",{children:c.map(e=>{var t;return t=s.onChange,(0,n.jsxs)(i.z,{className:"text-xs bg-slate-50 dark:bg-slate-950 h-auto p-1.5 m-1 rounded-full",variant:"ghost",onClick:a=>{a.preventDefault(),t({target:{value:e}},a)},children:[e,"..."]},e)})}),(0,n.jsx)(x.NI,{children:(0,n.jsx)(y.g,{placeholder:"Create a summary of the latest news about AI in healthcare.",value:s.value,onChange:s.onChange})}),(0,n.jsx)(x.zG,{}),o.subject&&(0,n.jsx)(x.zG,{children:null===(a=o.queryToRun)||void 0===a?void 0:a.message})]})}}),(0,n.jsx)("fieldset",{disabled:s,children:e.isLoggedIn?s?(0,n.jsx)(i.z,{type:"submit",disabled:!0,children:"Saving..."}):(0,n.jsx)(i.z,{type:"submit",children:"Save"}):(0,n.jsx)(i.z,{onClick:t=>{t.preventDefault(),e.setShowLoginPrompt(!0)},variant:"default",children:"Login to Save"})})]})})}function eh(e){return e.isMobileWidth?(0,n.jsxs)(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 ef(){let e=(0,W.GW)(),{data:t,error:a,isLoading:o}=(0,s.ZP)(e?"automations":null,G,{revalidateOnFocus:!1}),[l,c]=(0,f.useState)(!1),[d,u]=(0,f.useState)(null),[m,h]=(0,f.useState)([]),[x,p]=(0,f.useState)([]),[g,j]=(0,f.useState)(!1),y=(0,w.IC)(),v=(0,w.k6)();return((0,f.useEffect)(()=>{d&&(h([...m,d]),u(null))},[d,m]),(0,f.useEffect)(()=>{let e=t?t.concat(m):m;e&&p(eo.filter(t=>void 0===e.find(e=>t.subject===e.subject)))},[t,m]),a)?(0,n.jsx)(r.l,{message:"Oops, something went wrong. Please refresh the page."}):(0,n.jsx)("main",{className:"w-full mx-auto",children:(0,n.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,n.jsx)("div",{className:"".concat(b().sidePanel," top-0"),children:(0,n.jsx)(B.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:y})}),(0,n.jsxs)("div",{className:"".concat(b().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)(f.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(b().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(b().automationsLayout),children:x.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 x},pf:function(){return g},xJ:function(){return f},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({}),f=s.forwardRef((e,t)=>{let{className:a,...r}=e,o=s.useId();return(0,n.jsx)(h.Provider,{value:{id:o},children:(0,n.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",a),...r})})});f.displayName="FormItem";let x=s.forwardRef((e,t)=>{let{className:a,...s}=e,{error:r,formItemId:o}=m();return(0,n.jsx)(l._,{ref:t,className:(0,i.cn)(r&&"text-destructive",a),htmlFor:o,...s})});x.displayName="FormLabel";let p=s.forwardRef((e,t)=>{let{...a}=e,{error:s,formItemId:o,formDescriptionId:i,formMessageId:l}=m();return(0,n.jsx)(r.g7,{ref:t,id:o,"aria-describedby":s?"".concat(i," ").concat(l):"".concat(i),"aria-invalid":!!s,...a})});p.displayName="FormControl";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e,{formDescriptionId:r}=m();return(0,n.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});g.displayName="FormDescription";let j=s.forwardRef((e,t)=>{let{className:a,children:s,...r}=e,{error:o,formMessageId:l}=m(),c=o?String(null==o?void 0:o.message):s;return c?(0,n.jsx)("p",{ref:t,id:l,className:(0,i.cn)("text-sm font-medium text-destructive",a),...r,children:c}):null});j.displayName="FormMessage"},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 x},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return u}});var n=a(57437),s=a(2265),r=a(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 f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})});f.displayName=r.$G.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,position:o="popper",...i}=e;return(0,n.jsx)(r.h_,{children:(0,n.jsxs)(r.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:o,...i,children:[(0,n.jsx)(h,{}),(0,n.jsx)(r.l_,{className:(0,c.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,n.jsx)(f,{})]})})});x.displayName=r.VY.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})}).displayName=r.__.displayName;let p=s.forwardRef((e,t)=>{let{className:a,children:s,...o}=e;return(0,n.jsxs)(r.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(r.wU,{children:(0,n.jsx)(l.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(r.eT,{children:s})]})});p.displayName=r.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=r.Z0.displayName},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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 x},VW:function(){return c},_i:function(){return d},gD:function(){return h},lj:function(){return p},sA:function(){return f}});var n=a(57437),s=a(2265),r=a(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 f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.x8,{ref:t,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});f.displayName=r.x8.displayName;let x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.Dx,{ref:t,className:(0,l.cn)("text-sm font-semibold",a),...s})});x.displayName=r.Dx.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(r.dk,{ref:t,className:(0,l.cn)("text-sm opacity-90",a),...s})});p.displayName=r.dk.displayName},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 +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(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(59479),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.useRef)(null),x=e.setQueryToProcess,_=e.onConversationIdChange,w=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),x(s))},[x,e.setImages]),(0,i.useEffect)(()=>{s&&(h(!0),x(s))},[s,x]),(0,i.useEffect)(()=>{t&&(null==_||_(t))},[t,_]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?(h(!1),d([])):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,customClassName:w})}),(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(w," 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: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,x]=(0,i.useState)(null),[_,w]=(0,i.useState)([]),[y,I]=(0,i.useState)(""),[S,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)([]),[B,C]=(0,i.useState)([]),E=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},T=(0,g.GW)(),k=(0,h.IC)();async function M(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={};for(;;){let e;let{done:r,value:c}=await t.read();if(r){I(""),b(!1),C([]);break}for(o+=s.decode(c,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i}=(0,u.VK)(t,e,n,i)),w([..._])}}}}async function R(){if(localStorage.removeItem("message"),!y||!p)return;let e={q:y,conversation_id:p,stream:!0,...E&&{city:E.city,region:E.region,country:E.country,country_code:E.countryCode,timezone:E.timezone},...B.length>0&&{images:B}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await M(t)}catch(o){let e=await t.json();console.error(e);let s=_.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,w([..._]),I(""),b(!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(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||"",images:B};w(t=>[...t,e]),b(!0)}},[y]),(0,i.useEffect)(()=>{S&&R()},[S]),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:v,isMobileWidth:k})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!k&&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!==T,streamedMessages:_,chatOptionsData:t,setTitle:m,setQueryToProcess:I,setUploadedFiles:j,isMobileWidth:k,onConversationIdChange:e=>{x(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,929,3954,9001,3062,8840,7113,3110,394,1603,9417,3423,9479,2697,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(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(59479),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.useRef)(null),x=e.setQueryToProcess,_=e.onConversationIdChange,w=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),x(s))},[x,e.setImages]),(0,i.useEffect)(()=>{s&&(h(!0),x(s))},[s,x]),(0,i.useEffect)(()=>{t&&(null==_||_(t))},[t,_]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?(h(!1),d([])):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,customClassName:w})}),(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(w," 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: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,x]=(0,i.useState)(null),[_,w]=(0,i.useState)([]),[y,I]=(0,i.useState)(""),[S,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)([]),[B,C]=(0,i.useState)([]),E=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},T=(0,g.GW)(),k=(0,h.IC)();async function M(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={};for(;;){let e;let{done:r,value:c}=await t.read();if(r){I(""),b(!1),C([]);break}for(o+=s.decode(c,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i}=(0,u.VK)(t,e,n,i)),w([..._])}}}}async function R(){if(localStorage.removeItem("message"),!y||!p)return;let e={q:y,conversation_id:p,stream:!0,...E&&{city:E.city,region:E.region,country:E.country,country_code:E.countryCode,timezone:E.timezone},...B.length>0&&{images:B}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await M(t)}catch(o){let e=await t.json();console.error(e);let s=_.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,w([..._]),I(""),b(!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(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||"",images:B};w(t=>[...t,e]),b(!0)}},[y]),(0,i.useEffect)(()=>{S&&R()},[S]),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:v,isMobileWidth:k})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!k&&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!==T,streamedMessages:_,chatOptionsData:t,setTitle:m,setQueryToProcess:I,setUploadedFiles:j,isMobileWidth:k,onConversationIdChange:e=>{x(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,929,3954,9001,3062,8840,7113,3110,394,1603,9417,3423,9479,2697,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);