khoj 1.23.1.dev1__py3-none-any.whl → 1.23.4.dev1__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.
- khoj/database/adapters/__init__.py +8 -8
- khoj/database/migrations/0063_conversation_temp_id.py +36 -0
- khoj/database/migrations/0064_remove_conversation_temp_id_alter_conversation_id.py +86 -0
- khoj/database/models/__init__.py +1 -0
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/1603-d643510c2c0b8871.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{1906-1747a36c336df02c.js → 4051-3dc2df557ccb5213.js} +2 -2
- khoj/interface/compiled/_next/static/chunks/8423-62ac6c832be2461b.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9178-421e47df97ff0213.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-f8ad4d2944dbcf91.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-3f4b6ff0261e19b7.js → page-cc875a656df43713.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-3e75b0e0aa3aaaf5.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/factchecker/{page-828cf3c5b8e3af79.js → page-bb320ff7d4dee716.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-2f423a763e2ee0c7.js → page-60193524cf570002.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/page-4bceb5b0df9cfd66.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/settings/page-532ed8b778a0b40d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-b5e63aabfd573dba.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{webpack-61a553b6ff44f97c.js → webpack-de28762883e5816d.js} +1 -1
- khoj/interface/compiled/_next/static/css/1105696872e3f20c.css +25 -0
- khoj/interface/compiled/_next/static/css/37a313cb39403a84.css +1 -0
- khoj/interface/compiled/_next/static/css/6bde1f2045622ef7.css +1 -0
- khoj/interface/compiled/_next/static/css/{a3530ec58b0b660f.css → ab57702ed2b98214.css} +1 -1
- khoj/interface/compiled/_next/static/css/{92c48eece0b102b9.css → e41ec62af8ee4e38.css} +1 -1
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +2 -2
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/factchecker/index.html +1 -1
- khoj/interface/compiled/factchecker/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +2 -2
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/interface/email/magic_link.html +1 -1
- khoj/interface/email/task.html +31 -34
- khoj/interface/email/welcome.html +82 -53
- khoj/main.py +1 -1
- khoj/processor/content/images/image_to_entries.py +6 -4
- khoj/processor/conversation/google/utils.py +106 -7
- khoj/processor/conversation/utils.py +13 -8
- khoj/routers/api.py +1 -1
- khoj/routers/api_chat.py +13 -15
- khoj/routers/helpers.py +12 -7
- khoj/utils/cli.py +6 -0
- khoj/utils/constants.py +9 -2
- khoj/utils/initialization.py +158 -71
- {khoj-1.23.1.dev1.dist-info → khoj-1.23.4.dev1.dist-info}/METADATA +2 -2
- {khoj-1.23.1.dev1.dist-info → khoj-1.23.4.dev1.dist-info}/RECORD +60 -58
- khoj/interface/compiled/_next/static/chunks/1603-fb2d80ae73990df3.js +0 -1
- khoj/interface/compiled/_next/static/chunks/8423-14fc72aec9104ce9.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9178-c153fc402c970365.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/page-989a824c640bc532.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-cc71b18feddf80d6.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/search/page-dcd385f03255ef36.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-ddcd51147d18c694.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-a84001b4724b5463.js +0 -1
- khoj/interface/compiled/_next/static/css/2272c73fc7a3b571.css +0 -1
- khoj/interface/compiled/_next/static/css/3e49e5ee49c6bda1.css +0 -25
- khoj/interface/compiled/_next/static/css/553f9cdcc7a2bcd6.css +0 -1
- /khoj/interface/compiled/_next/static/chunks/{7023-52c1be60135eb057.js → 7023-1074a582ec989284.js} +0 -0
- /khoj/interface/compiled/_next/static/{A47_BQNcqhjWCuNh_iSec → u496AO3jlFBPp2apVnMkP}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{A47_BQNcqhjWCuNh_iSec → u496AO3jlFBPp2apVnMkP}/_ssgManifest.js +0 -0
- {khoj-1.23.1.dev1.dist-info → khoj-1.23.4.dev1.dist-info}/WHEEL +0 -0
- {khoj-1.23.1.dev1.dist-info → khoj-1.23.4.dev1.dist-info}/entry_points.txt +0 -0
- {khoj-1.23.1.dev1.dist-info → khoj-1.23.4.dev1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var n=s(57437),a=s(65104),o=s.n(a),r=s(2265),i=s(48861),c=s(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var g=s(69591),h=s(38423),m=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,a]=(0,r.useState)(""),[i,d]=(0,r.useState)(null),[u,g]=(0,r.useState)(!1),[m,f]=(0,r.useState)(null),p=e.setQueryToProcess,x=e.onConversationIdChange;if((0,r.useEffect)(()=>{i&&e.setImage64(encodeURIComponent(i))},[i,e.setImage64]),(0,r.useEffect)(()=>{let t=localStorage.getItem("image");t&&(d(t),e.setImage64(encodeURIComponent(t)),localStorage.removeItem("image"));let s=localStorage.getItem("message");s&&(g(!0),p(s))},[p]),(0,r.useEffect)(()=>{s&&(g(!0),p(s))},[s,p]),(0,r.useEffect)(()=>{t&&(null==x||x(t))},[t,x]),(0,r.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?g(!1):a("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:o().chatBodyFull,children:(0,n.jsx)(c.Z,{conversationId:t,setTitle:e.setTitle,setAgent:f,pendingMessage:u?s:"",incomingMessages:e.streamedMessages})}),(0,n.jsx)("div",{className:"".concat(o().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"),children:(0,n.jsx)(h.Z,{agentColor:null==m?void 0:m.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(e),sendDisabled:u,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,r.useState)(null),[a,c]=(0,r.useState)(!0),[l,h]=(0,r.useState)(e),[p,x]=(0,r.useState)(null),[v,y]=(0,r.useState)([]),[_,j]=(0,r.useState)(""),[b,I]=(0,r.useState)(!1),[w,M]=(0,r.useState)([]),[S,C]=(0,r.useState)(""),N=(0,g.k6)(),T=(0,m.G)(),B=(0,g.IC)();async function E(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,n="␃\uD83D\uDD1A␗",a="",o=[],r={};for(;;){let e;let{done:i,value:c}=await t.read();if(i){j(""),I(!1),C("");break}for(a+=s.decode(c,{stream:!0});-1!==(e=a.indexOf(n));){let t=a.slice(0,e);if(a=a.slice(e+n.length),t){let e=v.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:o,onlineContext:r}=(0,u.VK)(t,e,o,r)),y([...v])}}}}async function O(){if(localStorage.removeItem("message"),!_||!p)return;let e={q:_,conversation_id:parseInt(p),stream:!0,...N&&{region:N.region,country:N.country,city:N.city,timezone:N.timezone},...S&&{image:S}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await E(t)}catch(s){console.error(s);let e=v.find(e=>!e.completed);if(!e)return;let t=s.message;e.rawResponse="Encountered Error: ".concat(t,". Please try again later."),e.completed=!0,y([...v]),j(""),I(!1)}}return((0,r.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,g.EK)()},[]),(0,r.useEffect)(()=>{if(_){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:_||"",uploadedImageData:decodeURIComponent(S)};y(t=>[...t,e]),I(!0)}},[_]),(0,r.useEffect)(()=>{b&&O()},[b]),a)?(0,n.jsx)(d.Z,{}):(0,n.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,n.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,n.jsx)("div",{children:(0,n.jsx)(i.Z,{conversationId:p,uploadedFiles:w,isMobileWidth:B})}),(0,n.jsx)("div",{className:o().chatBox,children:(0,n.jsxs)("div",{className:o().chatBoxBody,children:[!B&&(0,n.jsx)("div",{className:"text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8",children:l&&(0,n.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden pt-6",children:l})}),(0,n.jsx)(r.Suspense,{fallback:(0,n.jsx)(d.Z,{}),children:(0,n.jsx)(f,{isLoggedIn:null!==T,streamedMessages:v,chatOptionsData:t,setTitle:h,setQueryToProcess:j,setUploadedFiles:M,isMobileWidth:B,onConversationIdChange:e=>{x(e)},setImage64:C})})]})})]})}},82697:function(e,t,s){"use strict";s.d(t,{Z:function(){return x}});var n=s(57437),a=s(15238),o=s.n(a),r=s(2265),i=s(89178),c=s(94880),l=s(58485),d=s(16288),u=s(26100),g=s(19666),h=s(50495),m=e=>{let{name:t,avatar:s,link:a,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(g.pn,{children:(0,n.jsxs)(g.u,{children:[(0,n.jsx)(g.aJ,{asChild:!0,children:(0,n.jsxs)(h.z,{variant:"ghost",className:"flex items-center justify-center",children:[s,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(g._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[s,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(u.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})},f=s(89417),p=s(69591);function x(e){let[t,s]=(0,r.useState)(null),[a,u]=(0,r.useState)(0),[g,h]=(0,r.useState)(!0),x=(0,r.useRef)(null),v=(0,r.useRef)(null),y=(0,r.useRef)(null),[_,j]=(0,r.useState)(null),[b,I]=(0,r.useState)(!1),w=(0,p.IC)();(0,r.useEffect)(()=>{a<2&&((null==t?void 0:t.chat.length)||setTimeout(()=>{M()},500))},[t,a]),(0,r.useEffect)(()=>{if(!g||b)return;let n=new IntersectionObserver(n=>{n[0].isIntersecting&&g&&(I(!0),function(n){if(!g||b)return;let a=n+1,o="";if(e.conversationId)o="/api/chat/history?client=web&conversation_id=".concat(e.conversationId,"&n=").concat(10*a);else{if(!e.publicConversationSlug)return;o="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(10*a)}fetch(o).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(a.response.chat.length===(null==t?void 0:t.chat.length)){h(!1),I(!1);return}e.setAgent(a.response.agent),s(a.response),n<2&&M(),I(!1)}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),s(t)}h(!1),I(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(a),u(e=>e+1))},{threshold:1});return y.current&&n.observe(y.current),()=>n.disconnect()},[g,a,b]),(0,r.useEffect)(()=>{h(!0),I(!1),u(0),s(null)},[e.conversationId]),(0,r.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&j(e.incomingMessages.length-1)}S()&&M()},[e.incomingMessages]);let M=()=>{v.current&&v.current.scrollIntoView(!1)},S=()=>{if(!v.current)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:s}=v.current;return e+s>=t-25};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(c.x,{className:"h-[80vh]",children:(0,n.jsx)("div",{ref:x,children:(0,n.jsxs)("div",{className:o().chatHistory,ref:v,children:[(0,n.jsx)("div",{ref:y,style:{height:"1px"},children:b&&(0,n.jsx)(l.l,{message:"Loading Conversation",className:"opacity-50"})}),t&&t.chat&&t.chat.map((e,s)=>(0,n.jsx)(i.Z,{isMobileWidth:w,chatMessage:e,customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:s===t.chat.length-1},"".concat(s,"fullHistory"))),e.incomingMessages&&e.incomingMessages.map((e,s)=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(i.Z,{isMobileWidth:w,chatMessage:{message:e.rawQuery,context:[],onlineContext:{},created:e.timestamp,by:"you",automationId:"",uploadedImageData:e.uploadedImageData},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500")},"".concat(s,"outgoing")),e.trainOfThought&&function(e,t,s,a){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=e.length-1;return(0,n.jsxs)("div",{className:"".concat(o().trainOfThought," shadow-sm"),children:[!r&&(0,n.jsx)(l.l,{className:"float-right"}),e.map((e,a)=>(0,n.jsx)(i.H,{message:e,primary:a===c&&t&&!r,agentColor:s},"train-".concat(a)))]},a)}(e.trainOfThought,s===_,(null==t?void 0:t.agent.color)||"orange","".concat(s,"trainOfThought"),e.completed),(0,n.jsx)(i.Z,{isMobileWidth:w,chatMessage:{message:e.rawResponse,context:e.context,onlineContext:e.onlineContext,created:e.timestamp,by:"khoj",automationId:"",rawQuery:e.rawQuery},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"".concat(s,"incoming"))]},"incomingMessage".concat(s))),e.pendingMessage&&(0,n.jsx)(i.Z,{isMobileWidth:w,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",uploadedImageData:e.pendingMessage},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),t&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(m,{name:t&&t.agent&&t.agent.name?t.agent.name:"Agent",link:t&&t.agent&&t.agent.slug?"/agents?agent=".concat(t.agent.slug):"/agents",avatar:(0,f.T)(t.agent.icon,t.agent.color)||(0,n.jsx)(d.v,{}),description:t&&t.agent&&t.agent.persona?t.agent.persona:""})})})]})})}):null}},16463:function(e,t,s){"use strict";var n=s(71169);s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.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"}},15238:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",chatLayout:"chatHistory_chatLayout__ABli_",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}}},function(e){e.O(0,[7812,647,929,3954,9001,3062,743,121,7071,1906,9984,1603,9417,9178,8423,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,t,s){Promise.resolve().then(s.bind(s,51956))},51956:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(57437),a=s(83102),r=s(2265),l=s(48861),o=s(49315),i=s.n(o),d=s(94880),c=s(36013),u=s(72151),m=s(9476),h=s(22585),x=s(26100),f=s(44686),g=s(35304),j=s(95289),b=s(17541),p=s(16288),N=s(52680),y=s(50495),w=s(87138),v=s(89417),k=s(69591);let _=["What does the paper say about climate change?","Making a cappuccino at home","Benefits of eating mangoes","How to plan a wedding on a budget","Appointment with Dr. Makinde on 12th August","Class notes lecture 3 on quantum mechanics","Painting concepts for acrylics","Abstract from the paper attention is all you need","Climbing Everest without oxygen","Solving a rubik's cube in 30 seconds","Facts about the planet Mars","How to make a website using React","Fish at the bottom of the ocean","Fish farming Kenya 2021","How to make a cake without an oven","Installing a solar panel at home"];function S(e){var t;let s=e.note,a=(s.additional.file||"").startsWith("http"),r=a?s.additional.heading:s.additional.file.split("/").pop(),l=(0,v.L)(r||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsxs)(c.ll,{className:"inline-flex gap-2",children:["notion"===(t=s.additional.source)?(0,n.jsx)(u.F,{className:"text-muted-foreground"}):"github"===t?(0,n.jsx)(m.b,{className:"text-muted-foreground"}):(0,n.jsx)(h.S,{className:"text-muted-foreground"}),r]})}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:s.entry}),(0,n.jsxs)(y.z,{onClick:()=>e.setFocusSearchResult(s),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,n.jsx)(x.o,{className:"inline ml-2"})]})]}),(0,n.jsx)(c.eW,{children:a?(0,n.jsxs)("a",{href:s.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,n.jsx)(f.a,{className:"inline m-2"}),s.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-2 text-sm rounded-lg text-muted-foreground",children:[l,s.additional.file]})})]})}function C(){let[e,t]=(0,r.useState)(""),[s,o]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(null),[C,E]=(0,r.useState)(""),F=(0,r.useRef)(null),M=(0,k.IC)();function T(){!u&&e.trim()&&fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{o(e),m(!1)}).catch(e=>{console.error("Error:",e)})}return(0,r.useEffect)(()=>{E(_[Math.floor(Math.random()*_.length)])},[]),(0,r.useEffect)(()=>{if(e.trim())return x(null),F.current&&clearTimeout(F.current),e.trim()&&(F.current=setTimeout(()=>{T()},750)),()=>{F.current&&clearTimeout(F.current)}},[e]),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"h-full ".concat(i().sidePanel),children:(0,n.jsx)(l.Z,{conversationId:null,uploadedFiles:[],isMobileWidth:M})}),(0,n.jsx)("div",{className:"".concat(i().searchLayout),children:(0,n.jsx)("div",{className:"md:w-3/4 sm:w-full mx-auto pt-6 md:pt-8",children:(0,n.jsxs)("div",{className:"p-4 md:w-3/4 sm:w-full mx-auto",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg",children:[(0,n.jsx)(a.I,{autoFocus:!0,className:"border-none pl-4",onChange:e=>t(e.currentTarget.value),onKeyDown:e=>"Enter"===e.key&&T(),type:"search",placeholder:"Search Documents"}),(0,n.jsxs)("button",{className:"px-2 gap-2 inline-flex items-center rounded border-l border-gray-300 hover:text-gray-500",onClick:()=>T(),children:[(0,n.jsx)(g.Y,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Find"})]})]}),h&&(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)(y.z,{onClick:()=>x(null),className:"mb-4",variant:"outline",children:[(0,n.jsx)(j.X,{className:"inline mr-2"}),"Back"]}),function(e){let t=(e.additional.file||"").startsWith("http"),s=t?e.additional.heading:e.additional.file.split("/").pop(),a=(0,v.L)(s||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsx)(c.ll,{children:s})}),(0,n.jsx)(c.eW,{children:t?(0,n.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,n.jsx)(f.a,{className:"inline"}),e.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-3 text-sm rounded-lg text-muted-foreground flex items-center gap-2",children:[a,e.additional.file]})}),(0,n.jsx)(c.aY,{children:(0,n.jsx)("div",{className:"text-m",children:e.entry})})]})}(h)]}),!h&&s&&s.length>0&&(0,n.jsx)("div",{className:"mt-4 max-w-[92vw] break-all",children:(0,n.jsx)(d.x,{className:"h-[80vh]",children:s.map((e,t)=>(0,n.jsx)(S,{note:e,setFocusSearchResult:x},e["corpus-id"]))})}),null==s&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(b.r,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"Search across your documents"})]}),(0,n.jsxs)(c.aY,{className:"text-muted-foreground items-center justify-center text-center flex",children:[(0,n.jsx)(p.v,{className:"inline mr-2"})," ",C]})]}),s&&0===s.length&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(N.D,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"No documents found"})]}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:"To use search, upload your docs to your account."}),(0,n.jsx)(w.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,n.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]})]})})})]})}},49315:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0",sidePanel:"search_sidePanel__myfc9"}}},function(e){e.O(0,[647,9001,3062,743,6297,1603,9417,2971,7023,1744],function(){return e(e.s=94114)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,s,t){Promise.resolve().then(t.bind(t,95982))},95982:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return eh}});var a,n,r=t(57437),l=t(55268),i=t.n(l);t(80541);var o=t(2265),c=t(35657),d=t(79306),h=t(69591),u=t(19748),m=t(50495),x=t(66431),p=t(32309),f=t(37440);let j=o.forwardRef((e,s)=>{let{className:t,containerClassName:a,...n}=e;return(0,r.jsx)(x.uZ,{ref:s,containerClassName:(0,f.cn)("flex items-center gap-2 has-[:disabled]:opacity-50",a),className:(0,f.cn)("disabled:cursor-not-allowed",t),...n})});j.displayName="InputOTP";let g=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,f.cn)("flex items-center",t),...a})});g.displayName="InputOTPGroup";let b=o.forwardRef((e,s)=>{let{index:t,className:a,...n}=e,{char:l,hasFakeCaret:i,isActive:c}=o.useContext(x.VM).slots[t];return(0,r.jsxs)("div",{ref:s,className:(0,f.cn)("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",c&&"z-10 ring-2 ring-ring ring-offset-background",a),...n,children:[l,i&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});b.displayName="InputOTPSlot",o.forwardRef((e,s)=>{let{...t}=e;return(0,r.jsx)("div",{ref:s,role:"separator",...t,children:(0,r.jsx)(p.Z,{})})}).displayName="InputOTPSeparator";var N=t(83102),y=t(36013),w=t(46910);let v=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,f.cn)("w-full caption-bottom text-sm",t),...a})})});v.displayName="Table",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("thead",{ref:s,className:(0,f.cn)("[&_tr]:border-b",t),...a})}).displayName="TableHeader";let _=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,f.cn)("[&_tr:last-child]:border-0",t),...a})});_.displayName="TableBody",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,f.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a})}).displayName="TableFooter";let k=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tr",{ref:s,className:(0,f.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a})});k.displayName="TableRow",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("th",{ref:s,className:(0,f.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a})}).displayName="TableHead";let S=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("td",{ref:s,className:(0,f.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a})});S.displayName="TableCell",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("caption",{ref:s,className:(0,f.cn)("mt-4 text-sm text-muted-foreground",t),...a})}).displayName="TableCaption";var C=t(42491),T=t(9950),D=t(35418),F=t(15340),E=t(84120),P=t(55362),O=t(48252),A=t(60787),I=t(26058),z=t(95616),Y=t(11961),R=t(76782),Z=t(98325),K=t(96917),M=t(10813),W=t(56194),L=t(9476),U=t(43010),V=t(72151),B=t(53876),G=t(90445),H=t(17541),J=t(63205),$=t(49806),q=t(67722),X=t(57087),Q=t(27082),ee=t(26100),es=t(48861),et=t(58485),ea=t(47947),en=t(9557),er=t(6780),el=t(70571),ei=t(87138);let eo=e=>{let{onClose:s}=e,[t,a]=(0,o.useState)([]),[n,l]=(0,o.useState)([]),[i,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,N]=(0,o.useState)(0),[y,w]=(0,o.useState)([]),v=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||N(0),j){let e=setInterval(()=>{N(e=>{let s=e+(Math.floor(5*Math.random())+1);return s<100?s:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let s=await e.json();Array.isArray(s)?a(s.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[y]);let _=t.filter(e=>e.toLowerCase().includes(i.toLowerCase())),k=async()=>{let e=n.length>0?n:_;if(console.log("Delete selected files",e),0===e.length){console.log("No files to delete");return}try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(s=>s.filter(s=>!e.includes(s))),l([]),console.log("Deleted files:",e)}catch(e){console.error("Error deleting files:",e)}},S=async e=>{console.log("Delete selected file",e);try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(s=>s.filter(s=>s!==e)),l(s=>s.filter(s=>s!==e)),console.log("Deleted file:",e)}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,en.ko)(e,x,g,f,w)}return(0,r.jsxs)(C.m5,{open:!0,onOpenChange:s,children:[(0,r.jsx)(er.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(er._T,{children:[(0,r.jsx)(er.fY,{children:(0,r.jsx)(er.f$,{children:"Alert"})}),(0,r.jsx)(er.yT,{children:u||p}),(0,r.jsx)(er.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){v&&v.current&&v.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:v,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(el.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(T.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(D.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4",children:"Synced files"}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(C.sZ,{placeholder:"Find synced files",value:i,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(C.e8,{children:[(0,r.jsx)(C.rb,{children:0===t.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(F.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(ei.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(C.fu,{heading:"Synced files",children:_.map(e=>(0,r.jsx)(C.di,{value:e,onSelect:e=>{l(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(E.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>S(e),className:"ml-auto",children:(0,r.jsx)(P.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:k,className:"mr-2",children:[(0,r.jsx)(P.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},ec=e=>{var s,t;let{items:a,selected:n,callbackFunc:l}=e,[i,c]=(0,o.useState)(null!==(t=null==n?void 0:n.toString())&&void 0!==t?t:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(w.h_,{children:[(0,r.jsx)(w.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(s=a.find(e=>e.id.toString()===i))||void 0===s?void 0:s.name," ",(0,r.jsx)(O.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(w.AW,{children:(0,r.jsx)(w._x,{value:i,onValueChange:async e=>{c(e),await l(e)},children:a.map(e=>(0,r.jsx)(w.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},ed=()=>{let[e,s]=(0,o.useState)([]),{toast:t}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),t=await e.json();s(e=>[...e,t])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),t({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&s(s=>s.filter(s=>s.token!==e))}catch(e){console.error("Error deleting API key:",e)}},l=async()=>{try{let e=await fetch("/auth/token"),t=await e.json();(null==t?void 0:t.length)>0&&s(t)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{l()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function eh(){let[e,s]=(0,o.useState)("Settings"),{apiKeys:t,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:l}=ed(),{userConfig:x}=(0,d.h)(!0),[p,f]=(0,o.useState)(null),[w,C]=(0,o.useState)(void 0),[E,O]=(0,o.useState)(null),[en,er]=(0,o.useState)(void 0),[el,ei]=(0,o.useState)(""),[eh,eu]=(0,o.useState)("verified"),[em,ex]=(0,o.useState)(!1),{toast:ep}=(0,c.pm)(),ef=(0,h.IC)(),ej="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950";(0,o.useEffect)(()=>{var e;f(x),er(null==x?void 0:x.phone_number),eu((null==x?void 0:x.is_phone_number_verified)?"verified":(null==x?void 0:x.phone_number)?"otp":"setup"),C(null==x?void 0:x.given_name),O(null!==(e=null==x?void 0:x.notion_token)&&void 0!==e?e:null)},[x]);let eg=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(en),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");eu("verify")}catch(e){console.error("Error sending OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(el),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");eu("verified"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},eN=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");er(void 0),eu("setup"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},ey=async e=>{try{let s="/api/subscription?email=".concat(null==p?void 0:p.username,"&operation=").concat(e);if(!(await fetch(s,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");p&&(p.subscription_state="cancel"===e?"unsubscribed":"subscribed",f(p)),ep({title:"\uD83D\uDCB3 Subscription",description:(null==p?void 0:p.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(s){console.error("Error changing subscription:",s),ep({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},ew=async()=>{if(w)try{if(!(await fetch("/api/user/name?name=".concat(w),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");p&&(p.given_name=w,f(p)),ep({title:"✅ Updated Profile",description:"You name has been updated to ".concat(w)})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ev=e=>async s=>{if(!(null==p?void 0:p.is_active)&&"search"!==e){ep({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}try{if(!(await fetch("/api/model/".concat(e,"?id=")+s,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");ep({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(s){console.error("Failed to update ".concat(e," model:"),s),ep({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},e_=async()=>{if(E)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:E})})).ok)throw Error("Failed to save Notion API key");p&&(p.notion_token=E,f(p)),ep({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ek=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));ep({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(s){console.error("Error syncing content:",s),ep({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},eS=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));p&&("computer"===e?p.enabled_content_source.computer=!1:"notion"===e?(p.enabled_content_source.notion=!1,p.notion_token=null,O(p.notion_token)):"github"===e&&(p.enabled_content_source.github=!1),f(p)),"computer"===e?ep({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):ep({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(s){console.error("Error disconnecting ".concat(e,":"),s),ep({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return p?(0,r.jsxs)("div",{className:i().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:i().sidePanel,children:(0,r.jsx)(es.Z,{conversationId:null,uploadedFiles:[],isMobileWidth:ef})}),(0,r.jsx)("div",{className:i().content,children:(0,r.jsx)("div",{className:"".concat(i().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(et.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(A.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(N.I,{type:"text",onChange:e=>C(e.target.value),value:w,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ew,disabled:w===p.given_name,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(y.Zb,{id:"subscription",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(z.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(y.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a 14 day trial of the Khoj Futurist plan. Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"unsubscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"expired"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Free Plan"}),p.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>ey("cancel"),children:[(0,r.jsx)(Y.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>ey("resubscribe"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(p.khoj_cloud_subscription_url,"?prefilled_email=").concat(p.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})})]})]})]}),em&&(0,r.jsx)(eo,{onClose:()=>ex(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{id:"computer",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(Z.I,{className:"h-8 w-8 mr-2"}),"Files",p.enabled_content_source.computer&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>ex(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.computer||"hidden"),onClick:()=>eS("computer"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"github",className:"".concat(ej," hidden"),children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(L.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:p.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"notion",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(V.F,{className:"h-7 w-7 mr-2"}),"Notion",p.enabled_content_source.notion&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!p.notion_oauth_url&&(0,r.jsx)(N.I,{onChange:e=>O(e.target.value),value:E||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[p.notion_oauth_url&&!p.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(p.notion_oauth_url)},children:[(0,r.jsx)(U.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):p.enabled_content_source.notion&&E===p.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ek("notion"),children:[(0,r.jsx)(B.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):p.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:e_,disabled:E===p.notion_token,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-1"}),p.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.notion_token||"hidden"),onClick:()=>eS("notion"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[p.chat_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(G.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(ec,{items:p.chat_model_options,selected:p.selected_chat_model_config,callbackFunc:ev("chat")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.search_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.r,{className:"h-7 w-7 mr-2"}),"Search"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the search model to find your documents"}),(0,r.jsx)(ec,{items:p.search_model_options,selected:p.selected_search_model_config,callbackFunc:ev("search")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),p.paint_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(J.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(ec,{items:p.paint_model_options,selected:p.selected_paint_model_config,callbackFunc:ev("paint")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.voice_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(T.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(ec,{items:p.voice_model_options,selected:p.selected_voice_model_config,callbackFunc:ev("voice")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-8",children:[!p.anonymous_mode&&(0,r.jsxs)(y.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950",children:[(0,r.jsxs)(y.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)($.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(D.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(v,{children:(0,r.jsx)(_,{children:t.map(e=>(0,r.jsxs)(k,{children:[(0,r.jsx)(S,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(S,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(q.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(P.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),l(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(X.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eh&&(0,r.jsx)(K.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eh&&(0,r.jsx)(F.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(ea.Z,{initialValue:en||"",onChangeNumber:er,disabled:"verify"===eh,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(i().phoneInput)}}),"verify"===eh&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(en)}),(0,r.jsx)(j,{autoFocus:!0,maxLength:6,value:el||"",onChange:ei,onComplete:()=>eu("verify"),children:(0,r.jsxs)(g,{children:[(0,r.jsx)(b,{index:0}),(0,r.jsx)(b,{index:1}),(0,r.jsx)(b,{index:2}),(0,r.jsx)(b,{index:3}),(0,r.jsx)(b,{index:4}),(0,r.jsx)(b,{index:5})]})})]})]})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:["verify"===eh&&(0,r.jsx)(m.z,{variant:"outline",onClick:eb,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!en||en===p.phone_number&&"verified"===eh||!(0,u.y)(en),onClick:eg,children:p.phone_number?en&&(en!==p.phone_number||"verified"!==eh)&&(0,u.y)(en)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(ee.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eh&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>eN(),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(et.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},70571:function(e,s,t){"use strict";t.d(s,{E:function(){return i}});var a=t(57437),n=t(2265),r=t(52431),l=t(37440);let i=n.forwardRef((e,s)=>{let{className:t,value:n,indicatorColor:i,...o}=e;return(0,a.jsx)(r.fC,{ref:s,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});i.displayName=r.fC.displayName},35657:function(e,s,t){"use strict";t.d(s,{pm:function(){return u}});var a=t(2265);let n=0,r=new Map,l=e=>{if(r.has(e))return;let s=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,s)},i=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=s;return t?l(t):e.toasts.forEach(e=>{l(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},o=[],c={toasts:[]};function d(e){c=i(c,e),o.forEach(e=>{e(c)})}function h(e){let{...s}=e,t=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:e=>{e||a()}}}),{id:t,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function u(){let[e,s]=a.useState(c);return a.useEffect(()=>(o.push(s),()=>{let e=o.indexOf(s);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},55268:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[4229,647,9001,3062,3678,1603,2971,7023,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,5506))},82697:function(e,t,s){"use strict";s.d(t,{Z:function(){return x}});var n=s(57437),a=s(15238),o=s.n(a),i=s(2265),r=s(89178),c=s(94880),l=s(58485),d=s(16288),u=s(26100),h=s(19666),g=s(50495),m=e=>{let{name:t,avatar:s,link:a,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(h.pn,{children:(0,n.jsxs)(h.u,{children:[(0,n.jsx)(h.aJ,{asChild:!0,children:(0,n.jsxs)(g.z,{variant:"ghost",className:"flex items-center justify-center",children:[s,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(h._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[s,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(u.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})},f=s(89417),p=s(69591);function x(e){let[t,s]=(0,i.useState)(null),[a,u]=(0,i.useState)(0),[h,g]=(0,i.useState)(!0),x=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useRef)(null),[_,j]=(0,i.useState)(null),[b,C]=(0,i.useState)(!1),I=(0,p.IC)();(0,i.useEffect)(()=>{a<2&&((null==t?void 0:t.chat.length)||setTimeout(()=>{M()},500))},[t,a]),(0,i.useEffect)(()=>{if(!h||b)return;let n=new IntersectionObserver(n=>{n[0].isIntersecting&&h&&(C(!0),function(n){if(!h||b)return;let a=n+1,o="";if(e.conversationId)o="/api/chat/history?client=web&conversation_id=".concat(e.conversationId,"&n=").concat(10*a);else{if(!e.publicConversationSlug)return;o="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(10*a)}fetch(o).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(a.response.chat.length===(null==t?void 0:t.chat.length)){g(!1),C(!1);return}e.setAgent(a.response.agent),s(a.response),n<2&&M(),C(!1)}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),s(t)}g(!1),C(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(a),u(e=>e+1))},{threshold:1});return y.current&&n.observe(y.current),()=>n.disconnect()},[h,a,b]),(0,i.useEffect)(()=>{g(!0),C(!1),u(0),s(null)},[e.conversationId]),(0,i.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&j(e.incomingMessages.length-1)}N()&&M()},[e.incomingMessages]);let M=()=>{v.current&&v.current.scrollIntoView(!1)},N=()=>{if(!v.current)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:s}=v.current;return e+s>=t-25};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(c.x,{className:"h-[80vh]",children:(0,n.jsx)("div",{ref:x,children:(0,n.jsxs)("div",{className:o().chatHistory,ref:v,children:[(0,n.jsx)("div",{ref:y,style:{height:"1px"},children:b&&(0,n.jsx)(l.l,{message:"Loading Conversation",className:"opacity-50"})}),t&&t.chat&&t.chat.map((e,s)=>(0,n.jsx)(r.Z,{isMobileWidth:I,chatMessage:e,customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:s===t.chat.length-1},"".concat(s,"fullHistory"))),e.incomingMessages&&e.incomingMessages.map((e,s)=>(0,n.jsxs)(i.Fragment,{children:[(0,n.jsx)(r.Z,{isMobileWidth:I,chatMessage:{message:e.rawQuery,context:[],onlineContext:{},created:e.timestamp,by:"you",automationId:"",uploadedImageData:e.uploadedImageData},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500")},"".concat(s,"outgoing")),e.trainOfThought&&function(e,t,s,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=e.length-1;return(0,n.jsxs)("div",{className:"".concat(o().trainOfThought," shadow-sm"),children:[!i&&(0,n.jsx)(l.l,{className:"float-right"}),e.map((e,a)=>(0,n.jsx)(r.H,{message:e,primary:a===c&&t&&!i,agentColor:s},"train-".concat(a)))]},a)}(e.trainOfThought,s===_,(null==t?void 0:t.agent.color)||"orange","".concat(s,"trainOfThought"),e.completed),(0,n.jsx)(r.Z,{isMobileWidth:I,chatMessage:{message:e.rawResponse,context:e.context,onlineContext:e.onlineContext,created:e.timestamp,by:"khoj",automationId:"",rawQuery:e.rawQuery},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"".concat(s,"incoming"))]},"incomingMessage".concat(s))),e.pendingMessage&&(0,n.jsx)(r.Z,{isMobileWidth:I,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",uploadedImageData:e.pendingMessage},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),t&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(m,{name:t&&t.agent&&t.agent.name?t.agent.name:"Agent",link:t&&t.agent&&t.agent.slug?"/agents?agent=".concat(t.agent.slug):"/agents",avatar:(0,f.T)(t.agent.icon,t.agent.color)||(0,n.jsx)(d.v,{}),description:t&&t.agent&&t.agent.persona?t.agent.persona:""})})})]})})}):null}},5506:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return f}});var n=s(57437),a=s(11930),o=s.n(a),i=s(2265),r=s(48861),c=s(82697),l=s(58485);s(7395);var d=s(69591),u=s(79306),h=s(38423),g=s(9557);function m(e){let[t,s]=(0,i.useState)(""),[a,r]=(0,i.useState)(null),[l,d]=(0,i.useState)(!1),[u,g]=(0,i.useState)(null),m=e.setQueryToProcess,f=e.streamedMessages;return((0,i.useEffect)(()=>{a&&e.setImage64(encodeURIComponent(a))},[a,e.setImage64]),(0,i.useEffect)(()=>{t&&(d(!0),m(t))},[t,m]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?d(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:o().chatBodyFull,children:(0,n.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:l?t:"",incomingMessages:e.streamedMessages})}),(0,n.jsx)("div",{className:"".concat(o().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"),children:(0,n.jsx)(h.Z,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>r(e),sendDisabled:l,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]}):(0,n.jsx)("div",{className:o().suggestions,children:"Whoops, nothing to see here!"})}function f(){let[e,t]=(0,i.useState)(null),[s,a]=(0,i.useState)(!0),[c,h]=(0,i.useState)("Khoj AI - Chat"),[f,p]=(0,i.useState)(void 0),[x,v]=(0,i.useState)([]),[y,_]=(0,i.useState)(""),[j,b]=(0,i.useState)(!1),[C,I]=(0,i.useState)([]),[M,N]=(0,i.useState)(void 0),[S,w]=(0,i.useState)(""),O=(0,d.k6)(),T=(0,u.G)(),B=(0,d.IC)();async function k(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,n="␃\uD83D\uDD1A␗",a="";for(;;){let e;let{done:o,value:i}=await t.read();if(o){_(""),b(!1),w("");break}for(a+=s.decode(i,{stream:!0});-1!==(e=a.indexOf(n));){let t=a.slice(0,e);if(a=a.slice(e+n.length),t){let e=x.find(e=>!e.completed);if(!e){console.error("No current message found");return}(0,g.VK)(t,e),v([...x])}}}}async function L(){if(!y||!f)return;let e={q:y,conversation_id:parseInt(f),stream:!0,...O&&{region:O.region,country:O.country,city:O.city,timezone:O.timezone},...S&&{image:S}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await k(t)}catch(e){console.error(e)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{a(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,d.EK)(),N(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{if(y&&!f){fetch("/api/chat/share/fork?public_conversation_slug=".concat(M),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{p(e.conversation_id)}).catch(e=>{console.error(e)});return}if(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||"",uploadedImageData:decodeURIComponent(S)};v(t=>[...t,e]),b(!0)}},[y,f,M]),(0,i.useEffect)(()=>{j&&L()},[j]),s)?(0,n.jsx)(l.Z,{}):M?(0,n.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,n.jsx)("title",{children:c}),(0,n.jsx)("div",{className:o().sidePanel,children:(0,n.jsx)(r.Z,{conversationId:null!=f?f:null,uploadedFiles:C,isMobileWidth:B})}),(0,n.jsx)("div",{className:o().chatBox,children:(0,n.jsx)("div",{className:o().chatBoxBody,children:(0,n.jsx)(i.Suspense,{fallback:(0,n.jsx)(l.Z,{}),children:(0,n.jsx)(m,{conversationId:f,streamedMessages:x,setQueryToProcess:_,isLoggedIn:null!==T,publicConversationSlug:M,chatOptionsData:e,setTitle:h,setUploadedFiles:I,isMobileWidth:B,setImage64:w})})})})]}):(0,n.jsx)("div",{className:o().suggestions,children:"Whoops, nothing to see here!"})}},15238:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",chatLayout:"chatHistory_chatLayout__ABli_",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},11930:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[7849,647,929,3954,9001,3062,743,121,7071,1906,9984,1603,9417,9178,8423,2971,7023,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
div.page_main__nw1Wk{height:100dvh;color:hsla(var(--foreground))}div.page_suggestions__Y8EqU{overflow-x:none;height:-moz-fit-content;height:fit-content;padding:10px;white-space:nowrap;gap:1rem}div.page_inputBox__LrcZ4{border:1px solid var(--border-color);margin-bottom:20px;align-content:center}input.page_inputBox__LrcZ4{border:none}input.page_inputBox__LrcZ4:focus{outline:none;background-color:transparent}div.page_inputBox__LrcZ4:focus{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}div.page_chatBodyFull__Qu2T2{display:grid;grid-template-columns:1fr;height:100%}button.page_inputBox__LrcZ4{border:none;outline:none;background-color:transparent;cursor:pointer;border-radius:.5rem;padding:.5rem;background:linear-gradient(var(--calm-green),var(--calm-blue))}div.page_chatBody__IirQQ{display:grid;grid-template-columns:1fr 1fr;height:100%}.page_inputBox__LrcZ4{color:hsla(var(--foreground))}div.page_chatLayout__bJUjP{display:grid;grid-template-columns:1fr;gap:1rem}div.page_chatBox__gsR6V{display:grid}div.page_titleBar__3btUI{display:grid;grid-template-columns:1fr auto}div.page_chatBoxBody__xORKr,div.page_homeGreetings__VjQhh{display:grid;height:100%;margin:auto}div.page_homeGreetings__VjQhh{grid-template-rows:1fr 2fr}div.page_sidePanel__mxpxa{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.page_inputBox__LrcZ4{margin-bottom:0}div.page_chatBody__IirQQ{grid-template-columns:0fr 1fr}div.page_chatBoxBody__xORKr{width:100%;grid-template-rows:auto}div.page_sidePanel__mxpxa{position:relative}div.page_chatBox__gsR6V{padding:0;height:100%}div.page_chatLayout__bJUjP{gap:0;grid-template-columns:1fr}div.page_chatLayout__bJUjP,div.page_homeGreetings__VjQhh{grid-template-rows:auto 1fr}}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2) format("woff2"),url(/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff) format("woff"),url(/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Bold.d181c465.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff) format("woff"),url(/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Italic.8916142b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Italic.9024d815.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff) format("woff"),url(/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-Italic.5295ba48.woff) format("woff"),url(/_next/static/media/KaTeX_Math-Italic.939bc644.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2) format("woff2"),url(/_next/static/media/KaTeX_Script-Regular.07505710.woff) format("woff"),url(/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff) format("woff"),url(/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size2-Regular.57727022.woff) format("woff"),url(/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff) format("woff"),url(/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff) format("woff"),url(/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2) format("woff2"),url(/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff) format("woff"),url(/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.11"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.suggestions_card__fbiZo{padding:.5rem;margin:.05rem;border-radius:.5rem}.suggestions_title__vNozc{font-size:1rem}.suggestions_text__J_IfY{padding-top:.2rem;font-size:.9rem;white-space:wrap;padding-right:4px;color:#000}select.modelPicker_modelPicker__chlCh{font-size:small;padding:.5rem .75rem;border:1px;display:flex;align-items:center;height:2.5rem;justify-content:space-between;border-radius:calc(.5rem - 2px)}select.modelPicker_modelPicker__chlCh:after{grid-area:select;justify-self:end}div.modelPicker_modelPicker__chlCh{margin-top:8px}
|