(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3317],{7169:function(e,t,s){Promise.resolve().then(s.t.bind(s,8173,23)),Promise.resolve().then(s.t.bind(s,231,23)),Promise.resolve().then(s.bind(s,7963)),Promise.resolve().then(s.bind(s,9785))},7963:function(e,t,s){"use strict";var a=s(7437),n=s(2513);s(2265);var i=s(9733),r=s(9736),o=s(7489);t.default=e=>{let{iconOnSmallScreen:t=!1}=e,s=async()=>{await (0,o.Ip)(),window.location.href="/chat"};return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:t?"hidden sm:block":"",children:(0,a.jsxs)(i.z,{onClick:s,size:"sm",children:[(0,a.jsx)(n.Z,{className:"mr-2 h-4 w-4"})," ",(0,a.jsx)("span",{children:"Start new chat"}),(0,a.jsx)("span",{className:"sr-only",children:"Start new chat"})]})}),(0,a.jsx)("div",{className:t?"sm:hidden":"hidden",children:(0,a.jsxs)(r.u,{children:[(0,a.jsx)(r.aJ,{asChild:!0,children:(0,a.jsxs)(i.z,{onClick:s,size:"icon",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Start new chat"})]})}),(0,a.jsx)(r._v,{side:"top",children:"Start new chat"})]})})]})}},9785:function(e,t,s){"use strict";s.d(t,{default:function(){return v}});var a=s(7437),n=s(560),i=s(6884),r=s(2265),o=s(9733),d=s(9736),l=s(1485),c=s(9354);let h=l.fC,u=l.xz,f=r.forwardRef((e,t)=>{let{className:s,align:n="center",sideOffset:i=4,...r}=e;return(0,a.jsx)(l.h_,{children:(0,a.jsx)(l.VY,{ref:t,align:n,sideOffset:i,className:(0,c.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})})});f.displayName=l.VY.displayName;let m=r.forwardRef((e,t)=>{let{className:s,type:n,...i}=e;return(0,a.jsx)("input",{type:n,className:(0,c.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...i})});m.displayName="Input";var p=s(7489);s(7374);var x=s(7776),v=e=>{let{iconOnSmallScreen:t=!0}=e,[s,c]=(0,r.useState)(""),v=async e=>{try{await navigator.clipboard.writeText(e),x.Am.success("Copied link to clipboard")}catch(e){console.error("Failed to copy: ",e)}};async function j(){var e,t,s,a,n;let i="",r=null===(t=window)||void 0===t?void 0:null===(e=t.location)||void 0===e?void 0:e.href;if(r.endsWith("/chat")){let e=await (0,p.Rq)();i="".concat(new URL(null!==(n=null===(a=window)||void 0===a?void 0:null===(s=a.location)||void 0===s?void 0:s.href)&&void 0!==n?n:"https://thewarrenai.com").origin,"/chat/").concat(e)}else i=r;c(i)}return(0,a.jsxs)(h,{onOpenChange:e=>e?j():null,children:[(0,a.jsx)(u,{asChild:!0,children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:t?"hidden sm:block":"",children:(0,a.jsxs)(o.z,{size:"sm",variant:"secondary",children:[(0,a.jsx)(n.Z,{className:"mr-2 h-4 w-4"})," ",(0,a.jsx)("span",{children:"Share chat"}),(0,a.jsx)("span",{className:"sr-only",children:"Share chat"})]})}),(0,a.jsx)("div",{className:t?"sm:hidden":"hidden",children:(0,a.jsxs)(d.u,{children:[(0,a.jsx)(d.aJ,{asChild:!0,children:(0,a.jsxs)(o.z,{size:"icon",variant:"secondary",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Share chat"})]})}),(0,a.jsx)(d._v,{side:"top",children:"Share chat"})]})})]})}),(0,a.jsx)(f,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 pl-1 pr-1 pb-2",children:[(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("div",{className:"text-md font-semibold mb-1",children:"Share Chat"}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground",children:"Click on the copy button below to share this chat with others."})]}),(0,a.jsx)(m,{className:"focus-visible:ring-0 focus-visible:ring-transparent",readOnly:!0,type:"url",placeholder:"URL",value:s}),(0,a.jsx)(l.xp,{asChild:!0,children:(0,a.jsxs)(o.z,{className:"h-9",variant:"secondary",autoFocus:!0,onClick:()=>v(s),children:[(0,a.jsx)("span",{children:(0,a.jsx)(i.Z,{className:"w-4 h-4 mr-2"})}),"Copy Link"]})})]})})]})}},9736:function(e,t,s){"use strict";s.d(t,{TooltipProvider:function(){return o},_v:function(){return c},aJ:function(){return l},u:function(){return d}});var a=s(7437),n=s(2265),i=s(7071),r=s(9354);let o=i.zt,d=i.fC,l=i.xz,c=n.forwardRef((e,t)=>{let{className:s,sideOffset:n=4,...o}=e;return(0,a.jsx)(i.VY,{ref:t,sideOffset:n,className:(0,r.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...o})});c.displayName=i.VY.displayName},7489:function(e,t,s){"use strict";s.d(t,{Ip:function(){return r},Rq:function(){return n},eH:function(){return i}});var a=s(920);async function n(){return await localStorage.getItem("chatId")||""}async function i(){let e=(0,a.Z)();return await localStorage.setItem("chatId",e),e}async function r(){await localStorage.removeItem("chatId")}}},function(e){e.O(0,[8173,952,1979,231,7071,7776,3736,9904,2971,7023,1744],function(){return e(e.s=7169)}),_N_E=e.O()}]);