"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3572],{4093:(e,t,s)=>{s.r(t),s.d(t,{DropdownButton:()=>h,DropdownChevron:()=>m,DropdownMenu:()=>u,DropdownMenuItem:()=>x,DropdownSubMenu:()=>g,useDropdownMenuClose:()=>p});var n=s(54568),a=s(86424),r=s(7620),i=s(98743),o=s(6878),l=s(5047),c=s(54217);let d=(0,r.createContext)({open:!1,setOpen:()=>{}});function u(e){let{button:t,children:s,className:a,openOnHover:l=!1,side:c="bottom",align:u="start"}=e,[m,h]=(0,r.useState)(!1),[x,g]=(0,r.useState)(!1),p=l?x||m:x;return(0,n.jsx)(d.Provider,{value:{open:p,setOpen:g},children:(0,n.jsxs)(o.bL,{modal:!1,open:p,onOpenChange:g,children:[(0,n.jsx)(o.l9,{asChild:!0,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onClick:()=>l?g(!x):null,className:"group/dropdown",children:t}),(0,n.jsx)(o.ZL,{children:(0,n.jsx)(o.UC,{"data-testid":"dropdown-menu",hideWhenDetached:!0,collisionPadding:8,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),align:u,side:c,className:"z-40 animate-scaleIn border-tint pt-2",children:(0,n.jsx)("div",{className:(0,i.P)("flex max-h-80 min-w-40 max-w-[40vw] flex-col gap-1 overflow-auto circular-corners:rounded-xl rounded-md straight-corners:rounded-none border border-tint bg-tint-base p-2 shadow-lg sm:min-w-52 sm:max-w-80",a),children:s})})})]})})}function m(){return(0,n.jsx)(a.In,{icon:"chevron-down",className:(0,i.P)("shrink-0","opacity-6","size-3","ms-1","transition-all","group-hover/dropdown:opacity-11","group-data-[state=open]/dropdown:opacity-11","group-data-[state=open]/dropdown:rotate-180")})}function h(e){let{children:t,className:s}=e;return(0,n.jsxs)("div",{className:(0,i.P)("group/dropdown","flex","items-center",s),children:[t,(0,n.jsx)(m,{})]})}function x(e){let{children:t,active:s=!1,href:a,className:r,insights:l,target:d,...u}=e,m=(0,i.P)("rounded straight-corners:rounded-sm circular-corners:rounded-lg px-3 py-1 text-sm flex gap-2 items-center",s?"bg-primary text-primary-strong data-[highlighted]:bg-primary-hover":"data-[highlighted]:bg-tint-hover","focus:outline-none",e.disabled?"opacity-7 cursor-not-allowed":"cursor-pointer",r);return a?(0,n.jsx)(o.q7,{...u,asChild:!0,children:(0,n.jsx)(c.N_,{href:a,insights:l,className:m,target:d,children:t})}):(0,n.jsx)(o.q7,{...u,className:(0,i.P)("px-3 py-1",m,r),children:t})}function g(e){let{children:t,label:s}=e;return(0,n.jsxs)(o.Pb,{children:[(0,n.jsxs)(o.ZP,{className:"flex cursor-pointer items-center justify-between rounded straight-corners:rounded-sm px-3 py-1 text-sm focus:outline-none data-[highlighted]:bg-tint-hover",children:[s,(0,n.jsx)(a.In,{icon:"chevron-right",className:"size-3 shrink-0 opacity-6"})]}),(0,n.jsx)(o.ZL,{children:(0,n.jsx)(o.G5,{hideWhenDetached:!0,collisionPadding:8,className:"z-40 animate-present",children:(0,n.jsx)("div",{className:"flex max-h-80 min-w-40 max-w-[40vw] flex-col gap-1 overflow-auto rounded-lg straight-corners:rounded-sm bg-tint-base p-2 shadow-lg ring-1 ring-tint-subtle sm:min-w-52 sm:max-w-80",children:t})})})]})}function p(){let e=(0,r.useContext)(d);return(0,l.assert)(e,"DropdownMenuContext not found"),(0,r.useCallback)(()=>e.setOpen(!1),[e])}},4788:(e,t,s)=>{s.d(t,{K:()=>o,SpaceLayoutContextProvider:()=>i});var n=s(54568),a=s(7620);let r=a.createContext({basePath:""});function i(e){let{basePath:t,children:s}=e,i=a.useMemo(()=>({basePath:t}),[t]);return(0,n.jsx)(r.Provider,{value:i,children:s})}function o(){let e=a.useContext(r);if(!e)throw Error("SpaceLayoutContext not found");return e.basePath}},28463:(e,t,s)=>{s.r(t),s.d(t,{AIResponseFeedback:()=>d});var n=s(54568),a=s(88118),r=s(96021),i=s(98743),o=s(7620),l=s(24578),c=s(54217);function d(e){let{className:t,responseId:s,query:d}=e,u=(0,a.ok)(),[m,h]=(0,o.useState)(null),x=(0,l.jt)(),g=e=>{h(e),x({type:"ask_rate_response",query:d,responseId:s,rating:e})};return(0,n.jsxs)("div",{className:(0,i.P)("flex h-fit items-center",t),children:[(0,n.jsx)(c.$n,{icon:"thumbs-up",iconOnly:!0,label:(0,r.s)(u,"was_this_helpful_positive_label"),variant:"blank",className:(0,i.P)("animate-fadeIn overflow-hidden text-tint-subtle transition-all",null!==m&&1!==m&&"px-0 text-[0] opacity-0"),size:"medium",style:{animationDuration:".5s"},onClick:()=>g(1),disabled:null!==m,active:1===m},"positive"),(0,n.jsx)(c.$n,{icon:"thumbs-down",iconOnly:!0,label:(0,r.s)(u,"was_this_helpful_negative_label"),variant:"blank",className:(0,i.P)("animate-fadeIn overflow-hidden text-tint-subtle transition-all",null!==m&&-1!==m&&"px-0 text-[0] opacity-0"),size:"medium",style:{animationDelay:".2s",animationDuration:".5s"},onClick:()=>g(-1),disabled:null!==m,active:-1===m},"negative"),null!==m?(0,n.jsx)("span",{className:"ml-2 animate-fadeIn text-tint-subtle",style:{animationDelay:".3s",animationDuration:".5s"},children:(0,r.t)(u,"was_this_helpful_thank_you")}):null]})}},30711:(e,t,s)=>{s.r(t),s.d(t,{ThemeToggler:()=>c});var n=s(54568),a=s(86424),r=s(21752),i=s(7620),o=s(88118),l=s(98743);function c(){let e=(0,o.ok)(),[t,s]=i.useState(!1),{theme:a,setTheme:l}=(0,r.D)();i.useEffect(()=>{s(!0)},[]);let c=e=>{l(e)};return(0,n.jsxs)("div",{role:"radiogroup",className:"flex flex-row gap-2",children:[(0,n.jsx)(d,{active:t&&"light"===a,icon:"sun-bright",onClick:()=>c("light"),title:(0,o.si)(e,"switch_to_light_theme")}),(0,n.jsx)(d,{active:t&&"system"===a,icon:"desktop",onClick:()=>c("system"),title:(0,o.si)(e,"switch_to_system_theme")}),(0,n.jsx)(d,{active:t&&"dark"===a,icon:"moon",onClick:()=>c("dark"),title:(0,o.si)(e,"switch_to_dark_theme")})]})}function d(e){let{icon:t,onClick:s,title:r,active:i}=e;return(0,n.jsx)("button",{type:"button",role:"radio",onClick:s,"aria-label":r,title:r,"aria-checked":i,className:(0,l.P)("p-2","rounded","straight-corners:rounded-none","circular-corners:rounded-full","transition-all","text-tint","contrast-more:text-tint-strong","hover:bg-tint-hover","contrast-more:hover:ring-2","contrast-more:focus:ring-2","ring-tint",i&&["bg-primary","theme-muted:bg-primary-hover","[html.sidebar-filled.theme-bold.tint_&]:bg-primary-hover","hover:bg-primary","text-primary-strong","contrast-more:text-primary-strong","contrast-more:ring-1","ring-primary"]),children:(0,n.jsx)(a.In,{icon:t,className:(0,l.P)("size-4")})})}},40195:(e,t,s)=>{s.d(t,{C:()=>m,J:()=>u});var n=s(13368),a=s(5772),r=s(7620),i=s(24578),o=s(25316);let l=(0,o.createServerReference)("40b0b04aee97bdf45ce27373b59b59466abe85b9ee",o.callServer,void 0,o.findSourceMapURL,"streamAIChatResponse");var c=s(62574);let d=n.v(e=>({state:{opened:!1,responseId:null,messages:[],query:null,followUpSuggestions:[],loading:!1,error:!1},setState:t=>e(e=>({state:{...e.state,...t(e.state)}}))}));function u(){return n.P(d,e=>e.state)}function m(){let e=function(){let e=function(){let e=(0,c.aP)();return r.useMemo(()=>({location:e?{spaceId:e.spaceId,pageId:e.pageId}:void 0}),[e])}(),t=r.useRef(e);return r.useEffect(()=>{t.current=e},[e]),t}(),t=n.P(d,e=>e.setState),s=(0,i.jt)();return r.useMemo(()=>({open:()=>t(e=>({...e,opened:!0})),close:()=>t(e=>({...e,opened:!1})),clear:()=>t(e=>({opened:e.opened,loading:!1,messages:[],query:null,followUpSuggestions:[],responseId:null,error:!1})),postMessage:async n=>{s({type:"ask_question",query:n.message}),t(e=>({...e,messages:[...e.messages,{role:a.W7.User,content:n.message},{role:a.W7.Assistant,content:null}],query:n.message,followUpSuggestions:[],loading:!0,error:!1}));try{var r;for await(let s of(await l({message:n.message,messageContext:e.current,previousResponseId:null!=(r=d.getState().state.responseId)?r:void 0}))){if(!s)continue;let e=s.event;switch(e.type){case"response_finish":t(t=>({...t,responseId:e.responseId,loading:!1,error:!1}));break;case"response_followup_suggestion":t(t=>({...t,followUpSuggestions:[...t.followUpSuggestions,...e.suggestions]}))}t(e=>({...e,messages:[...e.messages.slice(0,-1),{role:a.W7.Assistant,content:s.content}]}))}t(e=>({...e,loading:!1,error:!1}))}catch(e){t(e=>({...e,loading:!1,error:!0}))}}}),[e,t,s])}},60101:(e,t,s)=>{s.r(t),s.d(t,{AIChatButton:()=>d});var n=s(54568),a=s(98743),r=s(40195),i=s(54217),o=s(85598),l=s(60426),c=s(73598);function d(e){let{trademark:t}=e,s=(0,r.C)(),d=(0,r.J)();return(0,n.jsx)(i.$n,{icon:(0,n.jsx)(c.y,{trademark:t}),iconOnly:!0,size:"default",variant:"header",className:(0,a.P)("h-9 px-2.5"),label:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.getAIChatName)(t),(0,n.jsx)(o.S,{keys:["mod","j"],className:"border-tint-11 text-tint-1"})]}),onClick:()=>{d.opened?s.close():s.open()}})}},60426:(e,t,s)=>{s.r(t),s.d(t,{AIChat:()=>w,AIChatWindow:()=>y,getAIChatName:()=>k});var n=s(54568),a=s(88118),r=s(86424),i=s(7620),o=s(58541),l=s(40195),c=s(62574),d=s(54217),u=s(4093),m=s(73598),h=s(98743),x=s(85598),g=s(5384);function p(e){let{value:t,onChange:s,onSubmit:l,disabled:c,loading:u}=e,m=(0,a.ok)(),p=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!c&&!u){let e=setTimeout(()=>{var e;null==(e=p.current)||e.focus()},50);return()=>clearTimeout(e)}},[c,u]),(0,o.vC)("mod+j",e=>{var t;e.preventDefault(),null==(t=p.current)||t.focus()},[]),(0,n.jsxs)("div",{className:"relative flex flex-col overflow-hidden circular-corners:rounded-2xl rounded-corners:rounded-md bg-tint-base/9 ring-1 ring-tint-subtle backdrop-blur-lg transition-all depth-subtle:has-[textarea:focus]:shadow-lg has-[textarea:focus]:ring-2 has-[textarea:focus]:ring-primary-hover contrast-more:bg-tint-base",children:[(0,n.jsx)("textarea",{ref:p,disabled:c||u,"data-loading":u,className:(0,h.P)("resize-none","focus:outline-none","focus:ring-0","w-full","px-3","py-3","pb-12","h-auto","bg-transparent","peer","max-h-64","placeholder:text-tint/8","transition-colors","disabled:bg-tint-subtle","delay-300","disabled:delay-0","disabled:cursor-not-allowed","data-[loading=true]:cursor-progress","data-[loading=true]:opacity-50"),value:t,rows:1,placeholder:(0,a.si)(m,"ai_chat_input_placeholder"),onChange:e=>{let t=e.currentTarget;s(t.value),t.style.height="auto",t.style.height="".concat(t.scrollHeight,"px")},onKeyDown:e=>{if("Escape"===e.key){e.preventDefault(),e.currentTarget.blur();return}"Enter"===e.key&&!e.shiftKey&&t.trim()&&(e.preventDefault(),e.currentTarget.style.height="auto",l(t))}}),(0,n.jsx)("div",{className:"absolute top-2.5 right-3 animate-[fadeIn_0.2s_0.5s_ease-in-out_both] peer-focus:hidden",children:(0,n.jsx)(x.S,{keys:["mod","j"]})}),(0,n.jsxs)("div",{className:"absolute inset-x-0 bottom-0 flex items-center px-2 py-2",children:[(0,n.jsx)(g.m,{label:(0,n.jsxs)("div",{className:"flex flex-col gap-3 p-2",children:[(0,n.jsx)("p",{children:(0,a.t)(m,"ai_chat_context_description")}),(0,n.jsxs)("ul",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)(r.In,{icon:"memo",className:"size-3.5 opacity-7"}),(0,a.t)(m,"ai_chat_context_pages_youve_read")]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)(r.In,{icon:"user",className:"size-3.5 opacity-7"}),(0,a.t)(m,"ai_chat_context_info_provided_by_the_site")]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)(r.In,{icon:"message-question",className:"size-3.5 opacity-7"}),(0,a.t)(m,"ai_chat_context_previous_messages")]})]}),(0,n.jsx)("p",{children:(0,a.t)(m,"ai_chat_context_disclaimer")})]}),arrow:!0,children:(0,n.jsxs)("div",{className:"flex cursor-help items-center gap-1 circular-corners:rounded-2xl rounded-corners:rounded-md px-2 py-1 text-tint/7 text-xs transition-all hover:bg-tint",children:[(0,n.jsx)("span",{className:"-ml-1 rounded-corners:rounded circular-corners:rounded-2xl bg-tint-11/7 px-1 py-0.5 font-mono font-semibold text-[0.65rem] text-contrast-tint-11 leading-none",children:(0,a.t)(m,"ai_chat_context_badge")})," ",(0,n.jsx)("span",{children:(0,a.t)(m,"ai_chat_context_title")})]})}),(0,n.jsx)(d.$n,{label:(0,a.si)(m,"send"),size:"medium",className:"ml-auto",disabled:c||!t.trim(),onClick:()=>l(t)})]})]})}var f=s(5772),_=s(28463);function b(e){let{chat:t,chatController:s}=e;return 0===t.followUpSuggestions.length?null:(0,n.jsx)("div",{className:"mt-auto flex flex-row flex-wrap justify-end gap-2",children:t.followUpSuggestions.map((e,t)=>(0,n.jsx)(d.$n,{onClick:()=>{s.postMessage({message:e})},label:e,className:"max-w-[80%] animate-[present_500ms_both] whitespace-normal text-left ring-1 ring-tint-subtle",size:"medium",variant:"blank",style:{animationDelay:"".concat(250+Math.min(50*t,150),"ms")}},t))})}function v(e){let{chat:t,chatController:s,lastUserMessageRef:a}=e;return(0,n.jsx)(n.Fragment,{children:t.messages.map((e,r)=>{let i=r===t.messages.length-1,o=e.role===f.W7.User&&r===t.messages.map(e=>e.role).lastIndexOf(f.W7.User);return(0,n.jsxs)("div",{ref:o?a:void 0,className:(0,h.P)(e.content?"animate-[fadeIn_500ms_both]":"","shrink-0","last:min-h-[calc(100%-5rem)]","scroll-mt-36","lg:scroll-mt-0","flex flex-col gap-6","group/message",e.role===f.W7.User?"max-w-[80%] self-end circular-corners:rounded-2xl rounded-corners:rounded-md bg-tint px-4 py-2":"text-tint-strong"),style:{animationDelay:"".concat(Math.min(.05*r,.5),"s")},children:[e.content?e.content:null,i&&t.loading?(0,n.jsx)("div",{className:"flex w-full animate-[fadeIn_500ms_both] flex-wrap gap-2 group-has-[.has-content]/message:hidden",children:Array.from({length:7}).map((e,t)=>(0,n.jsx)("div",{className:"h-4 animate-[fadeIn_0.5s_ease_both,pulse_1.5s_infinite] rounded-md bg-tint-4",style:{width:"calc(".concat(t%4*20+10,"% - 4px)"),animationDelay:"".concat(.1*t,"s")}},t))}):null,i?(0,n.jsxs)(n.Fragment,{children:[!t.loading&&!t.error&&t.query&&t.responseId&&(0,n.jsx)(_.AIResponseFeedback,{responseId:t.responseId,query:t.query,className:"-ml-1 -mt-4"}),(0,n.jsx)(b,{chat:t,chatController:s})]}):null]},r)})})}function j(e){let{chatController:t}=e,s=(0,a.ok)(),r=[(0,a.si)(s,"ai_chat_suggested_questions_about_this_page"),(0,a.si)(s,"ai_chat_suggested_questions_read_next"),(0,a.si)(s,"ai_chat_suggested_questions_example")];return(0,n.jsx)("div",{className:"flex flex-col items-center gap-2",children:r.map((e,s)=>(0,n.jsx)(d.$n,{label:e,variant:"secondary",size:"medium",className:"max-w-full animate-[present_500ms_both] whitespace-normal",style:{animationDelay:"".concat(800+100*s,"ms")},onClick:()=>t.postMessage({message:e}),children:e},e))})}function w(e){let{trademark:t}=e,s=(0,l.J)(),a=(0,l.C)();return((0,o.vC)("mod+j",e=>{e.preventDefault(),a.open()},[]),(0,o.vC)("esc",()=>{a.close()},[]),s.opened)?(0,n.jsx)(y,{trademark:t,chatController:a,chat:s}):null}function y(e){let{chatController:t,chat:s,trademark:o}=e,[l,h]=i.useState(""),x=i.useRef(null),g=i.useRef(null),f=i.useRef(null),_=i.useRef(null),[b,w]=i.useState(0),y=(0,a.ok)(),N=(0,c.cB)(36e5),I=!s.messages.length,L=i.useMemo(()=>{let e=new Date(N).getHours();return e<6?(0,a.si)(y,"ai_chat_assistant_greeting_night"):e<12?(0,a.si)(y,"ai_chat_assistant_greeting_morning"):e<18?(0,a.si)(y,"ai_chat_assistant_greeting_afternoon"):(0,a.si)(y,"ai_chat_assistant_greeting_evening")},[N,y]);return i.useEffect(()=>{s.messages.length>0&&f.current&&f.current.scrollIntoView({behavior:"smooth",block:"start"})},[s.messages.length]),i.useEffect(()=>{var e;null==(e=x.current)||e.scrollIntoView({behavior:"smooth",block:"start"});let t=new ResizeObserver(e=>{e.forEach(e=>{w(e.contentRect.height+32)})});return _.current&&t.observe(_.current),()=>t.disconnect()},[s.opened]),(0,n.jsx)("div",{className:"ai-chat inset-y-0 right-0 z-40 mx-auto flex max-w-3xl animate-present scroll-mt-36 px-4 py-4 transition-all duration-300 sm:px-6 lg:fixed lg:w-80 lg:animate-enterFromRight lg:pr-4 lg:pl-0 xl:w-96",ref:x,children:(0,n.jsxs)("div",{className:"relative flex h-full grow flex-col overflow-hidden circular-corners:rounded-3xl rounded-corners:rounded-md bg-tint-base text-sm text-tint depth-subtle:shadow-lg shadow-tint ring-1 ring-tint-subtle",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-tint-subtle border-b bg-tint-subtle px-4 py-2 text-tint-strong",children:[(0,n.jsx)(m.y,{className:"size-5 text-tint",trademark:o,state:s.error?"error":s.loading?s.messages[s.messages.length-1].content?"working":"thinking":s.messages.length>0?"done":"default"}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("div",{className:"font-bold",children:k(o)}),(0,n.jsx)("div",{className:"text-tint text-xs leading-none transition-all duration-500 ".concat(s.loading?"h-3 opacity-11":"h-0 opacity-0"),children:s.loading?s.messages[s.messages.length-1].content?(0,a.t)(y,"ai_chat_working"):(0,a.t)(y,"ai_chat_thinking"):""})]}),(0,n.jsxs)("div",{className:"ml-auto flex gap-2",children:[(0,n.jsx)(u.DropdownMenu,{button:(0,n.jsx)(d.$n,{onClick:()=>{},iconOnly:!0,icon:"ellipsis",label:(0,a.si)(y,"more"),className:"!px-2",variant:"blank",size:"default"}),children:(0,n.jsxs)(u.DropdownMenuItem,{onClick:()=>{t.clear()},disabled:I,children:[(0,n.jsx)(r.In,{icon:"broom-wide",className:"size-3 text-tint-subtle"}),(0,a.t)(y,"ai_chat_clear_conversation")]})}),(0,n.jsx)(d.$n,{onClick:()=>t.close(),iconOnly:!0,icon:"close",label:(0,a.si)(y,"close"),className:"!px-2",variant:"blank",size:"default"})]})]}),(0,n.jsx)("div",{ref:g,className:"flex grow scroll-pt-4 flex-col gap-4 overflow-y-auto p-4",style:{paddingBottom:"".concat(b,"px")},children:I?(0,n.jsxs)("div",{className:"flex min-h-full w-full shrink-0 flex-col items-center justify-center gap-6 py-4",children:[(0,n.jsx)("div",{className:"flex size-32 animate-[fadeIn_500ms_both] items-center justify-center rounded-full bg-tint-subtle",children:(0,n.jsx)(m.y,{state:"intro",trademark:o,className:"size-16 animate-[present_500ms_200ms_both]"})}),(0,n.jsxs)("div",{className:"animate-[fadeIn_500ms_400ms_both]",children:[(0,n.jsx)("h5",{className:" text-center font-bold text-lg text-tint-strong",children:L}),(0,n.jsx)("p",{className:"text-center text-tint",children:(0,a.t)(y,"ai_chat_assistant_description")})]}),s.error?null:(0,n.jsx)(j,{chatController:t})]}):(0,n.jsx)(v,{chat:s,chatController:t,lastUserMessageRef:f})}),(0,n.jsxs)("div",{ref:_,className:"absolute inset-x-0 bottom-0 mr-2 flex flex-col gap-4 bg-gradient-to-b from-transparent to-50% to-tint-base/9 p-4 pr-2",children:[s.error?(0,n.jsx)(C,{chatController:t}):null,(0,n.jsx)(p,{value:l,onChange:h,loading:s.loading,disabled:s.loading||s.error,onSubmit:()=>{t.postMessage({message:l}),h("")}})]})]})})}function C(e){let t=(0,a.ok)(),{chatController:s}=e;return(0,n.jsxs)("div",{className:"flex animate-scaleIn flex-wrap justify-between gap-2 circular-corners:rounded-2xl rounded-corners:rounded-md bg-danger px-3 py-2 text-danger text-sm ring-1 ring-danger",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(r.In,{icon:"exclamation-triangle",className:"size-3.5"}),(0,n.jsx)("span",{className:"flex items-center gap-1",children:(0,a.t)(t,"ai_chat_error")})]}),(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)(d.$n,{variant:"blank",size:"small",icon:"refresh",label:(0,a.si)(t,"unexpected_error_retry"),onClick:()=>{s.clear()},className:"!text-danger hover:bg-danger-5"})})]})}function k(e){let t=(0,a.ok)();return e?(0,a.si)(t,"ai_chat_assistant_name"):(0,a.si)(t,"ai_chat_assistant_name_unbranded")}},73598:(e,t,s)=>{s.d(t,{y:()=>i});var n=s(54568),a=s(98743),r=s(86424);let i=e=>{let{className:t="size-4",size:s,trademark:i=!0,state:o="default",...l}=e;return i?(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",preserveAspectRatio:"xMaxYMid meet",className:t,"aria-busy":"thinking"===o,...l,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("title",{children:"GitBook Assistant"}),(0,n.jsx)("path",{d:"M12.8916 1.06265C12.921 0.979101 13.0392 0.979127 13.0685 1.06267C13.239 1.5478 13.3439 1.84646 13.516 2.1032C13.6683 2.33042 13.8578 2.53033 14.0766 2.6945C14.3239 2.88 14.6165 3.00068 15.0919 3.19671C15.1761 3.23142 15.1761 3.3506 15.0919 3.38531C14.6165 3.58134 14.3239 3.70203 14.0766 3.88752C13.8578 4.05169 13.6683 4.2516 13.516 4.47882C13.3439 4.73556 13.239 5.03423 13.0685 5.51937C13.0392 5.60291 12.921 5.60292 12.8916 5.51938C12.7212 5.03423 12.6162 4.73557 12.4442 4.47882C12.2919 4.2516 12.1023 4.05169 11.8835 3.88752C11.6363 3.70202 11.3436 3.58134 10.8682 3.38531C10.7841 3.3506 10.7841 3.23141 10.8683 3.1967C11.3436 3.00067 11.6363 2.87999 11.8835 2.6945C12.1023 2.53033 12.2919 2.33042 12.4442 2.1032C12.6162 1.84646 12.7212 1.54779 12.8916 1.06265Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round",className:(0,a.P)("intro"===o&&"animate-[fadeIn_.5s_.7s_both,spin_2s_1s_forwards_cubic-bezier(.43,1.54,.64,1)]",("working"===o||"thinking"===o)&&"animate-[fadeIn_.5s_.3s_both,spin_2s_1s_infinite_forwards_cubic-bezier(0.16,1,0.3,1)]","done"===o&&"animate-[fadeOut_.5s_both]","default"===o&&"animate-[fadeIn_0s_both]","error"===o&&"hidden"),style:{transformOrigin:"13px 3.5px"}}),(0,n.jsxs)("g",{clipPath:"url(#clip0_153_2034)",className:(0,a.P)("text-danger-subtle","error"===o?"animate-[fadeIn_.5s_.3s_both]":"hidden"),children:[(0,n.jsx)("path",{d:"M13.0312 1.42059L13.0312 3.95184",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M13.0312 6.00253V6.00263",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),(0,n.jsx)("path",{d:"M10.8051 3.71161L12.2401 5.27411L14.823 2.14911",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:(0,a.P)("done"===o?"animate-[fadeIn_.5s_.3s_both]":"animate-[fadeOut_.5s_both]","intro"===o&&"hidden")}),(0,n.jsx)("path",{d:"M3.5625 8.78512L7.26347 10.9219C7.88227 11.2791 8.64467 11.2791 9.26347 10.9219L14.25 8.0429C14.5833 7.85045 15 8.09101 15 8.47591V10.2777C15 10.4563 14.9047 10.6214 14.75 10.7107L9.26347 13.8784C8.64467 14.2356 7.88228 14.2356 7.26347 13.8784L3.5625 11.7416C2.70833 11.2978 1 9.93199 1 8.01949M1 8.01949C1 6.6448 1.84765 5.98698 2.62903 5.71701C3.15426 5.53555 3.71577 5.70568 4.19701 5.98353L7.26347 7.75395C7.88228 8.11122 8.64467 8.11122 9.26347 7.75395L10.9095 6.80362M1 8.01949C1 6.4945 2.03973 5.30731 2.5596 4.90434L7.37937 2.12165C7.79013 1.88449 8.26417 1.80476 8.71747 1.88245",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:(0,a.P)("intro"===o&&"animate-[fadeIn_2s_forwards]")}),(0,n.jsx)("mask",{id:"mask0_220_25",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"1",width:"16",height:"14",children:(0,n.jsx)("path",{d:"M3.5625 8.78512L7.26347 10.9219C7.88227 11.2791 8.64467 11.2791 9.26347 10.9219L14.25 8.0429C14.5833 7.85045 15 8.09101 15 8.47591V10.2777C15 10.4563 14.9047 10.6214 14.75 10.7107L9.26347 13.8784C8.64467 14.2356 7.88228 14.2356 7.26347 13.8784L3.5625 11.7416C2.70833 11.2978 1 9.93199 1 8.01949M1 8.01949C1 6.6448 1.84765 5.98698 2.62903 5.71701C3.15426 5.53555 3.71577 5.70568 4.19701 5.98353L7.26347 7.75395C7.88228 8.11122 8.64467 8.11122 9.26347 7.75395L10.9095 6.80362M1 8.01949C1 6.4945 2.03973 5.30731 2.5596 4.90434L7.37937 2.12165C7.79013 1.88449 8.26417 1.80476 8.71747 1.88245",stroke:"currentColor",pathLength:"100",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("g",{mask:"url(#mask0_220_25)",children:(0,n.jsx)("path",{d:"M3.5625 8.78512L7.26347 10.9219C7.88227 11.2791 8.64467 11.2791 9.26347 10.9219L14.25 8.0429C14.5833 7.85045 15 8.09101 15 8.47591V10.2777C15 10.4563 14.9047 10.6214 14.75 10.7107L9.26347 13.8784C8.64467 14.2356 7.88228 14.2356 7.26347 13.8784L3.5625 11.7416C2.70833 11.2978 1 9.93199 1 8.01949C1 6.6448 1.84765 5.98698 2.62903 5.71701C3.15426 5.53555 3.71577 5.70568 4.19701 5.98353L7.26347 7.75395C7.88228 8.11122 8.64467 8.11122 9.26347 7.75395L14.1991 4.90434L9.37937 2.12165C8.76057 1.76438 7.99907 1.76386 7.38027 2.12113C5.89314 2.97972 3.20298 4.53289 2.5596 4.90434C1.77376 5.35804 1 6.11597 1.00148 7.9207",stroke:"currentColor",pathLength:"100",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:(0,a.P)(("thinking"===o||"working"===o)&&"animate-[pathLoading_2s_infinite_both]","intro"===o&&"animate-[pathEnter_2s_both]","done"===o&&"animate-[pathEnter_1s_forwards_ease]")})})]}):(0,n.jsx)(r.In,{icon:"sparkle",className:(0,a.P)(t,("thinking"===o||"working"===o)&&"animate-[spin_2s_infinite_forwards_cubic-bezier(0.16,1,0.3,1)]","intro"===o&&"animate-[spin_2s_forwards_cubic-bezier(0.16,1,0.3,1)]")})}},85598:(e,t,s)=>{s.d(t,{S:()=>i});var n=s(54568),a=s(98743),r=s(7620);function i(e){let{keys:t,className:s}=e,[i,o]=r.useState(null);return r.useEffect(()=>{o(function(){let e=navigator.platform.toLowerCase();return e.includes("mac")?"mac":(e.includes("win"),"win")}())},[]),(0,n.jsx)("div",{"aria-busy":null===i?"true":void 0,className:(0,a.P)('shortcut -mr-1 hidden justify-end gap-0.5 whitespace-nowrap text-tint text-xs [font-feature-settings:"calt",_"case"] contrast-more:text-tint-strong md:flex',i?"motion-safe:animate-fadeIn motion-reduce:opacity-100":"opacity-0"),children:t.map(e=>(0,n.jsx)("kbd",{className:(0,a.P)("flex h-5 min-w-5 items-center justify-center rounded-md border border-tint-subtle px-1","mod"===e?"mac"===i?"text-sm":"text-xs":"uppercase",s),children:"mod"===e?"mac"===i?"⌘":"Ctrl":e},e))})}},99507:(e,t,s)=>{s.d(t,{YZ:()=>n.getAIChatName,ph:()=>r.AIResponseFeedback,yQ:()=>a.y});var n=s(60426);s(60101);var a=s(73598),r=s(28463)}}]);