@ytsaurus/ui 3.3.1 → 3.4.0
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.
- package/dist/public/build/assets-manifest.json +20 -20
- package/dist/public/build/js/2563.bbb74274.chunk.js +2 -0
- package/dist/public/build/js/2563.bbb74274.chunk.js.map +1 -0
- package/dist/public/build/js/4237.57c56e6b.chunk.js +3 -0
- package/dist/public/build/js/4237.57c56e6b.chunk.js.map +1 -0
- package/dist/public/build/js/{app-navigation-page-layout.27364587.chunk.js → app-navigation-page-layout.afb1c1ba.chunk.js} +2 -2
- package/dist/public/build/js/app-navigation-page-layout.afb1c1ba.chunk.js.map +1 -0
- package/dist/public/build/js/{app-navigation.b86557c0.chunk.js → app-navigation.38835895.chunk.js} +2 -2
- package/dist/public/build/js/{app-navigation.b86557c0.chunk.js.map → app-navigation.38835895.chunk.js.map} +1 -1
- package/dist/public/build/js/{code-assistant-chat.4275144c.chunk.js → code-assistant-chat.a7927638.chunk.js} +2 -2
- package/dist/public/build/js/{code-assistant-chat.4275144c.chunk.js.map → code-assistant-chat.a7927638.chunk.js.map} +1 -1
- package/dist/public/build/js/main.7226048e.js +3 -0
- package/dist/public/build/js/main.7226048e.js.map +1 -0
- package/dist/public/build/js/{query-tracker.17cb6d4e.chunk.js → query-tracker.1b6d537a.chunk.js} +2 -2
- package/dist/public/build/js/{query-tracker.17cb6d4e.chunk.js.map → query-tracker.1b6d537a.chunk.js.map} +1 -1
- package/dist/public/build/js/{runtime.6000b37f.js → runtime.9aefe6d7.js} +2 -2
- package/dist/public/build/js/{runtime.6000b37f.js.map → runtime.9aefe6d7.js.map} +1 -1
- package/dist/public/build/manifest.json +16 -16
- package/dist/server/controllers/ai-chat.js +2 -1
- package/dist/server/types/ai-chat.d.ts +3 -0
- package/package.json +2 -2
- package/dist/public/build/js/3205.87c8575d.chunk.js +0 -2
- package/dist/public/build/js/3205.87c8575d.chunk.js.map +0 -1
- package/dist/public/build/js/4237.a6d263f6.chunk.js +0 -3
- package/dist/public/build/js/4237.a6d263f6.chunk.js.map +0 -1
- package/dist/public/build/js/app-navigation-page-layout.27364587.chunk.js.map +0 -1
- package/dist/public/build/js/main.39129d1a.js +0 -3
- package/dist/public/build/js/main.39129d1a.js.map +0 -1
- /package/dist/public/build/js/{4237.a6d263f6.chunk.js.LICENSE.txt → 4237.57c56e6b.chunk.js.LICENSE.txt} +0 -0
- /package/dist/public/build/js/{main.39129d1a.js.LICENSE.txt → main.7226048e.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[8398],{2464:(e,t,n)=>{n.d(t,{oz:()=>y,B6:()=>g});var r=n(40319),a=n(53775),o=n(9736),l=n(28407),s=n(77810),i=n(76872),c=n(41169),u=n(48971),d=n(7787),f=(n(49779),n(64922)),p=(0,i.A)("yt-markdown"),m={result:{html:"",headings:[]},logs:{info:[],warn:[],error:[],disabled:[]}};function h(e){return v.apply(this,arguments)}function v(){return(v=(0,l.A)((0,a.A)().mark((function e(t){var n,o,l,s;return(0,a.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.text,o=t.allowHTML,e.prev=1,e.next=4,(0,u.fI)(c.A.post("/api/markdown-to-html",{text:n,allowHTML:o}),{toasterName:"useMarkdown",skipSuccessToast:!0,errorContent:"Failed to transform markdown text"});case 4:return l=e.sent,s=l.data,e.abrupt("return",s);case 9:return e.prev=9,e.t0=e.catch(1),e.abrupt("return",{result:(0,r.A)({},m.result),logs:(0,r.A)((0,r.A)({},m.logs),{},{error:[e.t0.message]})});case 12:case"end":return e.stop()}}),e,null,[[1,9]])})))).apply(this,arguments)}function g(e){var t=e.text,n=e.allowHTML,r=void 0===n||n,i=s.useState(m),c=(0,o.A)(i,2),u=c[0],d=c[1];return s.useEffect((function(){function e(){return(e=(0,l.A)((0,a.A)().mark((function e(){var n;return(0,a.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,h({text:t,allowHTML:r});case 3:n=e.sent,d(n),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,r]),u}function x(e){var t,n=(null!==(t=g({text:e.text,allowHTML:!0}).result)&&void 0!==t?t:{}).html;return(0,f.jsx)(s.Fragment,{children:(0,f.jsx)("div",{className:p(null,"yfm"),dangerouslySetInnerHTML:{__html:null!=n?n:""}})})}var y=(0,s.memo)((function(e){var t=e.text,n=d.Ay.renderMarkdown({text:t});return null!=n?n:(0,f.jsx)(x,{text:t})}))},16538:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 1.75a.75.75 0 0 1 .75.75v4.75h4.75a.75.75 0 0 1 0 1.5H8.75v4.75a.75.75 0 0 1-1.5 0V8.75H2.5a.75.75 0 0 1 0-1.5h4.75V2.5A.75.75 0 0 1 8 1.75",clipRule:"evenodd"})}))}},20239:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.03 10.53a.75.75 0 0 1-1.06 0L8 6.56l-3.97 3.97a.75.75 0 1 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06",clipRule:"evenodd"})}))}},21135:(e,t,n)=>{n.d(t,{P:()=>s});var r=n(77810),a=n(55339),o=n(56201),l=n(64922),s=function(e){var t=e.className,n=e.loading,s=e.onLoadMore,i=(0,r.useRef)(null);return(0,r.useEffect)((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&s()}))}),{root:null,threshold:.1});return i.current&&e.observe(i.current),function(){i.current&&e.unobserve(i.current)}}),[]),(0,l.jsx)(a.s,{className:t,ref:i,alignItems:"center",justifyContent:"center",children:n?(0,l.jsx)(o.a,{}):""})}},23132:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ye});var r=n(9736),a=n(77810),o=n(76872),l=n(1335),s=n(45760),i=n(55339),c=n(94119),u=n(64945),d=n(14371),f=n(40315),p=n(51404),m=n(83205),h=n(51188),v=n(88150),g=n(75299),x=n(59241),y=n(53775),b=n(28407),w=n(27215),j=n(3962),A=n(1435),N=n(63308),C=n(79988),T=n(92611);const k=JSON.parse('{"title_attach-files":"Attach files","context_text-files-only":"You can attach text files in any format (source code, configs, etc.). Maximum size is 0.5 MB","alert_file-too-large":"File is too large. Maximum size is 0.5 MB","alert_binary-data":"File contains binary data","alert_invalid-text-file":"File is not a valid text file"}'),_=JSON.parse('{"title_attach-files":"Прикрепить файлы","context_text-files-only":"Вы можете прикрепить текстовые файлы любого формата (исходный код, конфигурации и т.д.). Максимальный размер 0.5 МБ","alert_file-too-large":"Файл слишком большой. Максимальный размер 0.5 МБ","alert_binary-data":"Файл содержит бинарные данные","alert_invalid-text-file":"Файл не является валидным текстовым файлом"}'),E=(0,T.Kc)("yt:ai.chat.file-popup",{en:k,ru:_});var S=function(){var e=(0,b.A)((0,y.A)().mark((function e(t){var n,r,a,o;return(0,y.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.size>524288)){e.next=2;break}return e.abrupt("return",{isValid:!1,error:E("alert_file-too-large")});case 2:return e.prev=2,e.next=5,t.arrayBuffer();case 5:n=e.sent,r=new Uint8Array(n),a=Math.min(r.length,8192),o=0;case 9:if(!(o<a)){e.next=15;break}if(0!==r[o]){e.next=12;break}return e.abrupt("return",{isValid:!1,error:E("alert_binary-data")});case 12:o++,e.next=9;break;case 15:return new TextDecoder("utf-8",{fatal:!0}).decode(n),e.abrupt("return",{isValid:!0});case 20:return e.prev=20,e.t0=e.catch(2),e.abrupt("return",{isValid:!1,error:E("alert_invalid-text-file")});case 23:case"end":return e.stop()}}),e,null,[[2,20]])})));return function(t){return e.apply(this,arguments)}}(),L=n(79703),I=n(64922),M=(0,o.A)("yt-chat-file-popup"),B=new w.l,R=function(){var e=(0,d.w)(),t=(0,d.d)(p._o),n=function(){var t=(0,b.A)((0,y.A)().mark((function t(n){var r,a,o,l,s,i,c;return(0,y.A)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:r=[],a=0,o=Array.from(n);case 4:if(!(a<o.length)){t.next=18;break}return l=o[a],t.next=8,S(l);case 8:if(s=t.sent,i=s.isValid,c=s.error,i){t.next=14;break}return B.add({name:"file-validation-error",title:c,theme:"danger"}),t.abrupt("continue",15);case 14:r.push(l);case 15:a++,t.next=4;break;case 18:r.length>0&&e((0,m.p$)(r));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return(0,I.jsxs)(i.s,{direction:"column",className:M(),gap:3,children:[(0,I.jsx)(j.E,{variant:"subheader-3",children:(0,I.jsxs)(i.s,{alignItems:"center",gap:1,children:[E("title_attach-files"),(0,I.jsx)(A.m,{content:E("context_text-files-only"),children:(0,I.jsx)(j.E,{color:"secondary",children:(0,I.jsx)(s.I,{data:L.A,size:16})})})]})}),(0,I.jsx)(N.y,{isEmpty:0===t.length,isDropable:!0,onFile:n}),t.length>0&&(0,I.jsx)(i.s,{direction:"column",gap:1,className:M("files-list"),children:t.map((function(t,n){return(0,I.jsxs)(i.s,{alignItems:"center",justifyContent:"space-between",className:M("file-item"),children:[(0,I.jsx)(j.E,{variant:"body-1",ellipsis:!0,children:t.name}),(0,I.jsx)(l.$,{view:"flat",onClick:function(){return function(t){e((0,f.Z9)(t))}(n)},children:(0,I.jsx)(s.I,{data:C.A,size:16})})]},n)}))})]})},O=(0,o.A)("yt-chat-file-button"),z=function(){var e=(0,a.useRef)(null),t=(0,g.A)(!1),n=(0,r.A)(t,2),o=n[0],i=n[1],c=(0,d.d)(p._o).length;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(l.$,{ref:e,onClick:i,children:[(0,I.jsx)(s.I,{data:v.A,size:16}),c?" ".concat(c):void 0]}),(0,I.jsx)(x.x,{className:O("popup"),anchorRef:e,open:o,onClose:i,placement:"top",children:(0,I.jsx)(R,{})})]})},H=(0,o.A)("yt-ai-chat-input"),P=function(e){var t=e.showScrollButton,n=e.onScrollClick,r=(0,d.w)(),a=(0,d.d)(p.bG),o=(0,d.d)(p.f),v=function(){r((0,m.L6)())};return(0,I.jsxs)("div",{className:H(),children:[t&&(0,I.jsx)(l.$,{view:"outlined",className:H("scroll-button"),onClick:n,children:(0,I.jsx)(s.I,{data:h.A,size:16})}),(0,I.jsxs)(i.s,{className:H("form"),justifyContent:"space-between",alignItems:"flex-end",children:[(0,I.jsx)(c.f,{view:"clear",value:o||"",onUpdate:function(e){r((0,f.b2)(e))},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v())}}),(0,I.jsxs)(i.s,{gap:1,children:[(0,I.jsx)(z,{}),(0,I.jsx)(l.$,{view:"action",onClick:v,disabled:!o,loading:a,children:(0,I.jsx)(s.I,{data:u.A,size:16})})]})]})]})},V=n(16538),D=n(40319);const $=function(e){return(0,I.jsx)("svg",(0,D.A)((0,D.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,I.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.5 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5m3.25-2a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zm0 8.5a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zM5 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 5 8M3.75 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0M2.5 13.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5",clipRule:"evenodd"})}))};var J=n(30469);const K=JSON.parse('{"context":"AI Chat component","action_new-chat":"New chat","action_history":"History","action_remove-token":"Remove token","action_close-chat":"Close chat","title_remove-token":"Remove token","confirm_remove-token":"Are you sure you want to remove the token?","action_remove":"Remove"}'),F=JSON.parse('{"context":"Компонент AI чата","action_new-chat":"Новый чат","action_history":"История","action_remove-token":"Удалить токен","action_close-chat":"Закрыть чат","title_remove-token":"Удалить токен","confirm_remove-token":"Вы уверены, что хотите удалить токен?","action_remove":"Удалить"}'),q=(0,T.Kc)("yt:ai.chat.header",{en:K,ru:F});var U=function(e){var t=e.className,n=(0,d.w)();return(0,I.jsxs)(i.s,{justifyContent:"flex-end",alignItems:"center",gap:1,className:t,children:[(0,I.jsx)(A.m,{content:q("action_new-chat"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,f.CX)())},children:(0,I.jsx)(s.I,{data:V.A,size:16})})}),(0,I.jsx)(A.m,{content:q("action_history"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,m.ZY)())},children:(0,I.jsx)(s.I,{data:$,size:16})})}),(0,I.jsx)(A.m,{content:q("action_close-chat"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,m.iJ)())},children:(0,I.jsx)(s.I,{data:J.A,size:16})})})]})};const G=JSON.parse('{"context":"AI Chat component","title_greeting":"Hi, I\'m Ai chat!","context_help-offer":"How can I help you today?"}'),Y=JSON.parse('{"context":"Компонент AI чата","title_greeting":"Привет, я AI чат!","context_help-offer":"Чем могу помочь сегодня?"}'),X=(0,T.Kc)("yt:ai.chat.empty-chat",{en:G,ru:Y});var W=function(){return(0,I.jsxs)(i.s,{alignItems:"center",justifyContent:"center",direction:"column",grow:1,children:[(0,I.jsx)(j.E,{variant:"header-1",children:X("title_greeting")}),(0,I.jsx)(j.E,{children:X("context_help-offer")})]})},Z=n(7787),Q=n(8208),ee=n(2464),te=n(93706),ne=(0,o.A)("yt-ai-chat-answer-body"),re=function(e){var t=e.message,n=e.className,r="progress"===t.state;return(0,I.jsxs)(i.s,{direction:"column",gap:2,className:ne(null,n),onCopy:function(){var e;null===(e=window.getSelection())||void 0===e||e.toString()},children:[(0,I.jsx)(ee.oz,{text:t.value||"..."}),(0,I.jsx)(i.s,{gap:1,className:ne("footer"),children:!r&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(te.b,{size:"s",text:t.value})})})]})},ae=n(31542),oe=n(41347);const le=JSON.parse('{"context":"MCP search answer component for AI chat","title_search-results":"MCP search answer"}'),se=JSON.parse('{"context":"Компонент ответа MCP поиска для AI чата","title_search-results":"Ответ MCP поиска"}'),ie=(0,T.Kc)("yt:ai.chat.mcp-search-answer",{en:le,ru:se});var ce=n(78485),ue=(0,o.A)("mcp-message"),de=function(e){var t=e.title,n=e.children,a=e.clipboardValue,o=e.className,l=(0,g.A)(!1),s=(0,r.A)(l,2),c=s[0],u=s[1];return(0,I.jsxs)(i.s,{className:ue(null,o),direction:"column",gap:2,children:[(0,I.jsxs)(i.s,{alignItems:"center",gap:2,onClick:u,className:ue("header"),children:[(0,I.jsx)(j.E,{color:"secondary",children:t}),(0,I.jsx)(ce.I,{direction:c?"top":"bottom"}),(0,I.jsx)("div",{onClick:function(e){e.stopPropagation()},children:(0,I.jsx)(te.b,{size:"s",text:a})})]}),c&&n]})},fe=function(e){var t=e.value,n=e.className;return(0,I.jsx)(de,{className:n,title:ie("title_search-results"),clipboardValue:JSON.stringify(t),children:(0,I.jsxs)(i.s,{direction:"column",gap:1,children:[t.map((function(e){var t=e.url,n=e.title;return(0,I.jsxs)(ae.N,{href:t,target:"_blank",children:[(0,I.jsx)(s.I,{data:oe.A})," ",n]},t)})),0===t.length&&(0,I.jsx)(j.E,{variant:"code-1",children:"[]"})]})})};const pe=JSON.parse('{"context":"MCP table schema answer component for AI chat","title_table-schema":"MCP table schema answer"}'),me=JSON.parse('{"context":"Компонент ответа MCP схемы таблицы для AI чата","title_table-schema":"Ответ MCP схемы таблицы"}'),he=(0,T.Kc)("yt:ai.chat.mcp-schema-answer",{en:pe,ru:me});var ve=function(e){var t=e.value,n=e.className;return(0,I.jsx)(de,{className:n,title:he("title_table-schema"),clipboardValue:JSON.stringify(t),children:(0,I.jsx)(j.E,{variant:"code-1",children:t})})};const ge=JSON.parse('{"title_unknown-mcp-call":"MCP Call"}'),xe=JSON.parse('{"title_unknown-mcp-call":"MCP вызов"}'),ye=(0,T.Kc)("yt:ai.chat.mcp-unknown-answer",{en:ge,ru:xe});var be=function(e){var t=e.name,n=e.value,r=e.className,a=JSON.stringify(n,null,2);return(0,I.jsx)(de,{className:r,title:"".concat(ye("title_unknown-mcp-call"),": ").concat(t),clipboardValue:a,children:(0,I.jsx)(j.E,{variant:"code-1",children:a})})},we=function(e,t){switch(e.type){case"error":return(0,I.jsx)(Q.z,{className:t,error:e.error});case"answer":return(0,I.jsx)(re,{className:t,message:e});case"mcp_search_answer":return(0,I.jsx)(fe,{className:t,value:e.value});case"mcp_table_schema_answer":return(0,I.jsx)(ve,{className:t,value:e.value});case"mcp_unknown_answer":return(0,I.jsx)(be,{className:t,name:e.name,value:e.value});default:return(0,I.jsx)("div",{className:t,children:e.value})}},je=(0,o.A)("yt-ai-chat-message"),Ae=function(e){var t=e.message,n=e.className,r="question"===t.type,a=Z.Ay.getAiChatMessageComponent(t,je("body"));return(0,I.jsx)(i.s,{justifyContent:r?"flex-end":"flex-start",className:je({question:r},n),gap:1,children:a||we(t,je("body"))})},Ne=n(56201),Ce=n(20239);const Te=JSON.parse('{"action_load-older":"Load older messages"}'),ke=JSON.parse('{"action_load-older":"Загрузить предыдущие сообщения"}'),_e=(0,T.Kc)("yt:ai.chat.messages",{en:Te,ru:ke});var Ee=function(){var e=(0,d.w)(),t=(0,d.d)(p.id),n=t.items,r=t.hasMore,a=t.loading;return(0,I.jsxs)(I.Fragment,{children:[r&&(0,I.jsx)(i.s,{justifyContent:"center",alignItems:"center",direction:"column",children:a?(0,I.jsx)(Ne.a,{size:"s"}):(0,I.jsxs)(l.$,{view:"outlined",onClick:function(){e((0,m.hO)())},disabled:a,children:[(0,I.jsx)(s.I,{data:Ce.A,size:16}),_e("action_load-older")]})}),n.map((function(e){var t="id"in e?e.id:e.error.message;return(0,I.jsx)(Ae,{message:e},t)}))]})};Ee.displayName="Messages";var Se=(0,o.A)("current-answer"),Le=function(e){var t=e.className;return(0,I.jsxs)("div",{className:Se("loading-dots",t),children:[(0,I.jsx)("span",{className:Se("dot")}),(0,I.jsx)("span",{className:Se("dot")}),(0,I.jsx)("span",{className:Se("dot")})]})},Ie=function(e){var t=e.className,n=(0,d.d)(p.gj);return(0,d.d)(p.bG)&&!n?(0,I.jsx)(Le,{className:t}):n?(0,I.jsx)(Ae,{className:t,message:{id:"current-answer",type:"answer",state:"progress",value:n}}):null},Me=n(14424),Be=n(60192),Re=n(21135);const Oe=JSON.parse('{"context":"Chat history component","context_no-conversations":"You have no conversations"}'),ze=JSON.parse('{"context":"Компонент истории чатов","context_no-conversations":"У вас нет истории чатов"}'),He=(0,T.Kc)("yt:ai.chat.history",{en:Oe,ru:ze});var Pe=n(73822),Ve=(0,o.A)("yt-chart-history-item"),De=function(e){var t=e.id,n=e.topic,r=e.onClick,a=e.onDelete;return(0,I.jsxs)(i.s,{className:Ve(),grow:1,alignItems:"center",justifyContent:"space-between",onClick:function(){return r(t)},children:[(0,I.jsx)(j.E,{ellipsis:!0,children:n||t}),(0,I.jsx)(l.$,{className:Ve("remove-button"),onClick:function(e){e.stopPropagation(),a(t)},view:"flat",children:(0,I.jsx)(s.I,{data:C.A,size:16})})]})},$e=(0,o.A)("yt-chart-history"),Je=function(){var e=(0,d.w)(),t=(0,d.d)(p.a$),n=(0,d.d)(p.eA),r=(0,d.d)(p.nv),o=function(t){e((0,m.Io)(t))},l=function(t){e((0,m.ly)(t))},s=(0,a.useCallback)((function(){e((0,m.Yj)())}),[e]);return t.length?(0,I.jsxs)("div",{className:$e(),children:[t.map((function(e){return(0,I.jsxs)("div",{className:$e("group"),children:[(0,I.jsx)("div",{className:$e("group-header"),children:(0,I.jsx)(j.E,{color:"secondary",children:Pe.A.format.DateTime(e.date,{format:"day"})})}),(0,I.jsx)(Me.B,{className:$e("list"),filterable:!1,items:e.items,renderItem:function(e,t){var n;return(0,I.jsx)(De,{id:e.id,topic:null===(n=e.metadata)||void 0===n?void 0:n.topic,onClick:o,onDelete:l})},itemHeight:40,virtualized:!1})]},e.date)})),n&&(0,I.jsx)(Re.P,{className:$e("pagination"),loading:r,onLoadMore:s})]}):(0,I.jsx)(i.s,{justifyContent:"center",alignItems:"center",grow:1,children:(0,I.jsx)(Be.R,{warning:He("context_no-conversations"),vertical:!0})})},Ke=n(80908),Fe=n(54736),qe=(0,o.A)("yt-ai-chat-body"),Ue=function(e){var t,n=e.isUserScrolledUp,r=e.scrollToBottom,o=e.checkScrollPosition,l=(0,a.useRef)(null),s=(0,d.d)(p.xS),c=(0,d.d)(p.bG),u=(0,d.d)(p.RP),f=(0,d.d)(p.X3),m=(0,d.d)(p.lb),h=(0,a.useCallback)((function(){o(),c&&!n&&r()}),[o,n,c,r]);return(0,Ke.A)({element:u&&null!==(t=l.current)&&void 0!==t?t:void 0,onResize:h}),m?(0,I.jsx)(i.s,{alignItems:"center",justifyContent:"center",grow:1,children:(0,I.jsx)(Fe.z,{error:m})}):s?(0,I.jsx)(i.s,{alignItems:"center",justifyContent:"center",grow:1,children:(0,I.jsx)(Ne.a,{})}):u?(0,I.jsxs)("div",{ref:l,className:qe("messages"),children:[(0,I.jsx)(Ee,{}),(0,I.jsx)(Ie,{className:qe("current-answer")})]}):f?(0,I.jsx)(Je,{}):(0,I.jsx)(W,{})},Ge=(0,o.A)("yt-ai-chat");const Ye=function(){var e=(0,a.useState)(!0),t=(0,r.A)(e,2),n=t[0],o=t[1],l=(0,a.useState)(!1),s=(0,r.A)(l,2),i=s[0],c=s[1],u=(0,a.useRef)(null),d=(0,a.useCallback)((function(){if(u.current){var e=u.current,t=e.scrollTop,n=e.scrollHeight-(t+e.clientHeight)<50;o(n),c(!n)}}),[]),f=(0,a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";u.current&&u.current.scrollTo({top:u.current.scrollHeight,behavior:e})}),[]),p=(0,a.useCallback)((function(){d()}),[d]);return(0,a.useEffect)((function(){var e=u.current;if(e)return e.addEventListener("scroll",p),function(){e.removeEventListener("scroll",p)}}),[p]),(0,I.jsxs)("div",{ref:u,className:Ge(),children:[(0,I.jsx)(U,{className:Ge("header")}),(0,I.jsx)(Ue,{scrollToBottom:f,checkScrollPosition:d,isUserScrolledUp:i}),(0,I.jsx)(P,{showScrollButton:!n,onScrollClick:function(){return f("smooth")}})]})}},41347:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 1.5A.75.75 0 0 0 10 3h1.94L6.97 7.97a.75.75 0 0 0 1.06 1.06L13 4.06V6a.75.75 0 0 0 1.5 0V2.25a.75.75 0 0 0-.75-.75zM7.5 3.25a.75.75 0 0 0-.75-.75H4.5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h6a3 3 0 0 0 3-3V9.25a.75.75 0 0 0-1.5 0v2.25a1.5 1.5 0 0 1-1.5 1.5h-6A1.5 1.5 0 0 1 3 11.5v-6A1.5 1.5 0 0 1 4.5 4h2.25a.75.75 0 0 0 .75-.75",clipRule:"evenodd"})}))}},49779:()=>{(()=>{var e,t,n,r,a,o,l,s,i,c,u,d,f=Object.create,p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,x=(e={"node_modules/get-root-node-polyfill/index.js"(e,t){function n(e){var t=r(e);return function(e){return"#document-fragment"===e.nodeName&&"ShadowRoot"===e.constructor.name}(t)?n(t.host):t}function r(e){return null!=e.parentNode?r(e.parentNode):e}"object"==typeof t&&t.exports&&(t.exports=function(e){return"object"==typeof e&&Boolean(e.composed)?n(this):r(this)})}},function(){return t||(0,e[h(e)[0]])((t={exports:{}}).exports,t),t.exports});n="yfm-tab-panel",r="active",a="data-diplodoc-group",o="data-diplodoc-key",l=Symbol.for("diplodocTabs"),s=e=>{let t=e.composedPath();return Array.isArray(t)&&t.length>0?t[0]:e.target},i=e=>{let t=s(e);return!t||!t.matches},c=e=>Math.abs(e.scrollHeight-e.clientHeight)>1?e:e.parentElement?c(e.parentElement):void 0,u=(e,t)=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{top:n.top-r.top,left:n.left-r.left,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}},d={TABS:".yfm-tabs",TAB_LIST:".yfm-tab-list",TAB:".yfm-tab",TAB_PANEL:`.${n}`,VERTICAL_TABS:".yfm-tabs-vertical"},"undefined"!=typeof window&&"undefined"!=typeof document&&!window[l]&&(window[l]=new class{constructor(e){this._onSelectTabHandlers=new Set,this._document=e,this._document.addEventListener("click",(e=>{let t=s(e),n=this.areTabsVertical(t);if(i(e)||!this.isValidTabElement(t)&&!n)return;let r=this.getTabDataFromHTMLElement(t);r&&this._selectTab(r,t)})),this._document.addEventListener("keydown",(e=>{let t=null;switch(e.key){case"ArrowLeft":t="left";break;case"ArrowRight":t="right"}if(!t)return;let n=s(e);if(i(e)||!this.isValidTabElement(n))return;let{tabs:r,nodes:a}=this.getTabs(n),o=this.getTabDataFromHTMLElement(n),l=r.findIndex((({key:e})=>(null==o?void 0:o.key)&&e===o.key));if(!o||r.length<=1||-1===l)return;let c=(l+("left"===t?-1:1)+r.length)%r.length;this.selectTab(r[c]),a[c].focus()}))}onSelectTab(e){return this._onSelectTabHandlers.add(e),()=>{this._onSelectTabHandlers.delete(e)}}selectTabById(e,t){let n=this._document.querySelector(`${d.TAB}[data-diplodoc-id="${e}"]`);if(!n||!this.isValidTabElement(n))return;let r=this.getTabDataFromHTMLElement(n);r&&this._selectTab(r,n),null!=t&&t.scrollToElement&&n.scrollIntoView()}selectTab(e){this._selectTab(e)}_selectTab(e,t){let{group:n,key:r,align:a}=e;if(!n)return;let o=t&&c(t),l=o&&u(t,o);this.updateHTML({group:n,key:r,align:a},a)>0&&(this.fireSelectTabEvent({group:n,key:r,align:a},null==t?void 0:t.dataset.diplodocId),l&&this.resetScroll(t,o,l))}updateHTML(e,t){switch(t){case"vertical":return this.updateHTMLVertical(e);case"horizontal":return this.updateHTMLHorizontal(e)}return 0}updateHTMLVertical(e){let{group:t,key:n}=e,[r]=this._document.querySelectorAll(`${d.TABS}[${a}="${t}"] ${d.TAB}[${o}="${n}"]`),l=0,s=r.parentNode.children;for(let e=0;e<s.length;e+=2){let[t,n]=[s.item(e),s.item(e+1)],a=t.children.item(0);a.hasAttribute("checked")&&(t.classList.remove("active"),null==n||n.classList.remove("active"),a.removeAttribute("checked")),t===r&&(t.classList.add("active"),null==n||n.classList.add("active"),a.setAttribute("checked","true")),l++}return l}updateHTMLHorizontal(e){let{group:t,key:l}=e,s=this._document.querySelectorAll(`${d.TABS}[${a}="${t}"] ${d.TAB}[${o}="${l}"]`),i=0;return s.forEach((e=>{let t=e;if(!this.isValidTabElement(t)||"true"===t.dataset.diplodocIsActive)return;i++;let a=e,o=a.parentNode,l=null==o?void 0:o.parentNode,s=Array.from((null==o?void 0:o.querySelectorAll(d.TAB))||[]),c=Array.from((null==l?void 0:l.children)||[]).filter((e=>e.classList.contains(n))),u=s.indexOf(a);s.forEach(((e,t)=>{let n=c[t],a=t===u;e.dataset.diplodocIsActive=a?"true":"false",e.classList.toggle(r,a),e.setAttribute("aria-selected",a.toString()),e.setAttribute("tabindex",a?"0":"-1"),n.classList.toggle(r,a)}))})),i}resetScroll(e,t,n){let r=u(e,t),a=r.top-n.top,o=r.left-n.left,l=r.scrollTop-n.scrollTop,s=r.scrollLeft-n.scrollLeft;t.scrollTo(t.scrollLeft+o-s,t.scrollTop+a-l)}fireSelectTabEvent(e,t){let{group:n,key:r,align:a}=e,o=n.startsWith("defaultTabsGroup-")?{key:r,align:a}:e;this._onSelectTabHandlers.forEach((e=>{e({tab:o,currentTabId:t})}))}isValidTabElement(e){let t=e.matches(d.TAB)&&e.dataset.diplodocId?e.closest(d.TAB_LIST):null;return null==t?void 0:t.closest(d.TABS)}areTabsVertical(e){let t=e.parentElement;return e.dataset.diplodocVerticalTab||!(null==t||!t.dataset.diplodocVerticalTab)}getTabDataFromHTMLElement(e){var t,n;if(this.areTabsVertical(e)){let n=e.dataset.diplodocVerticalTab?e:e.parentElement,r=n.dataset.diplodocKey,a=null==(t=n.closest(d.TABS))?void 0:t.dataset.diplodocGroup;return r&&a?{group:a,key:r,align:"vertical"}:null}let r=e.dataset.diplodocKey,a=null==(n=e.closest(d.TABS))?void 0:n.dataset.diplodocGroup;return r&&a?{group:a,key:r,align:"horizontal"}:null}getTabs(e){var t,n;let r=null==(t=e.closest(d.TABS))?void 0:t.dataset.diplodocGroup,a=null==(n=e.closest(d.TAB_LIST))?void 0:n.querySelectorAll(d.TAB),o=[];return a.forEach((e=>{let t=null==e?void 0:e.dataset.diplodocKey;t&&o.push({group:r,key:t,align:"horizontal"})})),{tabs:o,nodes:a}}}(document));var y=((e,t,n)=>(n=null!=e?f(v(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of h(t))g.call(e,n)||undefined===n||p(e,n,{get:()=>t[n],enumerable:!(r=m(t,n))||r.enumerable});return e})(e&&e.__esModule?n:p(n,"default",{value:e,enumerable:!0}),e)))(x());"undefined"!=typeof document&&function(e){const t=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector;e.matches=e.matchesSelector=t||function(t){const n=(e.getRootNode?e.getRootNode():y.default.call(e)).querySelectorAll(t),r=this;return Array.prototype.some.call(n,(e=>e===r))}}(Element.prototype);var b=e=>{const t=e.composedPath();return Array.isArray(t)&&t.length>0?t[0]:e.target},w=e=>{const t=b(e);return!t||!t.matches};"undefined"!=typeof document&&document.addEventListener("click",(e=>{const t=b(e);if(w(e)||!t.matches(".yfm-clipboard-button"))return;const n=t.parentNode;if(!n)return;const r=n.querySelector("pre code");r&&function(e){if(!e)return Promise.resolve();if(navigator.clipboard&&(navigator.clipboard.writeText,1))return navigator.clipboard.writeText(e);const t=document.createElement("textarea");return t.setAttribute("style","position: absolute; left: 1000%"),t.textContent=e,document.body.append(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}(r.innerText).then((()=>{!function(e){if(!e)return;const t=e.getAttribute("data-animation"),n=e.getRootNode().getElementById(`visibileAnimation-${t}`);n&&n.beginElement()}(n.querySelector(".yfm-clipboard-button"))}))}));var j=".yfm .yfm-cut-title";function A(e){var t;return e instanceof HTMLElement&&(null==(t=null==e?void 0:e.matches)?void 0:t.call(e,j))}"undefined"!=typeof document&&document.addEventListener("click",(e=>{if(w(e))return;const t=function(e){var t;const n=b(e);if(A(n))return n;const r=null==(t=e.composedPath)?void 0:t.call(e);return null==r?void 0:r.find(A)}(e);t&&function(e){const t=e.parentNode;t instanceof HTMLElement&&t.classList.toggle("open")}(t)}));var N={TITLE:".yfm .yfm-term_title",CONTENT:".yfm .yfm-term_dfn"},C="open",T=N.CONTENT.replace(/\./g,"")+" "+C,k=!0;function _(e,t){const{x:n,y:r,right:a,left:o,width:l,height:s}=t.getBoundingClientRect(),i=S(t);if(!i)return;const{right:c,left:u}=i.getBoundingClientRect();if((c<o||u>a)&&!k)return void L(e);k&&i&&(i.addEventListener("scroll",E),k=!1);const d=Number(e.getAttribute("relativeX")),f=Number(e.getAttribute("relativeY"));if(d===n&&f===r)return;e.setAttribute("relativeX",String(n)),e.setAttribute("relativeY",String(r));const p=s+5,m=e.parentElement;if(!m)return;const{width:h}=e.getBoundingClientRect(),{left:v}=m.getBoundingClientRect(),g=Number(I(t).left),x=g-h<0,y=(h+g>document.body.clientWidth||"rtl"===document.dir)&&!x?h-l:0,b=I(m).top-m.offsetTop;e.style.top=Number(I(t).top+p-b)+"px",e.style.left=Number(I(t).left-v+m.offsetLeft-y)+"px"}function E(){const e=document.getElementsByClassName(T)[0];if(!e)return;const t=e.getAttribute("term-id")||"",n=document.getElementById(t);n&&_(e,n)}function S(e){return e?e.closest("table")||e.closest("code")||e.parentElement:null}function L(e){e.classList.remove(C);const t=e.getAttribute("term-id")||"",n=S(document.getElementById(t));n&&(n.removeEventListener("scroll",E),k=!0)}function I(e){const t=e.getBoundingClientRect(),n=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||n.scrollTop,o=window.pageXOffset||r.scrollLeft||n.scrollLeft,l=r.clientTop||n.clientTop||0,s=r.clientLeft||n.clientLeft||0,i=t.top+a-l,c=t.left+o-s;return{top:Math.round(i),left:Math.round(c)}}"undefined"!=typeof document&&(document.addEventListener("click",(e=>{const t=document.getElementsByClassName(T)[0],n=b(e),r=n.getAttribute("id"),a=n.getAttribute("term-key");let o=document.getElementById(a+"_element");if(a&&!o&&(o=function(e){var t;const n=e.getAttribute("term-key"),r=document.getElementById(`${n}_template`),a=null==r?void 0:r.content.cloneNode(!0).firstChild;return null==(t=null==r?void 0:r.parentElement)||t.appendChild(a),r.remove(),a}(n)),t&&r===t.getAttribute("term-id"))return void L(t);const l=n.closest([N.CONTENT.replace(" ",""),C].join("."));t&&!l&&L(t),!w(e)&&n.matches(N.TITLE)&&o&&(function(e,t){const n=t.getAttribute("id")||Math.random().toString(36).substr(2,8);null==e||e.setAttribute("term-id",n)}(o,n),_(o,n),o.classList.toggle(C))})),document.addEventListener("keydown",(e=>{const t=document.getElementsByClassName(T)[0];"Escape"===e.key&&t&&L(t)})),window.addEventListener("resize",(()=>{const e=document.getElementsByClassName(T)[0];if(!e)return;const t=e.getAttribute("term-id")||"",n=document.getElementById(t);n?_(e,n):e.classList.toggle(C)})))})()},51036:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(77810);const a=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",clipRule:"evenodd"}))},51188:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",clipRule:"evenodd"})}))}},59241:(e,t,n)=>{n.d(t,{x:()=>u}),n(77810);var r=n(76872),a=n(21211),o=n(1335),l=n(45760),s=n(30469),i=n(64922),c=(0,r.A)("popup-with-close-button"),u=function(e){var t=e.anchorRef,n=e.open,r=e.onClose,u=e.children,d=e.className,f=e.placement,p=void 0===f?"bottom":f;return(0,i.jsxs)(a.z,{anchorElement:t.current,open:n,className:c(null,d),onOpenChange:function(e,t,n){e||"outside-press"!==n||r()},placement:p,children:[(0,i.jsx)(o.$,{view:"flat",className:c("close-button"),onClick:r,children:(0,i.jsx)(l.I,{data:s.A})}),u]})}},63308:(e,t,n)=>{n.d(t,{y:()=>y,A:()=>b});var r=n(77810),a=n(76872),o=n(29121),l=n(12937),s=n(66134),i=n(10785),c=n(56796),u=n(64922),d=(0,a.A)("yt-file-picker"),f=function(e){function t(){var e;(0,o.A)(this,t);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return(e=(0,s.A)(this,t,[].concat(a))).inputRef=r.createRef(),e.onLinkClick=function(){e.inputRef.current&&e.inputRef.current.click()},e.onChange=function(t){e.props.onChange(t.target.files)},e}return(0,i.A)(t,e),(0,l.A)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.multiple;return(0,u.jsxs)(c.S,{onClick:this.onLinkClick,children:[t,(0,u.jsx)("input",{ref:this.inputRef,className:d("input"),onChange:this.onChange,type:"file",multiple:n})]})}}])}(r.Component),p=n(9736);var m=n(92611);const h=JSON.parse('{"context_drag-file":"Drag a file here","context_drop-file":"Drop file here","or":"or","action_pick-file":"Pick a file"}'),v=JSON.parse('{"context_drag-file":"Перетащите файл сюда","context_drop-file":"Отпустите файл здесь","or":"или","action_pick-file":"Выберите файл"}'),g=(0,m.Kc)("yt:component.file-drop-zone",{en:h,ru:v});var x=(0,a.A)("file-drop-zone"),y=function(e){var t=e.isDropable,n=e.onFile,a=e.isEmpty,o=e.children,l=function(e){var t=(0,r.useState)(!1),n=(0,p.A)(t,2),a=n[0],o=n[1];return{onDragOver:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation()}),[]),onDragEnter:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation(),o(!0)}),[]),onDragLeave:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation(),o(!1)}),[]),onDrop:(0,r.useCallback)((function(t){t.preventDefault(),t.stopPropagation(),o(!1);var n=t.dataTransfer.files;n&&e(n)}),[e]),isDragging:a}}(n),s=l.onDrop,i=l.onDragOver,c=l.onDragEnter,d=l.onDragLeave,m=l.isDragging;return(0,u.jsx)("div",{className:x("drag-area",{dropable:t,empty:a,dragging:m}),onDrop:s,onDragEnter:c,onDragLeave:d,onDragOver:i,children:o||(0,u.jsxs)("div",{className:x("info"),children:[(0,u.jsx)("div",{children:g(m?"context_drop-file":"context_drag-file")}),g("or"),(0,u.jsx)("div",{children:(0,u.jsx)(f,{onChange:n,children:g("action_pick-file")})})]})})};const b=y},64945:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 14.75a.75.75 0 0 1-.75-.75V3.81L4.53 6.53a.75.75 0 0 1-1.06-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06L8.75 3.81V14a.75.75 0 0 1-.75.75",clipRule:"evenodd"})}))}},75299:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(77810),a=function(e,t){return"boolean"==typeof t?t:!e};const o=function(e){return(0,r.useReducer)(a,e)}},78485:(e,t,n)=>{n.d(t,{I:()=>s});var r=n(64922),a=n(51036),o=n(45760);const l=(0,n(47999).om)("arrow-toggle");function s({size:e=16,direction:t="bottom",className:n,qa:s}){return(0,r.jsx)("span",{style:{width:e,height:e},className:l({direction:t},n),"data-qa":s,children:(0,r.jsx)(o.I,{data:a.A,size:e})})}},79703:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14M6.44 4.54c.43-.354.994-.565 1.56-.565 1.217 0 2.34.82 2.34 2.14 0 .377-.078.745-.298 1.1-.208.339-.513.614-.875.867-.217.153-.325.257-.379.328-.038.052-.038.07-.038.089a.75.75 0 0 1-1.5 0c0-.794.544-1.286 1.057-1.645.28-.196.4-.332.458-.426a.54.54 0 0 0 .075-.312c0-.3-.244-.641-.84-.641a1 1 0 0 0-.608.223c-.167.138-.231.287-.231.418a.75.75 0 0 1-1.5 0c0-.674.345-1.22.78-1.577M8 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2",clipRule:"evenodd"})}))}},88150:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m9.77 10.73.01-.01 3.08-3.08a3.889 3.889 0 1 0-5.5-5.5L4.73 4.77l-.01.01-1.667 1.666a5.303 5.303 0 0 0 7.5 7.5l3.167-3.166a.75.75 0 1 0-1.061-1.06l-3.166 3.166a3.803 3.803 0 1 1-5.379-5.379L5.33 6.291l.011-.01L8.421 3.2a2.39 2.39 0 0 1 3.38 3.378l-1.13 1.13-.012.012-2.995 2.994a.975.975 0 1 1-1.378-1.378L9.28 6.34a.75.75 0 0 0-1.06-1.06L5.225 8.274a2.475 2.475 0 0 0 3.5 3.5z",clipRule:"evenodd"})}))}},94119:(e,t,n)=>{n.d(t,{f:()=>g});var r=n(64922),a=n(77810),o=n(53359),l=n(99621),s=n(49533),i=n(48617),c=n(47999),u=n(44712),d=n(56254),f=n(2960),p=n(19333);const m=(0,c.om)("text-area");function h(e){const{name:t,id:n,tabIndex:o,autoComplete:s,placeholder:i,value:c,defaultValue:u,controlRef:d,controlProps:f,size:h,rows:v,minRows:g=1,maxRows:x,autoFocus:y,disabled:b,readOnly:w,onChange:j,onFocus:A,onBlur:N,onKeyDown:C,onKeyUp:T,onKeyPress:k}=e,_=a.useRef(null),E=(0,l.N)(d,_),S=Math.max(v||g,1),L=c||_?.current?.value,I=a.useCallback((()=>{const e=_?.current,t=e?.parentElement;if(e&&t&&!v){const n=getComputedStyle(e),r=parseInt(n.getPropertyValue("line-height"),10),a=parseInt(n.getPropertyValue("padding-top"),10),o=parseInt(n.getPropertyValue("padding-bottom"),10),l=(L?.match(/\n/g)||[]).length+1,s=t.style.height;t.style.height=`${t.offsetHeight}px`,e.style.height=`${r+a+o}px`;const i=e.style.overflow;e.style.overflow="hidden";const c=(e=>{const{height:t,lineHeight:n}=e;return(t-(Number.isNaN(e.paddingTop)?0:e.paddingTop)-(Number.isNaN(e.paddingBottom)?0:e.paddingBottom))/n})({height:e.scrollHeight,paddingTop:a,paddingBottom:o,lineHeight:r}),u=Math.max(c,l);e.style.height=x&&x<u?`${x*r+a+o}px`:g&&g>u?`${Math.min(g,x||1/0)*r+a+o}px`:`${e.scrollHeight}px`,e.style.overflow=i,t.style.height=s}}),[v,x,g,L]);return(0,p.w)({ref:v?void 0:_,onResize:I}),a.useEffect((()=>{I()}),[I,h,c]),(0,r.jsx)("textarea",{...f,ref:E,style:{...f.style,height:v?"auto":void 0},className:m("control",f.className),name:t,id:n,tabIndex:o,placeholder:i,value:c,defaultValue:u,rows:S,autoFocus:y,autoComplete:s,onChange:j,onFocus:A,onBlur:N,onKeyDown:C,onKeyUp:T,onKeyPress:k,disabled:b??f.disabled,readOnly:w??f.readOnly})}const v=(0,c.om)("text-area"),g=a.forwardRef((function(e,t){const{view:n="normal",size:c="m",pin:p="round-round",name:m,value:g,defaultValue:x,disabled:y,readOnly:b,hasClear:w=!1,error:j,errorMessage:A,validationState:N,autoComplete:C,id:T,tabIndex:k,style:_,className:E,qa:S,controlProps:L,note:I,onUpdate:M,onChange:B}=e,{errorMessage:R,validationState:O}=(0,f.Av)({error:j,errorMessage:A,validationState:N}),[z,H]=(0,o.P)(g,x??"",M),P=a.useRef(null),V=(0,i.d)({initialValue:z,onReset:H}),D=(0,l.N)(e.controlRef,P,V),[$,J]=a.useState(!1),K=(0,f.lf)(O),F=(0,s.u)(),q="invalid"===O&&Boolean(R),U=Boolean(w&&!y&&!b&&z),G=T||F,Y=(0,s.u)(),X=(0,s.u)(),W=[L?.["aria-describedby"],I?X:void 0,q?Y:void 0].filter(Boolean).join(" "),Z={id:G,tabIndex:k,name:m,onChange(e){H(e.target.value),B&&B(e)},autoComplete:(0,f.o$)(C),controlProps:{...L,"aria-describedby":W||void 0,"aria-invalid":"invalid"===O||void 0}};return a.useEffect((()=>{const e=P.current;if(e){const t=e.scrollHeight>e.clientHeight;$!==t&&J(t)}}),[z,$]),(0,r.jsxs)("span",{ref:t,style:_,className:v({view:n,size:c,disabled:y,state:K,pin:"clear"===n?void 0:p,"has-clear":U,"has-scrollbar":$},E),"data-qa":S,children:[(0,r.jsxs)("span",{className:v("content"),children:[(0,r.jsx)(h,{...e,...Z,controlRef:D}),U&&(0,r.jsx)(u.k,{className:v("clear",{size:c}),size:(0,u.v)(c),onClick:e=>{const t=P.current;if(t){t.focus();const n=Object.create(e);n.target=t,n.currentTarget=t,t.value="",B&&B(n)}H("")}})]}),(0,r.jsx)(d.o,{errorMessage:q?R:null,errorMessageId:Y,note:I,noteId:X})]})}))}}]);
|
|
2
|
-
//# sourceMappingURL=code-assistant-chat.
|
|
1
|
+
"use strict";(self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[8398],{2464:(e,t,n)=>{n.d(t,{oz:()=>y,B6:()=>g});var r=n(40319),a=n(53775),o=n(9736),l=n(28407),s=n(77810),i=n(76872),c=n(41169),u=n(48971),d=n(7787),f=(n(49779),n(64922)),p=(0,i.A)("yt-markdown"),m={result:{html:"",headings:[]},logs:{info:[],warn:[],error:[],disabled:[]}};function h(e){return v.apply(this,arguments)}function v(){return(v=(0,l.A)((0,a.A)().mark((function e(t){var n,o,l,s;return(0,a.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.text,o=t.allowHTML,e.prev=1,e.next=4,(0,u.fI)(c.A.post("/api/markdown-to-html",{text:n,allowHTML:o}),{toasterName:"useMarkdown",skipSuccessToast:!0,errorContent:"Failed to transform markdown text"});case 4:return l=e.sent,s=l.data,e.abrupt("return",s);case 9:return e.prev=9,e.t0=e.catch(1),e.abrupt("return",{result:(0,r.A)({},m.result),logs:(0,r.A)((0,r.A)({},m.logs),{},{error:[e.t0.message]})});case 12:case"end":return e.stop()}}),e,null,[[1,9]])})))).apply(this,arguments)}function g(e){var t=e.text,n=e.allowHTML,r=void 0===n||n,i=s.useState(m),c=(0,o.A)(i,2),u=c[0],d=c[1];return s.useEffect((function(){function e(){return(e=(0,l.A)((0,a.A)().mark((function e(){var n;return(0,a.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,h({text:t,allowHTML:r});case 3:n=e.sent,d(n),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,r]),u}function x(e){var t,n=(null!==(t=g({text:e.text,allowHTML:!0}).result)&&void 0!==t?t:{}).html;return(0,f.jsx)(s.Fragment,{children:(0,f.jsx)("div",{className:p(null,"yfm"),dangerouslySetInnerHTML:{__html:null!=n?n:""}})})}var y=(0,s.memo)((function(e){var t=e.text,n=d.Ay.renderMarkdown({text:t});return null!=n?n:(0,f.jsx)(x,{text:t})}))},16538:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 1.75a.75.75 0 0 1 .75.75v4.75h4.75a.75.75 0 0 1 0 1.5H8.75v4.75a.75.75 0 0 1-1.5 0V8.75H2.5a.75.75 0 0 1 0-1.5h4.75V2.5A.75.75 0 0 1 8 1.75",clipRule:"evenodd"})}))}},20239:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.03 10.53a.75.75 0 0 1-1.06 0L8 6.56l-3.97 3.97a.75.75 0 1 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06",clipRule:"evenodd"})}))}},21135:(e,t,n)=>{n.d(t,{P:()=>s});var r=n(77810),a=n(55339),o=n(56201),l=n(64922),s=function(e){var t=e.className,n=e.loading,s=e.onLoadMore,i=(0,r.useRef)(null);return(0,r.useEffect)((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&s()}))}),{root:null,threshold:.1});return i.current&&e.observe(i.current),function(){i.current&&e.unobserve(i.current)}}),[]),(0,l.jsx)(a.s,{className:t,ref:i,alignItems:"center",justifyContent:"center",children:n?(0,l.jsx)(o.a,{}):""})}},23132:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ye});var r=n(9736),a=n(77810),o=n(76872),l=n(1335),s=n(45760),i=n(55339),c=n(94119),u=n(64945),d=n(14371),f=n(40315),p=n(51404),m=n(72563),h=n(51188),v=n(88150),g=n(75299),x=n(59241),y=n(53775),b=n(28407),w=n(27215),j=n(3962),A=n(1435),N=n(63308),C=n(79988),T=n(92611);const k=JSON.parse('{"title_attach-files":"Attach files","context_text-files-only":"You can attach text files in any format (source code, configs, etc.). Maximum size is 0.5 MB","alert_file-too-large":"File is too large. Maximum size is 0.5 MB","alert_binary-data":"File contains binary data","alert_invalid-text-file":"File is not a valid text file"}'),_=JSON.parse('{"title_attach-files":"Прикрепить файлы","context_text-files-only":"Вы можете прикрепить текстовые файлы любого формата (исходный код, конфигурации и т.д.). Максимальный размер 0.5 МБ","alert_file-too-large":"Файл слишком большой. Максимальный размер 0.5 МБ","alert_binary-data":"Файл содержит бинарные данные","alert_invalid-text-file":"Файл не является валидным текстовым файлом"}'),E=(0,T.Kc)("yt:ai.chat.file-popup",{en:k,ru:_});var S=function(){var e=(0,b.A)((0,y.A)().mark((function e(t){var n,r,a,o;return(0,y.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.size>524288)){e.next=2;break}return e.abrupt("return",{isValid:!1,error:E("alert_file-too-large")});case 2:return e.prev=2,e.next=5,t.arrayBuffer();case 5:n=e.sent,r=new Uint8Array(n),a=Math.min(r.length,8192),o=0;case 9:if(!(o<a)){e.next=15;break}if(0!==r[o]){e.next=12;break}return e.abrupt("return",{isValid:!1,error:E("alert_binary-data")});case 12:o++,e.next=9;break;case 15:return new TextDecoder("utf-8",{fatal:!0}).decode(n),e.abrupt("return",{isValid:!0});case 20:return e.prev=20,e.t0=e.catch(2),e.abrupt("return",{isValid:!1,error:E("alert_invalid-text-file")});case 23:case"end":return e.stop()}}),e,null,[[2,20]])})));return function(t){return e.apply(this,arguments)}}(),L=n(79703),I=n(64922),M=(0,o.A)("yt-chat-file-popup"),B=new w.l,R=function(){var e=(0,d.w)(),t=(0,d.d)(p._o),n=function(){var t=(0,b.A)((0,y.A)().mark((function t(n){var r,a,o,l,s,i,c;return(0,y.A)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:r=[],a=0,o=Array.from(n);case 4:if(!(a<o.length)){t.next=18;break}return l=o[a],t.next=8,S(l);case 8:if(s=t.sent,i=s.isValid,c=s.error,i){t.next=14;break}return B.add({name:"file-validation-error",title:c,theme:"danger"}),t.abrupt("continue",15);case 14:r.push(l);case 15:a++,t.next=4;break;case 18:r.length>0&&e((0,m.p$)(r));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return(0,I.jsxs)(i.s,{direction:"column",className:M(),gap:3,children:[(0,I.jsx)(j.E,{variant:"subheader-3",children:(0,I.jsxs)(i.s,{alignItems:"center",gap:1,children:[E("title_attach-files"),(0,I.jsx)(A.m,{content:E("context_text-files-only"),children:(0,I.jsx)(j.E,{color:"secondary",children:(0,I.jsx)(s.I,{data:L.A,size:16})})})]})}),(0,I.jsx)(N.y,{isEmpty:0===t.length,isDropable:!0,onFile:n}),t.length>0&&(0,I.jsx)(i.s,{direction:"column",gap:1,className:M("files-list"),children:t.map((function(t,n){return(0,I.jsxs)(i.s,{alignItems:"center",justifyContent:"space-between",className:M("file-item"),children:[(0,I.jsx)(j.E,{variant:"body-1",ellipsis:!0,children:t.name}),(0,I.jsx)(l.$,{view:"flat",onClick:function(){return function(t){e((0,f.Z9)(t))}(n)},children:(0,I.jsx)(s.I,{data:C.A,size:16})})]},n)}))})]})},O=(0,o.A)("yt-chat-file-button"),z=function(){var e=(0,a.useRef)(null),t=(0,g.A)(!1),n=(0,r.A)(t,2),o=n[0],i=n[1],c=(0,d.d)(p._o).length;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(l.$,{ref:e,onClick:i,children:[(0,I.jsx)(s.I,{data:v.A,size:16}),c?" ".concat(c):void 0]}),(0,I.jsx)(x.x,{className:O("popup"),anchorRef:e,open:o,onClose:i,placement:"top",children:(0,I.jsx)(R,{})})]})},H=(0,o.A)("yt-ai-chat-input"),P=function(e){var t=e.showScrollButton,n=e.onScrollClick,r=(0,d.w)(),a=(0,d.d)(p.bG),o=(0,d.d)(p.f),v=function(){r((0,m.L6)())};return(0,I.jsxs)("div",{className:H(),children:[t&&(0,I.jsx)(l.$,{view:"outlined",className:H("scroll-button"),onClick:n,children:(0,I.jsx)(s.I,{data:h.A,size:16})}),(0,I.jsxs)(i.s,{className:H("form"),justifyContent:"space-between",alignItems:"flex-end",children:[(0,I.jsx)(c.f,{view:"clear",value:o||"",onUpdate:function(e){r((0,f.b2)(e))},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v())}}),(0,I.jsxs)(i.s,{gap:1,children:[(0,I.jsx)(z,{}),(0,I.jsx)(l.$,{view:"action",onClick:v,disabled:!o,loading:a,children:(0,I.jsx)(s.I,{data:u.A,size:16})})]})]})]})},V=n(16538),D=n(40319);const $=function(e){return(0,I.jsx)("svg",(0,D.A)((0,D.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,I.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.5 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5m3.25-2a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zm0 8.5a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5zM5 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 5 8M3.75 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0M2.5 13.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5",clipRule:"evenodd"})}))};var J=n(30469);const K=JSON.parse('{"context":"AI Chat component","action_new-chat":"New chat","action_history":"History","action_remove-token":"Remove token","action_close-chat":"Close chat","title_remove-token":"Remove token","confirm_remove-token":"Are you sure you want to remove the token?","action_remove":"Remove"}'),F=JSON.parse('{"context":"Компонент AI чата","action_new-chat":"Новый чат","action_history":"История","action_remove-token":"Удалить токен","action_close-chat":"Закрыть чат","title_remove-token":"Удалить токен","confirm_remove-token":"Вы уверены, что хотите удалить токен?","action_remove":"Удалить"}'),q=(0,T.Kc)("yt:ai.chat.header",{en:K,ru:F});var U=function(e){var t=e.className,n=(0,d.w)();return(0,I.jsxs)(i.s,{justifyContent:"flex-end",alignItems:"center",gap:1,className:t,children:[(0,I.jsx)(A.m,{content:q("action_new-chat"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,f.CX)())},children:(0,I.jsx)(s.I,{data:V.A,size:16})})}),(0,I.jsx)(A.m,{content:q("action_history"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,m.ZY)())},children:(0,I.jsx)(s.I,{data:$,size:16})})}),(0,I.jsx)(A.m,{content:q("action_close-chat"),children:(0,I.jsx)(l.$,{view:"flat",onClick:function(){n((0,m.iJ)())},children:(0,I.jsx)(s.I,{data:J.A,size:16})})})]})};const G=JSON.parse('{"context":"AI Chat component","title_greeting":"Hi, I\'m Ai chat!","context_help-offer":"How can I help you today?"}'),Y=JSON.parse('{"context":"Компонент AI чата","title_greeting":"Привет, я AI чат!","context_help-offer":"Чем могу помочь сегодня?"}'),X=(0,T.Kc)("yt:ai.chat.empty-chat",{en:G,ru:Y});var W=function(){return(0,I.jsxs)(i.s,{alignItems:"center",justifyContent:"center",direction:"column",grow:1,children:[(0,I.jsx)(j.E,{variant:"header-1",children:X("title_greeting")}),(0,I.jsx)(j.E,{children:X("context_help-offer")})]})},Z=n(7787),Q=n(8208),ee=n(2464),te=n(93706),ne=(0,o.A)("yt-ai-chat-answer-body"),re=function(e){var t=e.message,n=e.className,r="progress"===t.state;return(0,I.jsxs)(i.s,{direction:"column",gap:2,className:ne(null,n),onCopy:function(){var e;null===(e=window.getSelection())||void 0===e||e.toString()},children:[(0,I.jsx)(ee.oz,{text:t.value||"..."}),(0,I.jsx)(i.s,{gap:1,className:ne("footer"),children:!r&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(te.b,{size:"s",text:t.value})})})]})},ae=n(31542),oe=n(41347);const le=JSON.parse('{"context":"MCP search answer component for AI chat","title_search-results":"MCP search answer"}'),se=JSON.parse('{"context":"Компонент ответа MCP поиска для AI чата","title_search-results":"Ответ MCP поиска"}'),ie=(0,T.Kc)("yt:ai.chat.mcp-search-answer",{en:le,ru:se});var ce=n(78485),ue=(0,o.A)("mcp-message"),de=function(e){var t=e.title,n=e.children,a=e.clipboardValue,o=e.className,l=(0,g.A)(!1),s=(0,r.A)(l,2),c=s[0],u=s[1];return(0,I.jsxs)(i.s,{className:ue(null,o),direction:"column",gap:2,children:[(0,I.jsxs)(i.s,{alignItems:"center",gap:2,onClick:u,className:ue("header"),children:[(0,I.jsx)(j.E,{color:"secondary",children:t}),(0,I.jsx)(ce.I,{direction:c?"top":"bottom"}),(0,I.jsx)("div",{onClick:function(e){e.stopPropagation()},children:(0,I.jsx)(te.b,{size:"s",text:a})})]}),c&&n]})},fe=function(e){var t=e.value,n=e.className;return(0,I.jsx)(de,{className:n,title:ie("title_search-results"),clipboardValue:JSON.stringify(t),children:(0,I.jsxs)(i.s,{direction:"column",gap:1,children:[t.map((function(e){var t=e.url,n=e.title;return(0,I.jsxs)(ae.N,{href:t,target:"_blank",children:[(0,I.jsx)(s.I,{data:oe.A})," ",n]},t)})),0===t.length&&(0,I.jsx)(j.E,{variant:"code-1",children:"[]"})]})})};const pe=JSON.parse('{"context":"MCP table schema answer component for AI chat","title_table-schema":"MCP table schema answer"}'),me=JSON.parse('{"context":"Компонент ответа MCP схемы таблицы для AI чата","title_table-schema":"Ответ MCP схемы таблицы"}'),he=(0,T.Kc)("yt:ai.chat.mcp-schema-answer",{en:pe,ru:me});var ve=function(e){var t=e.value,n=e.className;return(0,I.jsx)(de,{className:n,title:he("title_table-schema"),clipboardValue:JSON.stringify(t),children:(0,I.jsx)(j.E,{variant:"code-1",children:t})})};const ge=JSON.parse('{"title_unknown-mcp-call":"MCP Call"}'),xe=JSON.parse('{"title_unknown-mcp-call":"MCP вызов"}'),ye=(0,T.Kc)("yt:ai.chat.mcp-unknown-answer",{en:ge,ru:xe});var be=function(e){var t=e.name,n=e.value,r=e.className,a=JSON.stringify(n,null,2);return(0,I.jsx)(de,{className:r,title:"".concat(ye("title_unknown-mcp-call"),": ").concat(t),clipboardValue:a,children:(0,I.jsx)(j.E,{variant:"code-1",children:a})})},we=function(e,t){switch(e.type){case"error":return(0,I.jsx)(Q.z,{className:t,error:e.error});case"answer":return(0,I.jsx)(re,{className:t,message:e});case"mcp_search_answer":return(0,I.jsx)(fe,{className:t,value:e.value});case"mcp_table_schema_answer":return(0,I.jsx)(ve,{className:t,value:e.value});case"mcp_unknown_answer":return(0,I.jsx)(be,{className:t,name:e.name,value:e.value});default:return(0,I.jsx)("div",{className:t,children:e.value})}},je=(0,o.A)("yt-ai-chat-message"),Ae=function(e){var t=e.message,n=e.className,r="question"===t.type,a=Z.Ay.getAiChatMessageComponent(t,je("body"));return(0,I.jsx)(i.s,{justifyContent:r?"flex-end":"flex-start",className:je({question:r},n),gap:1,children:a||we(t,je("body"))})},Ne=n(56201),Ce=n(20239);const Te=JSON.parse('{"action_load-older":"Load older messages"}'),ke=JSON.parse('{"action_load-older":"Загрузить предыдущие сообщения"}'),_e=(0,T.Kc)("yt:ai.chat.messages",{en:Te,ru:ke});var Ee=function(){var e=(0,d.w)(),t=(0,d.d)(p.id),n=t.items,r=t.hasMore,a=t.loading;return(0,I.jsxs)(I.Fragment,{children:[r&&(0,I.jsx)(i.s,{justifyContent:"center",alignItems:"center",direction:"column",children:a?(0,I.jsx)(Ne.a,{size:"s"}):(0,I.jsxs)(l.$,{view:"outlined",onClick:function(){e((0,m.hO)())},disabled:a,children:[(0,I.jsx)(s.I,{data:Ce.A,size:16}),_e("action_load-older")]})}),n.map((function(e){var t="id"in e?e.id:e.error.message;return(0,I.jsx)(Ae,{message:e},t)}))]})};Ee.displayName="Messages";var Se=(0,o.A)("current-answer"),Le=function(e){var t=e.className;return(0,I.jsxs)("div",{className:Se("loading-dots",t),children:[(0,I.jsx)("span",{className:Se("dot")}),(0,I.jsx)("span",{className:Se("dot")}),(0,I.jsx)("span",{className:Se("dot")})]})},Ie=function(e){var t=e.className,n=(0,d.d)(p.gj);return(0,d.d)(p.bG)&&!n?(0,I.jsx)(Le,{className:t}):n?(0,I.jsx)(Ae,{className:t,message:{id:"current-answer",type:"answer",state:"progress",value:n}}):null},Me=n(14424),Be=n(60192),Re=n(21135);const Oe=JSON.parse('{"context":"Chat history component","context_no-conversations":"You have no conversations"}'),ze=JSON.parse('{"context":"Компонент истории чатов","context_no-conversations":"У вас нет истории чатов"}'),He=(0,T.Kc)("yt:ai.chat.history",{en:Oe,ru:ze});var Pe=n(73822),Ve=(0,o.A)("yt-chart-history-item"),De=function(e){var t=e.id,n=e.topic,r=e.onClick,a=e.onDelete;return(0,I.jsxs)(i.s,{className:Ve(),grow:1,alignItems:"center",justifyContent:"space-between",onClick:function(){return r(t)},children:[(0,I.jsx)(j.E,{ellipsis:!0,children:n||t}),(0,I.jsx)(l.$,{className:Ve("remove-button"),onClick:function(e){e.stopPropagation(),a(t)},view:"flat",children:(0,I.jsx)(s.I,{data:C.A,size:16})})]})},$e=(0,o.A)("yt-chart-history"),Je=function(){var e=(0,d.w)(),t=(0,d.d)(p.a$),n=(0,d.d)(p.eA),r=(0,d.d)(p.nv),o=function(t){e((0,m.Io)(t))},l=function(t){e((0,m.ly)(t))},s=(0,a.useCallback)((function(){e((0,m.Yj)())}),[e]);return t.length?(0,I.jsxs)("div",{className:$e(),children:[t.map((function(e){return(0,I.jsxs)("div",{className:$e("group"),children:[(0,I.jsx)("div",{className:$e("group-header"),children:(0,I.jsx)(j.E,{color:"secondary",children:Pe.A.format.DateTime(e.date,{format:"day"})})}),(0,I.jsx)(Me.B,{className:$e("list"),filterable:!1,items:e.items,renderItem:function(e,t){var n;return(0,I.jsx)(De,{id:e.id,topic:null===(n=e.metadata)||void 0===n?void 0:n.topic,onClick:o,onDelete:l})},itemHeight:40,virtualized:!1})]},e.date)})),n&&(0,I.jsx)(Re.P,{className:$e("pagination"),loading:r,onLoadMore:s})]}):(0,I.jsx)(i.s,{justifyContent:"center",alignItems:"center",grow:1,children:(0,I.jsx)(Be.R,{warning:He("context_no-conversations"),vertical:!0})})},Ke=n(80908),Fe=n(54736),qe=(0,o.A)("yt-ai-chat-body"),Ue=function(e){var t,n=e.isUserScrolledUp,r=e.scrollToBottom,o=e.checkScrollPosition,l=(0,a.useRef)(null),s=(0,d.d)(p.xS),c=(0,d.d)(p.bG),u=(0,d.d)(p.RP),f=(0,d.d)(p.X3),m=(0,d.d)(p.lb),h=(0,a.useCallback)((function(){o(),c&&!n&&r()}),[o,n,c,r]);return(0,Ke.A)({element:u&&null!==(t=l.current)&&void 0!==t?t:void 0,onResize:h}),m?(0,I.jsx)(i.s,{alignItems:"center",justifyContent:"center",grow:1,children:(0,I.jsx)(Fe.z,{error:m})}):s?(0,I.jsx)(i.s,{alignItems:"center",justifyContent:"center",grow:1,children:(0,I.jsx)(Ne.a,{})}):u?(0,I.jsxs)("div",{ref:l,className:qe("messages"),children:[(0,I.jsx)(Ee,{}),(0,I.jsx)(Ie,{className:qe("current-answer")})]}):f?(0,I.jsx)(Je,{}):(0,I.jsx)(W,{})},Ge=(0,o.A)("yt-ai-chat");const Ye=function(){var e=(0,a.useState)(!0),t=(0,r.A)(e,2),n=t[0],o=t[1],l=(0,a.useState)(!1),s=(0,r.A)(l,2),i=s[0],c=s[1],u=(0,a.useRef)(null),d=(0,a.useCallback)((function(){if(u.current){var e=u.current,t=e.scrollTop,n=e.scrollHeight-(t+e.clientHeight)<50;o(n),c(!n)}}),[]),f=(0,a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";u.current&&u.current.scrollTo({top:u.current.scrollHeight,behavior:e})}),[]),p=(0,a.useCallback)((function(){d()}),[d]);return(0,a.useEffect)((function(){var e=u.current;if(e)return e.addEventListener("scroll",p),function(){e.removeEventListener("scroll",p)}}),[p]),(0,I.jsxs)("div",{ref:u,className:Ge(),children:[(0,I.jsx)(U,{className:Ge("header")}),(0,I.jsx)(Ue,{scrollToBottom:f,checkScrollPosition:d,isUserScrolledUp:i}),(0,I.jsx)(P,{showScrollButton:!n,onScrollClick:function(){return f("smooth")}})]})}},41347:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 1.5A.75.75 0 0 0 10 3h1.94L6.97 7.97a.75.75 0 0 0 1.06 1.06L13 4.06V6a.75.75 0 0 0 1.5 0V2.25a.75.75 0 0 0-.75-.75zM7.5 3.25a.75.75 0 0 0-.75-.75H4.5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h6a3 3 0 0 0 3-3V9.25a.75.75 0 0 0-1.5 0v2.25a1.5 1.5 0 0 1-1.5 1.5h-6A1.5 1.5 0 0 1 3 11.5v-6A1.5 1.5 0 0 1 4.5 4h2.25a.75.75 0 0 0 .75-.75",clipRule:"evenodd"})}))}},49779:()=>{(()=>{var e,t,n,r,a,o,l,s,i,c,u,d,f=Object.create,p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,x=(e={"node_modules/get-root-node-polyfill/index.js"(e,t){function n(e){var t=r(e);return function(e){return"#document-fragment"===e.nodeName&&"ShadowRoot"===e.constructor.name}(t)?n(t.host):t}function r(e){return null!=e.parentNode?r(e.parentNode):e}"object"==typeof t&&t.exports&&(t.exports=function(e){return"object"==typeof e&&Boolean(e.composed)?n(this):r(this)})}},function(){return t||(0,e[h(e)[0]])((t={exports:{}}).exports,t),t.exports});n="yfm-tab-panel",r="active",a="data-diplodoc-group",o="data-diplodoc-key",l=Symbol.for("diplodocTabs"),s=e=>{let t=e.composedPath();return Array.isArray(t)&&t.length>0?t[0]:e.target},i=e=>{let t=s(e);return!t||!t.matches},c=e=>Math.abs(e.scrollHeight-e.clientHeight)>1?e:e.parentElement?c(e.parentElement):void 0,u=(e,t)=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{top:n.top-r.top,left:n.left-r.left,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}},d={TABS:".yfm-tabs",TAB_LIST:".yfm-tab-list",TAB:".yfm-tab",TAB_PANEL:`.${n}`,VERTICAL_TABS:".yfm-tabs-vertical"},"undefined"!=typeof window&&"undefined"!=typeof document&&!window[l]&&(window[l]=new class{constructor(e){this._onSelectTabHandlers=new Set,this._document=e,this._document.addEventListener("click",(e=>{let t=s(e),n=this.areTabsVertical(t);if(i(e)||!this.isValidTabElement(t)&&!n)return;let r=this.getTabDataFromHTMLElement(t);r&&this._selectTab(r,t)})),this._document.addEventListener("keydown",(e=>{let t=null;switch(e.key){case"ArrowLeft":t="left";break;case"ArrowRight":t="right"}if(!t)return;let n=s(e);if(i(e)||!this.isValidTabElement(n))return;let{tabs:r,nodes:a}=this.getTabs(n),o=this.getTabDataFromHTMLElement(n),l=r.findIndex((({key:e})=>(null==o?void 0:o.key)&&e===o.key));if(!o||r.length<=1||-1===l)return;let c=(l+("left"===t?-1:1)+r.length)%r.length;this.selectTab(r[c]),a[c].focus()}))}onSelectTab(e){return this._onSelectTabHandlers.add(e),()=>{this._onSelectTabHandlers.delete(e)}}selectTabById(e,t){let n=this._document.querySelector(`${d.TAB}[data-diplodoc-id="${e}"]`);if(!n||!this.isValidTabElement(n))return;let r=this.getTabDataFromHTMLElement(n);r&&this._selectTab(r,n),null!=t&&t.scrollToElement&&n.scrollIntoView()}selectTab(e){this._selectTab(e)}_selectTab(e,t){let{group:n,key:r,align:a}=e;if(!n)return;let o=t&&c(t),l=o&&u(t,o);this.updateHTML({group:n,key:r,align:a},a)>0&&(this.fireSelectTabEvent({group:n,key:r,align:a},null==t?void 0:t.dataset.diplodocId),l&&this.resetScroll(t,o,l))}updateHTML(e,t){switch(t){case"vertical":return this.updateHTMLVertical(e);case"horizontal":return this.updateHTMLHorizontal(e)}return 0}updateHTMLVertical(e){let{group:t,key:n}=e,[r]=this._document.querySelectorAll(`${d.TABS}[${a}="${t}"] ${d.TAB}[${o}="${n}"]`),l=0,s=r.parentNode.children;for(let e=0;e<s.length;e+=2){let[t,n]=[s.item(e),s.item(e+1)],a=t.children.item(0);a.hasAttribute("checked")&&(t.classList.remove("active"),null==n||n.classList.remove("active"),a.removeAttribute("checked")),t===r&&(t.classList.add("active"),null==n||n.classList.add("active"),a.setAttribute("checked","true")),l++}return l}updateHTMLHorizontal(e){let{group:t,key:l}=e,s=this._document.querySelectorAll(`${d.TABS}[${a}="${t}"] ${d.TAB}[${o}="${l}"]`),i=0;return s.forEach((e=>{let t=e;if(!this.isValidTabElement(t)||"true"===t.dataset.diplodocIsActive)return;i++;let a=e,o=a.parentNode,l=null==o?void 0:o.parentNode,s=Array.from((null==o?void 0:o.querySelectorAll(d.TAB))||[]),c=Array.from((null==l?void 0:l.children)||[]).filter((e=>e.classList.contains(n))),u=s.indexOf(a);s.forEach(((e,t)=>{let n=c[t],a=t===u;e.dataset.diplodocIsActive=a?"true":"false",e.classList.toggle(r,a),e.setAttribute("aria-selected",a.toString()),e.setAttribute("tabindex",a?"0":"-1"),n.classList.toggle(r,a)}))})),i}resetScroll(e,t,n){let r=u(e,t),a=r.top-n.top,o=r.left-n.left,l=r.scrollTop-n.scrollTop,s=r.scrollLeft-n.scrollLeft;t.scrollTo(t.scrollLeft+o-s,t.scrollTop+a-l)}fireSelectTabEvent(e,t){let{group:n,key:r,align:a}=e,o=n.startsWith("defaultTabsGroup-")?{key:r,align:a}:e;this._onSelectTabHandlers.forEach((e=>{e({tab:o,currentTabId:t})}))}isValidTabElement(e){let t=e.matches(d.TAB)&&e.dataset.diplodocId?e.closest(d.TAB_LIST):null;return null==t?void 0:t.closest(d.TABS)}areTabsVertical(e){let t=e.parentElement;return e.dataset.diplodocVerticalTab||!(null==t||!t.dataset.diplodocVerticalTab)}getTabDataFromHTMLElement(e){var t,n;if(this.areTabsVertical(e)){let n=e.dataset.diplodocVerticalTab?e:e.parentElement,r=n.dataset.diplodocKey,a=null==(t=n.closest(d.TABS))?void 0:t.dataset.diplodocGroup;return r&&a?{group:a,key:r,align:"vertical"}:null}let r=e.dataset.diplodocKey,a=null==(n=e.closest(d.TABS))?void 0:n.dataset.diplodocGroup;return r&&a?{group:a,key:r,align:"horizontal"}:null}getTabs(e){var t,n;let r=null==(t=e.closest(d.TABS))?void 0:t.dataset.diplodocGroup,a=null==(n=e.closest(d.TAB_LIST))?void 0:n.querySelectorAll(d.TAB),o=[];return a.forEach((e=>{let t=null==e?void 0:e.dataset.diplodocKey;t&&o.push({group:r,key:t,align:"horizontal"})})),{tabs:o,nodes:a}}}(document));var y=((e,t,n)=>(n=null!=e?f(v(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of h(t))g.call(e,n)||undefined===n||p(e,n,{get:()=>t[n],enumerable:!(r=m(t,n))||r.enumerable});return e})(e&&e.__esModule?n:p(n,"default",{value:e,enumerable:!0}),e)))(x());"undefined"!=typeof document&&function(e){const t=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector;e.matches=e.matchesSelector=t||function(t){const n=(e.getRootNode?e.getRootNode():y.default.call(e)).querySelectorAll(t),r=this;return Array.prototype.some.call(n,(e=>e===r))}}(Element.prototype);var b=e=>{const t=e.composedPath();return Array.isArray(t)&&t.length>0?t[0]:e.target},w=e=>{const t=b(e);return!t||!t.matches};"undefined"!=typeof document&&document.addEventListener("click",(e=>{const t=b(e);if(w(e)||!t.matches(".yfm-clipboard-button"))return;const n=t.parentNode;if(!n)return;const r=n.querySelector("pre code");r&&function(e){if(!e)return Promise.resolve();if(navigator.clipboard&&(navigator.clipboard.writeText,1))return navigator.clipboard.writeText(e);const t=document.createElement("textarea");return t.setAttribute("style","position: absolute; left: 1000%"),t.textContent=e,document.body.append(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}(r.innerText).then((()=>{!function(e){if(!e)return;const t=e.getAttribute("data-animation"),n=e.getRootNode().getElementById(`visibileAnimation-${t}`);n&&n.beginElement()}(n.querySelector(".yfm-clipboard-button"))}))}));var j=".yfm .yfm-cut-title";function A(e){var t;return e instanceof HTMLElement&&(null==(t=null==e?void 0:e.matches)?void 0:t.call(e,j))}"undefined"!=typeof document&&document.addEventListener("click",(e=>{if(w(e))return;const t=function(e){var t;const n=b(e);if(A(n))return n;const r=null==(t=e.composedPath)?void 0:t.call(e);return null==r?void 0:r.find(A)}(e);t&&function(e){const t=e.parentNode;t instanceof HTMLElement&&t.classList.toggle("open")}(t)}));var N={TITLE:".yfm .yfm-term_title",CONTENT:".yfm .yfm-term_dfn"},C="open",T=N.CONTENT.replace(/\./g,"")+" "+C,k=!0;function _(e,t){const{x:n,y:r,right:a,left:o,width:l,height:s}=t.getBoundingClientRect(),i=S(t);if(!i)return;const{right:c,left:u}=i.getBoundingClientRect();if((c<o||u>a)&&!k)return void L(e);k&&i&&(i.addEventListener("scroll",E),k=!1);const d=Number(e.getAttribute("relativeX")),f=Number(e.getAttribute("relativeY"));if(d===n&&f===r)return;e.setAttribute("relativeX",String(n)),e.setAttribute("relativeY",String(r));const p=s+5,m=e.parentElement;if(!m)return;const{width:h}=e.getBoundingClientRect(),{left:v}=m.getBoundingClientRect(),g=Number(I(t).left),x=g-h<0,y=(h+g>document.body.clientWidth||"rtl"===document.dir)&&!x?h-l:0,b=I(m).top-m.offsetTop;e.style.top=Number(I(t).top+p-b)+"px",e.style.left=Number(I(t).left-v+m.offsetLeft-y)+"px"}function E(){const e=document.getElementsByClassName(T)[0];if(!e)return;const t=e.getAttribute("term-id")||"",n=document.getElementById(t);n&&_(e,n)}function S(e){return e?e.closest("table")||e.closest("code")||e.parentElement:null}function L(e){e.classList.remove(C);const t=e.getAttribute("term-id")||"",n=S(document.getElementById(t));n&&(n.removeEventListener("scroll",E),k=!0)}function I(e){const t=e.getBoundingClientRect(),n=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||n.scrollTop,o=window.pageXOffset||r.scrollLeft||n.scrollLeft,l=r.clientTop||n.clientTop||0,s=r.clientLeft||n.clientLeft||0,i=t.top+a-l,c=t.left+o-s;return{top:Math.round(i),left:Math.round(c)}}"undefined"!=typeof document&&(document.addEventListener("click",(e=>{const t=document.getElementsByClassName(T)[0],n=b(e),r=n.getAttribute("id"),a=n.getAttribute("term-key");let o=document.getElementById(a+"_element");if(a&&!o&&(o=function(e){var t;const n=e.getAttribute("term-key"),r=document.getElementById(`${n}_template`),a=null==r?void 0:r.content.cloneNode(!0).firstChild;return null==(t=null==r?void 0:r.parentElement)||t.appendChild(a),r.remove(),a}(n)),t&&r===t.getAttribute("term-id"))return void L(t);const l=n.closest([N.CONTENT.replace(" ",""),C].join("."));t&&!l&&L(t),!w(e)&&n.matches(N.TITLE)&&o&&(function(e,t){const n=t.getAttribute("id")||Math.random().toString(36).substr(2,8);null==e||e.setAttribute("term-id",n)}(o,n),_(o,n),o.classList.toggle(C))})),document.addEventListener("keydown",(e=>{const t=document.getElementsByClassName(T)[0];"Escape"===e.key&&t&&L(t)})),window.addEventListener("resize",(()=>{const e=document.getElementsByClassName(T)[0];if(!e)return;const t=e.getAttribute("term-id")||"",n=document.getElementById(t);n?_(e,n):e.classList.toggle(C)})))})()},51036:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(77810);const a=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",clipRule:"evenodd"}))},51188:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",clipRule:"evenodd"})}))}},59241:(e,t,n)=>{n.d(t,{x:()=>u}),n(77810);var r=n(76872),a=n(21211),o=n(1335),l=n(45760),s=n(30469),i=n(64922),c=(0,r.A)("popup-with-close-button"),u=function(e){var t=e.anchorRef,n=e.open,r=e.onClose,u=e.children,d=e.className,f=e.placement,p=void 0===f?"bottom":f;return(0,i.jsxs)(a.z,{anchorElement:t.current,open:n,className:c(null,d),onOpenChange:function(e,t,n){e||"outside-press"!==n||r()},placement:p,children:[(0,i.jsx)(o.$,{view:"flat",className:c("close-button"),onClick:r,children:(0,i.jsx)(l.I,{data:s.A})}),u]})}},63308:(e,t,n)=>{n.d(t,{y:()=>y,A:()=>b});var r=n(77810),a=n(76872),o=n(29121),l=n(12937),s=n(66134),i=n(10785),c=n(56796),u=n(64922),d=(0,a.A)("yt-file-picker"),f=function(e){function t(){var e;(0,o.A)(this,t);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return(e=(0,s.A)(this,t,[].concat(a))).inputRef=r.createRef(),e.onLinkClick=function(){e.inputRef.current&&e.inputRef.current.click()},e.onChange=function(t){e.props.onChange(t.target.files)},e}return(0,i.A)(t,e),(0,l.A)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.multiple;return(0,u.jsxs)(c.S,{onClick:this.onLinkClick,children:[t,(0,u.jsx)("input",{ref:this.inputRef,className:d("input"),onChange:this.onChange,type:"file",multiple:n})]})}}])}(r.Component),p=n(9736);var m=n(92611);const h=JSON.parse('{"context_drag-file":"Drag a file here","context_drop-file":"Drop file here","or":"or","action_pick-file":"Pick a file"}'),v=JSON.parse('{"context_drag-file":"Перетащите файл сюда","context_drop-file":"Отпустите файл здесь","or":"или","action_pick-file":"Выберите файл"}'),g=(0,m.Kc)("yt:component.file-drop-zone",{en:h,ru:v});var x=(0,a.A)("file-drop-zone"),y=function(e){var t=e.isDropable,n=e.onFile,a=e.isEmpty,o=e.children,l=function(e){var t=(0,r.useState)(!1),n=(0,p.A)(t,2),a=n[0],o=n[1];return{onDragOver:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation()}),[]),onDragEnter:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation(),o(!0)}),[]),onDragLeave:(0,r.useCallback)((function(e){e.preventDefault(),e.stopPropagation(),o(!1)}),[]),onDrop:(0,r.useCallback)((function(t){t.preventDefault(),t.stopPropagation(),o(!1);var n=t.dataTransfer.files;n&&e(n)}),[e]),isDragging:a}}(n),s=l.onDrop,i=l.onDragOver,c=l.onDragEnter,d=l.onDragLeave,m=l.isDragging;return(0,u.jsx)("div",{className:x("drag-area",{dropable:t,empty:a,dragging:m}),onDrop:s,onDragEnter:c,onDragLeave:d,onDragOver:i,children:o||(0,u.jsxs)("div",{className:x("info"),children:[(0,u.jsx)("div",{children:g(m?"context_drop-file":"context_drag-file")}),g("or"),(0,u.jsx)("div",{children:(0,u.jsx)(f,{onChange:n,children:g("action_pick-file")})})]})})};const b=y},64945:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 14.75a.75.75 0 0 1-.75-.75V3.81L4.53 6.53a.75.75 0 0 1-1.06-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06L8.75 3.81V14a.75.75 0 0 1-.75.75",clipRule:"evenodd"})}))}},75299:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(77810),a=function(e,t){return"boolean"==typeof t?t:!e};const o=function(e){return(0,r.useReducer)(a,e)}},78485:(e,t,n)=>{n.d(t,{I:()=>s});var r=n(64922),a=n(51036),o=n(45760);const l=(0,n(47999).om)("arrow-toggle");function s({size:e=16,direction:t="bottom",className:n,qa:s}){return(0,r.jsx)("span",{style:{width:e,height:e},className:l({direction:t},n),"data-qa":s,children:(0,r.jsx)(o.I,{data:a.A,size:e})})}},79703:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14M6.44 4.54c.43-.354.994-.565 1.56-.565 1.217 0 2.34.82 2.34 2.14 0 .377-.078.745-.298 1.1-.208.339-.513.614-.875.867-.217.153-.325.257-.379.328-.038.052-.038.07-.038.089a.75.75 0 0 1-1.5 0c0-.794.544-1.286 1.057-1.645.28-.196.4-.332.458-.426a.54.54 0 0 0 .075-.312c0-.3-.244-.641-.84-.641a1 1 0 0 0-.608.223c-.167.138-.231.287-.231.418a.75.75 0 0 1-1.5 0c0-.674.345-1.22.78-1.577M8 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2",clipRule:"evenodd"})}))}},88150:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(40319),a=n(64922);const o=function(e){return(0,a.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m9.77 10.73.01-.01 3.08-3.08a3.889 3.889 0 1 0-5.5-5.5L4.73 4.77l-.01.01-1.667 1.666a5.303 5.303 0 0 0 7.5 7.5l3.167-3.166a.75.75 0 1 0-1.061-1.06l-3.166 3.166a3.803 3.803 0 1 1-5.379-5.379L5.33 6.291l.011-.01L8.421 3.2a2.39 2.39 0 0 1 3.38 3.378l-1.13 1.13-.012.012-2.995 2.994a.975.975 0 1 1-1.378-1.378L9.28 6.34a.75.75 0 0 0-1.06-1.06L5.225 8.274a2.475 2.475 0 0 0 3.5 3.5z",clipRule:"evenodd"})}))}},94119:(e,t,n)=>{n.d(t,{f:()=>g});var r=n(64922),a=n(77810),o=n(53359),l=n(99621),s=n(49533),i=n(48617),c=n(47999),u=n(44712),d=n(56254),f=n(2960),p=n(19333);const m=(0,c.om)("text-area");function h(e){const{name:t,id:n,tabIndex:o,autoComplete:s,placeholder:i,value:c,defaultValue:u,controlRef:d,controlProps:f,size:h,rows:v,minRows:g=1,maxRows:x,autoFocus:y,disabled:b,readOnly:w,onChange:j,onFocus:A,onBlur:N,onKeyDown:C,onKeyUp:T,onKeyPress:k}=e,_=a.useRef(null),E=(0,l.N)(d,_),S=Math.max(v||g,1),L=c||_?.current?.value,I=a.useCallback((()=>{const e=_?.current,t=e?.parentElement;if(e&&t&&!v){const n=getComputedStyle(e),r=parseInt(n.getPropertyValue("line-height"),10),a=parseInt(n.getPropertyValue("padding-top"),10),o=parseInt(n.getPropertyValue("padding-bottom"),10),l=(L?.match(/\n/g)||[]).length+1,s=t.style.height;t.style.height=`${t.offsetHeight}px`,e.style.height=`${r+a+o}px`;const i=e.style.overflow;e.style.overflow="hidden";const c=(e=>{const{height:t,lineHeight:n}=e;return(t-(Number.isNaN(e.paddingTop)?0:e.paddingTop)-(Number.isNaN(e.paddingBottom)?0:e.paddingBottom))/n})({height:e.scrollHeight,paddingTop:a,paddingBottom:o,lineHeight:r}),u=Math.max(c,l);e.style.height=x&&x<u?`${x*r+a+o}px`:g&&g>u?`${Math.min(g,x||1/0)*r+a+o}px`:`${e.scrollHeight}px`,e.style.overflow=i,t.style.height=s}}),[v,x,g,L]);return(0,p.w)({ref:v?void 0:_,onResize:I}),a.useEffect((()=>{I()}),[I,h,c]),(0,r.jsx)("textarea",{...f,ref:E,style:{...f.style,height:v?"auto":void 0},className:m("control",f.className),name:t,id:n,tabIndex:o,placeholder:i,value:c,defaultValue:u,rows:S,autoFocus:y,autoComplete:s,onChange:j,onFocus:A,onBlur:N,onKeyDown:C,onKeyUp:T,onKeyPress:k,disabled:b??f.disabled,readOnly:w??f.readOnly})}const v=(0,c.om)("text-area"),g=a.forwardRef((function(e,t){const{view:n="normal",size:c="m",pin:p="round-round",name:m,value:g,defaultValue:x,disabled:y,readOnly:b,hasClear:w=!1,error:j,errorMessage:A,validationState:N,autoComplete:C,id:T,tabIndex:k,style:_,className:E,qa:S,controlProps:L,note:I,onUpdate:M,onChange:B}=e,{errorMessage:R,validationState:O}=(0,f.Av)({error:j,errorMessage:A,validationState:N}),[z,H]=(0,o.P)(g,x??"",M),P=a.useRef(null),V=(0,i.d)({initialValue:z,onReset:H}),D=(0,l.N)(e.controlRef,P,V),[$,J]=a.useState(!1),K=(0,f.lf)(O),F=(0,s.u)(),q="invalid"===O&&Boolean(R),U=Boolean(w&&!y&&!b&&z),G=T||F,Y=(0,s.u)(),X=(0,s.u)(),W=[L?.["aria-describedby"],I?X:void 0,q?Y:void 0].filter(Boolean).join(" "),Z={id:G,tabIndex:k,name:m,onChange(e){H(e.target.value),B&&B(e)},autoComplete:(0,f.o$)(C),controlProps:{...L,"aria-describedby":W||void 0,"aria-invalid":"invalid"===O||void 0}};return a.useEffect((()=>{const e=P.current;if(e){const t=e.scrollHeight>e.clientHeight;$!==t&&J(t)}}),[z,$]),(0,r.jsxs)("span",{ref:t,style:_,className:v({view:n,size:c,disabled:y,state:K,pin:"clear"===n?void 0:p,"has-clear":U,"has-scrollbar":$},E),"data-qa":S,children:[(0,r.jsxs)("span",{className:v("content"),children:[(0,r.jsx)(h,{...e,...Z,controlRef:D}),U&&(0,r.jsx)(u.k,{className:v("clear",{size:c}),size:(0,u.v)(c),onClick:e=>{const t=P.current;if(t){t.focus();const n=Object.create(e);n.target=t,n.currentTarget=t,t.value="",B&&B(n)}H("")}})]}),(0,r.jsx)(d.o,{errorMessage:q?R:null,errorMessageId:Y,note:I,noteId:X})]})}))}}]);
|
|
2
|
+
//# sourceMappingURL=code-assistant-chat.a7927638.chunk.js.map
|