@questdb/web-console 1.1.12 → 1.2.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/assets/icon-chart.svg +1 -1
- package/dist/assets/icon-file.svg +1 -6
- package/dist/assets/index-Blrq3gwz.css +45 -0
- package/dist/assets/index-DU6JLCfQ.js +6600 -0
- package/dist/assets/index-ZyLe708n.js +1046 -0
- package/dist/assets/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/dist/assets/vs/base/worker/workerMain.js +22 -18
- package/dist/assets/vs/editor/editor.main.css +4 -2
- package/dist/assets/vs/editor/editor.main.js +310 -257
- package/dist/assets/vs/loader.js +1 -1
- package/dist/index.html +2 -2
- package/package.json +7 -5
- package/dist/assets/icon-explain-queries.svg +0 -3
- package/dist/assets/icon-explain-schema.svg +0 -3
- package/dist/assets/icon-fix-queries.svg +0 -3
- package/dist/assets/icon-generate-queries.svg +0 -3
- package/dist/assets/index-BD25QvPt.js +0 -5816
- package/dist/assets/index-B_bwGdkq.css +0 -45
- package/dist/assets/index-CASK4XST.js +0 -1011
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.de.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.es.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.fr.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.it.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ja.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ko.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ru.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.zh-cn.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.zh-tw.js +0 -8
- package/dist/assets/vs/editor/editor.main.nls.js +0 -29
|
@@ -0,0 +1,1046 @@
|
|
|
1
|
+
import{p as Q,Q as ft,s as ce,u as _e,a as et,j as r,A as tt,K as Nt,c as p,B as pe,b as nt,e as be,d as St,f as D,g as na,h as pt,i as Ft,k as aa,C as xt,l as Dt,m as Ce,n as ra,T as ia,o as qt,q as Rt,r as Tt,t as yt,v as qe,w as X,x as Ze,y as bt,z as sa,D as Re,E as oa,F as xe,G as Ct,H as la,I as zt,J as Te,L as Ve,M as ca,N as da,O as ua,P as ha,R as ma,S as ze,U as at,V as wt,W as ga,X as fa,Y as Ot,Z as pa,_ as kt,$ as vt,a0 as ye,a1 as xa,a2 as ya,a3 as ba,a4 as Ca,a5 as wa,a6 as ka,a7 as va,a8 as Aa,a9 as Ma,aa as Ha,ab as ja,ac as Ea,ad as _a,ae as Za,af as de,ag as Va,ah as Ia,ai as La,aj as Bt,ak as Ie,al as Na,am as Sa,an as Fa,ao as Da,ap as qa,aq as rt,ar as Ra,as as it,at as $t,au as Wt,av as Ta,aw as Pt,ax as za,ay as Oa,az as Ba}from"./index-DU6JLCfQ.js";import{b as t,E as ue,H as g,Z as Ut,R as Qt,C as J,U as Kt,D as $a}from"./vendor-DsPrTxrp.js";const Wa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),t.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),Pa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),t.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Ua=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M88,128a16,16,0,1,1,16,16A16,16,0,0,1,88,128Zm64,16a16,16,0,1,0-16-16A16,16,0,0,0,152,144Zm84-80V192a20,20,0,0,1-20,20H84.47L53,239.17l-.12.11A19.91,19.91,0,0,1,40.05,244a20.14,20.14,0,0,1-8.49-1.9A19.82,19.82,0,0,1,20,224V64A20,20,0,0,1,40,44H216A20,20,0,0,1,236,64Zm-24,4H44V215.23l28.16-24.32A11.93,11.93,0,0,1,80,188H212Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),t.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM84,140a12,12,0,1,1,12-12A12,12,0,0,1,84,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,172,140Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM84,118a10,10,0,1,0,10,10A10,10,0,0,0,84,118Zm88,0a10,10,0,1,0,10,10A10,10,0,0,0,172,118Zm58-54V192a14,14,0,0,1-14,14H82.23L49.07,234.64l-.06.05A13.87,13.87,0,0,1,40,238a14.11,14.11,0,0,1-5.95-1.33A13.88,13.88,0,0,1,26,224V64A14,14,0,0,1,40,50H216A14,14,0,0,1,230,64Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V224a2,2,0,0,0,3.26,1.55l34.82-30.08A6,6,0,0,1,80,194H216a2,2,0,0,0,2-2Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-52-8a8,8,0,1,0,8,8A8,8,0,0,0,84,120Zm88,0a8,8,0,1,0,8,8A8,8,0,0,0,172,120Zm56-56V192a12,12,0,0,1-12,12H81.49L47.76,233.13l0,0A11.89,11.89,0,0,1,40,236a12.17,12.17,0,0,1-5.1-1.14A11.89,11.89,0,0,1,28,224V64A12,12,0,0,1,40,52H216A12,12,0,0,1,228,64Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V224a4,4,0,0,0,6.56,3.08L77.38,197A4,4,0,0,1,80,196H216a4,4,0,0,0,4-4Z"}))]]),Qa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),t.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),Ka=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),t.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Ga=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M236,137A108.13,108.13,0,1,1,119,20,12,12,0,0,1,121,44,84.12,84.12,0,1,0,212,135,12,12,0,1,1,236,137ZM116,76v52a12,12,0,0,0,12,12h52a12,12,0,0,0,0-24H140V76a12,12,0,0,0-24,0Zm92,20a16,16,0,1,0-16-16A16,16,0,0,0,208,96ZM176,64a16,16,0,1,0-16-16A16,16,0,0,0,176,64Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,96a12,12,0,1,1,12,12A12,12,0,0,1,208,96ZM196,72a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm28.66,56a8,8,0,0,0-8.63,7.31A88.12,88.12,0,1,1,120.66,40,8,8,0,0,0,119.34,24,104.12,104.12,0,1,0,232,136.66,8,8,0,0,0,224.66,128ZM128,56a72,72,0,1,1-72,72A72.08,72.08,0,0,1,128,56Zm-8,72a8,8,0,0,0,8,8h48a8,8,0,0,0,0-16H136V80a8,8,0,0,0-16,0Zm40-80a12,12,0,1,0-12-12A12,12,0,0,0,160,48Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M230,136.49A102.12,102.12,0,1,1,119.51,26a6,6,0,0,1,1,12A90.13,90.13,0,1,0,218,135.51a6,6,0,1,1,12,1ZM122,72v56a6,6,0,0,0,6,6h56a6,6,0,0,0,0-12H134V72a6,6,0,0,0-12,0Zm38-26a10,10,0,1,0-10-10A10,10,0,0,0,160,46Zm36,24a10,10,0,1,0-10-10A10,10,0,0,0,196,70Zm24,36a10,10,0,1,0-10-10A10,10,0,0,0,220,106Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,136.33A100.13,100.13,0,1,1,119.67,28a4,4,0,1,1,.66,8A92.13,92.13,0,1,0,220,135.67a4,4,0,1,1,8,.66ZM128,132h56a4,4,0,0,0,0-8H132V72a4,4,0,0,0-8,0v56A4,4,0,0,0,128,132Zm32-88a8,8,0,1,0-8-8A8,8,0,0,0,160,44Zm36,24a8,8,0,1,0-8-8A8,8,0,0,0,196,68Zm24,36a8,8,0,1,0-8-8A8,8,0,0,0,220,104Z"}))]]),Xa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),t.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]),Ja=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M51.51,104.49l-32-32a12,12,0,0,1,0-17l32-32a12,12,0,1,1,17,17L45,64,68.49,87.51a12,12,0,0,1-17,17Zm48,0a12,12,0,0,0,17,0l32-32a12,12,0,0,0,0-17l-32-32a12,12,0,1,0-17,17L123,64,99.51,87.51A12,12,0,0,0,99.51,104.49ZM200,36H180a12,12,0,0,0,0,24h16V196H60V140a12,12,0,0,0-24,0v60a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M152,32V96a16,16,0,0,1-16,16H32A16,16,0,0,1,16,96V32A16,16,0,0,1,32,16H136A16,16,0,0,1,152,32Z",opacity:"0.2"}),t.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,40H168a16,16,0,0,0-16-16H32A16,16,0,0,0,16,40v80a16,16,0,0,0,16,16h8v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM106.34,61.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L124.69,80Zm-64,24a8,8,0,0,1,0-11.32l24-24A8,8,0,0,1,77.66,61.66L59.31,80,77.66,98.34a8,8,0,0,1-11.32,11.32ZM200,200H56V136h96a16,16,0,0,0,16-16V56h32Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M59.76,100.24l-32-32a6,6,0,0,1,0-8.48l32-32a6,6,0,1,1,8.48,8.48L40.49,64,68.24,91.76a6,6,0,1,1-8.48,8.48Zm40,0a6,6,0,0,0,8.48,0l32-32a6,6,0,0,0,0-8.48l-32-32a6,6,0,1,0-8.48,8.48L127.51,64,99.76,91.76A6,6,0,0,0,99.76,100.24ZM200,42H176a6,6,0,0,0,0,12h24a2,2,0,0,1,2,2V200a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V136a6,6,0,0,0-12,0v64a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M61.17,98.83l-32-32a4,4,0,0,1,0-5.66l32-32a4,4,0,0,1,5.66,5.66L37.66,64,66.83,93.17a4,4,0,0,1-5.66,5.66Zm40,0a4,4,0,0,0,5.66,0l32-32a4,4,0,0,0,0-5.66l-32-32a4,4,0,0,0-5.66,5.66L130.34,64,101.17,93.17A4,4,0,0,0,101.17,98.83ZM200,44H176a4,4,0,0,0,0,8h24a4,4,0,0,1,4,4V200a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V136a4,4,0,0,0-8,0v64a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Z"}))]]),Ya=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M209.88,69.83A115.19,115.19,0,0,0,128,36h-.41C63.85,36.22,12,88.76,12,153.13V176a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V152A115.25,115.25,0,0,0,209.88,69.83ZM220,172H127.32l46.44-65A12,12,0,1,0,154.24,93L97.82,172H36V153.13c0-1.72,0-3.43.14-5.13H56a12,12,0,0,0,0-24H40.62c10.91-33.39,40-58.52,75.38-63.21V80a12,12,0,0,0,24,0V60.8A92,92,0,0,1,215.66,124H200a12,12,0,0,0,0,24h19.9c.06,1.33.1,2.66.1,4Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,152v24a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V153.13C24,95.65,70.15,48.2,127.63,48A104,104,0,0,1,232,152Z",opacity:"0.2"}),t.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,152v24a16,16,0,0,1-16,16H115.93a4,4,0,0,1-3.24-6.35L174.27,101a8.21,8.21,0,0,0-1.37-11.3,8,8,0,0,0-11.37,1.61l-72,99.06A4,4,0,0,1,86.25,192H32a16,16,0,0,1-16-16V153.13c0-1.79,0-3.57.13-5.33a4,4,0,0,1,4-3.8H48a8,8,0,0,0,8-8.53A8.17,8.17,0,0,0,47.73,128H23.92a4,4,0,0,1-3.87-5c12-43.84,49.66-77.13,95.52-82.28a4,4,0,0,1,4.43,4V72a8,8,0,0,0,8.53,8A8.17,8.17,0,0,0,136,71.73V44.67a4,4,0,0,1,4.43-4A112.18,112.18,0,0,1,236.23,123a4,4,0,0,1-3.88,5H208.27a8.17,8.17,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h27.92a4,4,0,0,1,4,3.86C240,149.23,240,150.61,240,152Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M205.65,74.08A109.26,109.26,0,0,0,128,42h-.39C67.17,42.21,18,92.06,18,153.13V176a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V152A109.3,109.3,0,0,0,205.65,74.08ZM226,176a2,2,0,0,1-2,2H115.78l57.07-78.47a6,6,0,0,0-9.7-7.06L100.94,178H32a2,2,0,0,1-2-2V153.13A102.36,102.36,0,0,1,30.62,142H56a6,6,0,0,0,0-12H32.71C42.6,88.4,78.53,56.86,122,54.19V80a6,6,0,0,0,12,0V54.19A98.05,98.05,0,0,1,223.53,130H200a6,6,0,0,0,0,12h25.5c.33,3.3.5,6.64.5,10Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M204.23,75.5A107.37,107.37,0,0,0,127.62,44C68.28,44.21,20,93.16,20,153.13V176a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V152A107.25,107.25,0,0,0,204.23,75.5ZM228,176a4,4,0,0,1-4,4H111.85l59.38-81.65a4,4,0,1,0-6.46-4.7L102,180H32a4,4,0,0,1-4-4V153.13A103.42,103.42,0,0,1,28.84,140H56a4,4,0,0,0,0-8H30.21C39.59,87.66,77.84,53.93,124,52.09V80a4,4,0,0,0,8,0V52.08A100.08,100.08,0,0,1,226,132H200a4,4,0,0,0,0,8h27.29a101.6,101.6,0,0,1,.71,12Z"}))]]),er=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M71.51,144.49a12,12,0,0,1,0-17l24-24a12,12,0,0,1,17,17L109,124h55V104a12,12,0,0,1,24,0v32a12,12,0,0,1-12,12H109l3.52,3.51a12,12,0,0,1-17,17ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),t.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-32,96a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M182,104v32a6,6,0,0,1-6,6H94.48l13.76,13.76a6,6,0,1,1-8.48,8.48l-24-24a6,6,0,0,1,0-8.48l24-24a6,6,0,0,1,8.48,8.48L94.48,130H170V104a6,6,0,0,1,12,0Zm48-48V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M180,104v32a4,4,0,0,1-4,4H89.66l17.17,17.17a4,4,0,0,1-5.66,5.66l-24-24a4,4,0,0,1,0-5.66l24-24a4,4,0,0,1,5.66,5.66L89.66,132H172V104a4,4,0,0,1,8,0Zm48-48V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),tr=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),t.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),nr=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),t.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),ar=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),rr=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),t.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),Gt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Wa}));Gt.displayName="ArrowCounterClockwiseIcon";const Xt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Pa}));Xt.displayName="ArrowUpIcon";const Jt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ua}));Jt.displayName="ChatDotsIcon";const Yt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Qa}));Yt.displayName="ChatTextIcon";const en=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ka}));en.displayName="CheckIcon";const tn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ga}));tn.displayName="ClockCountdownIcon";const nn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Xa}));nn.displayName="ClockCounterClockwiseIcon";const an=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ja}));an.displayName="CodeBlockIcon";const rn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ya}));rn.displayName="GaugeIcon";const sn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:er}));sn.displayName="KeyReturnIcon";const on=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:tr}));on.displayName="MagnifyingGlassIcon";const ln=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:nr}));ln.displayName="PencilSimpleLineIcon";const cn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:ar}));cn.displayName="PlusIcon";const dn=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:rr}));dn.displayName="TrashSimpleIcon";const ir=g(D).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
|
|
2
|
+
color: `,`;
|
|
3
|
+
`],({theme:e})=>e.color.pinkPrimary),sr=nt.isMacintosh||nt.isIOS?"\u2318":"Ctrl",or=nt.isMacintosh||nt.isIOS?"Cmd+E":"Ctrl+E",lr=g(pe).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
`]),cr=({conversationId:e,queryText:n})=>{const{quest:a}=t.useContext(ft),i=ue(ce.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:u}=_e(),{addMessage:f,updateMessage:m,updateConversationName:c,persistMessages:w,setIsStreaming:y}=et(),x=()=>{be(St({conversationId:e,queryText:n,settings:{model:d,apiKey:u},questClient:a,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:f,updateMessage:m,setStatus:l,setIsStreaming:y,persistMessages:w,updateConversationName:c})};return r.jsxs(lr,{skin:"gradient",gradientWeight:"thin",onClick:x,title:`Explain query with AI Assistant (${or})`,"data-hook":"button-explain-query",children:[r.jsx(tt,{size:12,variant:"hollow"}),"Explain query",r.jsxs(ir,{children:[r.jsx(Nt,{keyString:sr,color:p("pinkPrimary"),hoverColor:p("pinkPrimary")}),r.jsx(Nt,{keyString:"E",color:p("pinkPrimary"),hoverColor:p("pinkPrimary")})]})]})},un=(e,n,a,i)=>{if(!(a!=null&&a.current)||!i.current)return null;const l=i.current.getModel();if(!l)return null;const o=a.current[n.toString()];if(!o)return null;const s=o[e];if(!s||!s.error)return null;const d=s.selection?s.selection.startOffset:s.startOffset,u=s.selection?s.selection.endOffset:s.endOffset,f=l.getPositionAt(d),m=l.getPositionAt(d+s.error.position),c=l.getWordAtPosition(m),w=l.getPositionAt(u),y=s.selection?l.getValueInRange({startLineNumber:f.lineNumber,startColumn:f.column,endLineNumber:w.lineNumber,endColumn:w.column}):na(e).queryText;return{errorMessage:s.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:u,queryText:y}},dr=g(pe).withConfig({displayName:"FixQueryButton__FixButton"})([`
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
`]),ur=()=>{const{quest:e}=t.useContext(ft),{editorRef:n,executionRefs:a}=pt(),i=ue(ce.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:u}=_e(),{chatWindowState:f,getConversationMeta:m,addMessage:c,updateMessage:w,updateConversationName:y,persistMessages:x,setIsStreaming:A}=et(),M=()=>{const H=f.activeConversationId,C=m(H),k=un(C.queryKey,C.bufferId,a,n),{errorMessage:j,queryText:E,word:q}=k;be(Ft({conversationId:H,queryText:E,errorMessage:j,errorWord:q??void 0,settings:{model:d,apiKey:u},questClient:e,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:c,updateMessage:w,setStatus:l,setIsStreaming:A,persistMessages:x,updateConversationName:y})};return r.jsxs(dr,{skin:"gradient",gradientWeight:"thin",onClick:M,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[r.jsx(tt,{size:12,variant:"hollow"}),"Fix query"]})},hn=g.div.withConfig({displayName:"AssistantModesCompact__Container"})([`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 0.4rem;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
overflow-x: hidden;
|
|
15
|
+
min-height: 0;
|
|
16
|
+
`]),mn=g.div.withConfig({displayName:"AssistantModesCompact__ModeHeader"})([`
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
|
|
21
|
+
`,`
|
|
22
|
+
`,`
|
|
23
|
+
gap: 0.8rem;
|
|
24
|
+
`],({$expanded:e})=>e?J([`
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
`]):J([`
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
padding: 0.4rem;
|
|
31
|
+
`]),({$abort:e})=>e&&J([`
|
|
32
|
+
opacity: 0.7;
|
|
33
|
+
`])),At=g.div.withConfig({displayName:"AssistantModesCompact__ModeChevron"})([`
|
|
34
|
+
width: 1.4rem;
|
|
35
|
+
height: 1.4rem;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
color: `,`;
|
|
41
|
+
margin-left: -0.3rem;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
transition:
|
|
44
|
+
color 0.2s,
|
|
45
|
+
transform 0.2s;
|
|
46
|
+
transform: rotate(`,`);
|
|
47
|
+
`],p("gray2"),({$expanded:e})=>e?"90deg":"0deg"),Mt=g.div.withConfig({displayName:"AssistantModesCompact__ModeTitle"})([`
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
font-size: 1.4rem;
|
|
50
|
+
color: `,`;
|
|
51
|
+
text-align: center;
|
|
52
|
+
margin-right: auto;
|
|
53
|
+
transition: color 0.2s;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
|
|
56
|
+
`,`
|
|
57
|
+
`,`
|
|
58
|
+
`],p("gray2"),({$isActive:e})=>e&&Tt,({$isTopLevel:e})=>e&&J([`
|
|
59
|
+
color: `,`;
|
|
60
|
+
`],p("foreground"))),gn=g.div.withConfig({displayName:"AssistantModesCompact__ModeHeaderTop"})([`
|
|
61
|
+
display: flex;
|
|
62
|
+
gap: 0.8rem;
|
|
63
|
+
align-items: center;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
`,`
|
|
66
|
+
`,`
|
|
67
|
+
`,`
|
|
68
|
+
`],({$expanded:e})=>e&&J([`
|
|
69
|
+
padding: 0.4rem;
|
|
70
|
+
`]),({$expanded:e})=>!e&&J([`
|
|
71
|
+
min-height: 0;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
`]),({$isExpandable:e})=>e&&J([`
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
user-select: none;
|
|
76
|
+
&:hover `,", &:hover ",` {
|
|
77
|
+
color: `,`;
|
|
78
|
+
}
|
|
79
|
+
`],Mt,At,p("foreground"))),fn=g.div.withConfig({displayName:"AssistantModesCompact__ExpandableWrapper"})([`
|
|
80
|
+
display: grid;
|
|
81
|
+
grid-template-rows: `,`;
|
|
82
|
+
transition:
|
|
83
|
+
grid-template-rows 0.1s ease-out,
|
|
84
|
+
opacity 0.3s ease-out;
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
`,`
|
|
88
|
+
`],({$expanded:e})=>e?"1fr":"0fr",({$expanded:e})=>!e&&J([`
|
|
89
|
+
height: 0;
|
|
90
|
+
opacity: 0;
|
|
91
|
+
`])),pn=g.div.withConfig({displayName:"AssistantModesCompact__ExpandableContent"})([`
|
|
92
|
+
min-height: 0;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
`]),hr=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningThread"})([`
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
gap: 0.8rem;
|
|
98
|
+
align-items: flex-start;
|
|
99
|
+
padding: 0 2.8rem;
|
|
100
|
+
`]),st=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningItem"})([`
|
|
101
|
+
display: flex;
|
|
102
|
+
gap: 0.5rem;
|
|
103
|
+
align-items: center;
|
|
104
|
+
padding: 0.4rem;
|
|
105
|
+
padding-left: 0;
|
|
106
|
+
`]),Oe=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningIcon"})([`
|
|
107
|
+
width: 1.4rem;
|
|
108
|
+
height: 1.4rem;
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
color: `,`;
|
|
114
|
+
`],p("foreground")),ot=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningText"})([`
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-wrap: wrap;
|
|
117
|
+
gap: 0.4rem;
|
|
118
|
+
align-items: center;
|
|
119
|
+
min-height: 0;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
`]),Y=g.span.withConfig({displayName:"AssistantModesCompact__ReasoningTextPart"})([`
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
font-size: 1.4rem;
|
|
124
|
+
color: `,`;
|
|
125
|
+
`],p("gray2")),we=g.div.withConfig({displayName:"AssistantModesCompact__CodeBadge"})([`
|
|
126
|
+
background: `,`;
|
|
127
|
+
border: 1px solid `,`;
|
|
128
|
+
border-radius: 0.4rem;
|
|
129
|
+
padding: 0 0.4rem;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
transform: translateY(1px);
|
|
134
|
+
`],p("background"),p("selection")),ke=g.span.withConfig({displayName:"AssistantModesCompact__CodeBadgeText"})([`
|
|
135
|
+
font-family: `,`;
|
|
136
|
+
font-size: 1.2rem;
|
|
137
|
+
color: `,`;
|
|
138
|
+
`],({theme:e})=>e.fontMonospace,p("purple")),mr=g(en).withConfig({displayName:"AssistantModesCompact__CheckIcon"})([`
|
|
139
|
+
width: 1.6rem;
|
|
140
|
+
height: 1.6rem;
|
|
141
|
+
color: `,`;
|
|
142
|
+
flex-shrink: 0;
|
|
143
|
+
`],p("pink")),gr=g(Rt).withConfig({displayName:"AssistantModesCompact__CloseCircleIcon"})([`
|
|
144
|
+
color: `,`;
|
|
145
|
+
flex-shrink: 0;
|
|
146
|
+
`],p("red")),fr=({size:e=20})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 256 256",style:{flexShrink:0},children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"checkCircleGradient",x1:"128",x2:"128",y1:"24",y2:"232",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#d14671"}),r.jsx("stop",{offset:"1",stopColor:"#892c6c"})]})}),r.jsx("path",{fill:"url(#checkCircleGradient)",d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})]}),pr=g.div.withConfig({displayName:"AssistantModesCompact__CollapsedSectionsWrapper"})([`
|
|
147
|
+
display: flex;
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
gap: 0.8rem;
|
|
150
|
+
padding-left: 2.8rem;
|
|
151
|
+
`]),xr=(e,n)=>{if(e===Ce.Processing&&n&&"type"in n)switch(n.type){case"fix":return"Processing fix request";case"explain":return"Processing explain request";default:return e}return e},xn=e=>[Ce.InvestigatingTable,Ce.InvestigatingDocs].includes(e.type),yr=({operationHistory:e,status:n,isLive:a=!1,onScrollNeeded:i,collapsed:l=!1,responseStart:o})=>{const s=Ut(),[d,u]=t.useState({}),[f,m]=t.useState(!1),c=t.useRef(0),w=t.useRef(null),y=t.useMemo(()=>aa(e,n,a),[e,n,a]),x=t.useRef(a);t.useEffect(()=>{if(x.current&&!a){const C={};y.forEach(k=>{C[k.id]=!0}),u(C)}else if(a&&y.length>c.current){const C={};y.forEach((k,j)=>{j<y.length-1&&(C[k.id]=!0)}),u(C),i==null||i()}c.current=y.length,x.current=a},[y,a,i]);const A=C=>{u(k=>{const j=y.find(Z=>Z.id===C),E=j?xn(j):!1,q=y.findIndex(Z=>Z.id===C)===y.length-1,L=l?!1:a?q:!0;return k[C]===void 0?{...k,[C]:L&&E}:{...k,[C]:!k[C]}})},M=t.useMemo(()=>{var j;if(e.length===0)return null;const C=(j=e[0])==null?void 0:j.timestamp;if(!C||!o)return null;const k=o-C;return k<0?null:k<1e3?`${k}ms`:`${Math.round(k/1e3)}s`},[e,o]);if(e.length===0)return null;const H=y.map((C,k)=>{const j=xn(C),E=k===y.length-1,q=l?!1:a?E:!0,L=d[C.id]===void 0?q&&j:!d[C.id]&&j;return r.jsxs(mn,{$expanded:L,$abort:C.abort,children:[r.jsxs(gn,{$expanded:L,$isExpandable:j,"data-hook":`assistant-mode-${C.type.toLowerCase().replace(/\s+/g,"-")}`,role:"presentation",onClick:j?()=>A(C.id):void 0,children:[r.jsx(Oe,{children:C.active?r.jsx(xt,{size:14}):C.abort?r.jsx(gr,{size:14}):r.jsx(mr,{})}),r.jsx(Mt,{$isActive:C.active,children:C.type}),j&&r.jsx(At,{$expanded:L,children:r.jsx(Dt,{size:14})})]}),j&&r.jsx(fn,{$expanded:L,children:r.jsx(pn,{children:r.jsx(hr,{children:C.operations.map((Z,S)=>{const h=`${C.id}-${S}-${JSON.stringify(Z.args)}`;if(Z.type===Ce.Processing){const I=xr(Z.type,Z.args);return r.jsxs(st,{children:[r.jsx(Oe,{children:r.jsx(ra,{style:{width:"14px",height:"14px"}})}),r.jsx(ot,{children:r.jsx(Y,{children:I})})]},h)}if(Z.type===Ce.InvestigatingTable){const I=Z.args&&"name"in Z.args?Z.args.name:"table",F=Z.args&&"tableOpType"in Z.args?Z.args.tableOpType:"details";return r.jsxs(st,{children:[r.jsx(Oe,{children:r.jsx(ia,{size:14,color:s.color.gray2})}),r.jsxs(ot,{children:[r.jsx(Y,{children:"Investigating"}),r.jsx(we,{children:r.jsx(ke,{children:I})}),r.jsx(Y,{children:F})]})]},h)}if(Z.type===Ce.InvestigatingDocs){const I=Z.args&&"items"in Z.args&&Array.isArray(Z.args.items)?Z.args.items:null;if(I&&I.length>0)return r.jsx(Qt.Fragment,{children:I.map((z,re)=>{const Ae=`${h}-item-${re}`;return r.jsxs(st,{children:[r.jsx(Oe,{children:r.jsx(qt,{size:14,color:s.color.gray2})}),r.jsx(ot,{children:z.section?r.jsxs(r.Fragment,{children:[r.jsx(Y,{children:"Investigating"}),r.jsx(we,{children:r.jsx(ke,{children:z.section})}),r.jsx(Y,{children:"in"}),r.jsx(we,{children:r.jsx(ke,{children:z.name})})]}):r.jsxs(r.Fragment,{children:[r.jsx(Y,{children:"Investigating"}),r.jsx(we,{children:r.jsx(ke,{children:z.name})})]})})]},Ae)})},h);const F=Z.args&&"name"in Z.args?Z.args.name:null,ee=Z.args&&"section"in Z.args?Z.args.section:null;return r.jsxs(st,{children:[r.jsx(Oe,{children:r.jsx(qt,{size:14})}),r.jsx(ot,{children:F&&ee?r.jsxs(r.Fragment,{children:[r.jsx(Y,{children:"Investigating"}),r.jsx(we,{children:r.jsx(ke,{children:ee})}),r.jsx(Y,{children:"in"}),r.jsx(we,{children:r.jsx(ke,{children:F})}),r.jsx(Y,{children:"documentation"})]}):F?r.jsxs(r.Fragment,{children:[r.jsx(Y,{children:"Investigating"}),r.jsx(we,{children:r.jsx(ke,{children:F})}),r.jsx(Y,{children:"documentation"})]}):r.jsx(Y,{children:"Investigating documentation"})})]},h)}return null})})})})]},C.id)});return l?r.jsx(hn,{ref:w,"data-hook":"assistant-modes-container",children:r.jsxs(mn,{$expanded:f,$abort:!1,children:[r.jsxs(gn,{$expanded:f,$isExpandable:!0,onClick:()=>m(C=>!C),"data-hook":"assistant-mode-processing-collapsed",role:"presentation",children:[r.jsx(fr,{size:20}),r.jsx(Mt,{$isActive:!1,children:M?`Thought for ${M}`:"Thought"}),r.jsx(At,{$expanded:f,children:r.jsx(Dt,{size:14})})]}),r.jsx(fn,{$expanded:f,children:r.jsx(pn,{children:r.jsx(pr,{children:H})})})]})}):r.jsx(hn,{ref:w,"data-hook":"assistant-modes-container",children:H})},br={tokenize:Mr,partial:!0},yn={tokenize:Hr,partial:!0},bn={tokenize:jr,partial:!0},Cn={tokenize:Er,partial:!0},Cr={tokenize:_r,partial:!0},wn={tokenize:vr,previous:vn},kn={tokenize:Ar,previous:An},he={tokenize:kr,previous:Mn},se={},wr={text:se};let ve=48;for(;ve<123;)se[ve]=he,ve++,ve===58?ve=65:ve===91&&(ve=97);se[43]=he,se[45]=he,se[46]=he,se[95]=he,se[72]=[he,kn],se[104]=[he,kn],se[87]=[he,wn],se[119]=[he,wn];function kr(e,n,a){const i=this;let l,o;return s;function s(c){return!Ht(c)||!Mn.call(i,i.previous)||jt(i.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return Ht(c)?(e.consume(c),d):c===64?(e.consume(c),u):a(c)}function u(c){return c===46?e.check(Cr,m,f)(c):c===45||c===95||yt(c)?(o=!0,e.consume(c),u):m(c)}function f(c){return e.consume(c),l=!0,u}function m(c){return o&&l&&qe(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):a(c)}}function vr(e,n,a){const i=this;return l;function l(s){return s!==87&&s!==119||!vn.call(i,i.previous)||jt(i.events)?a(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(br,e.attempt(yn,e.attempt(bn,o),a),a)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(s)}}function Ar(e,n,a){const i=this;let l="",o=!1;return s;function s(c){return(c===72||c===104)&&An.call(i,i.previous)&&!jt(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(qe(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const w=l.toLowerCase();if(w==="http"||w==="https")return e.consume(c),u}return a(c)}function u(c){return c===47?(e.consume(c),o?f:(o=!0,u)):a(c)}function f(c){return c===null||sa(c)||X(c)||Ze(c)||bt(c)?a(c):e.attempt(yn,e.attempt(bn,m),a)(c)}function m(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Mr(e,n,a){let i=0;return l;function l(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),l):s===46&&i===3?(e.consume(s),o):a(s)}function o(s){return s===null?a(s):n(s)}}function Hr(e,n,a){let i,l,o;return s;function s(f){return f===46||f===95?e.check(Cn,u,d)(f):f===null||X(f)||Ze(f)||f!==45&&bt(f)?u(f):(o=!0,e.consume(f),s)}function d(f){return f===95?i=!0:(l=i,i=void 0),e.consume(f),s}function u(f){return l||i||!o?a(f):n(f)}}function jr(e,n){let a=0,i=0;return l;function l(s){return s===40?(a++,e.consume(s),l):s===41&&i<a?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Cn,n,o)(s):s===null||X(s)||Ze(s)?n(s):(e.consume(s),l)}function o(s){return s===41&&i++,e.consume(s),l}}function Er(e,n,a){return i;function i(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),i):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||X(d)||Ze(d)?n(d):a(d)}function l(d){return d===null||d===40||d===91||X(d)||Ze(d)?n(d):i(d)}function o(d){return qe(d)?s(d):a(d)}function s(d){return d===59?(e.consume(d),i):qe(d)?(e.consume(d),s):a(d)}}function _r(e,n,a){return i;function i(o){return e.consume(o),l}function l(o){return yt(o)?a(o):n(o)}}function vn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function An(e){return!qe(e)}function Mn(e){return!(e===47||Ht(e))}function Ht(e){return e===43||e===45||e===46||e===95||yt(e)}function jt(e){let n=e.length,a=!1;for(;n--;){const i=e[n][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const Zr={tokenize:qr,partial:!0};function Vr(){return{document:{91:{tokenize:Sr,continuation:{tokenize:Fr},exit:Dr}},text:{91:{tokenize:Nr},93:{add:"after",tokenize:Ir,resolveTo:Lr}}}}function Ir(e,n,a){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;l--;){const u=i.events[l][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return d;function d(u){if(!s||!s._balanced)return a(u);const f=Re(i.sliceSerialize({start:s.end,end:i.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?a(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function Lr(e,n){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[a+1],e[a+2],["enter",i,n],e[a+3],e[a+4],["enter",l,n],["exit",l,n],["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",i,n]];return e.splice(a,e.length-a+1,...d),e}function Nr(e,n,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return d;function d(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?a(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(c){if(o>999||c===93&&!s||c===null||c===91||X(c))return a(c);if(c===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return l.includes(Re(i.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(c)}return X(c)||(s=!0),o++,e.consume(c),c===92?m:f}function m(c){return c===91||c===92||c===93?(e.consume(c),o++,f):f(c)}}function Sr(e,n,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,d;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):a(x)}function m(x){if(s>999||x===93&&!d||x===null||x===91||X(x))return a(x);if(x===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=Re(i.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return X(x)||(d=!0),s++,e.consume(x),x===92?c:m}function c(x){return x===91||x===92||x===93?(e.consume(x),s++,m):m(x)}function w(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),l.includes(o)||l.push(o),xe(e,y,"gfmFootnoteDefinitionWhitespace")):a(x)}function y(x){return n(x)}}function Fr(e,n,a){return e.check(oa,n,e.attempt(Zr,n,a))}function Dr(e){e.exit("gfmFootnoteDefinition")}function qr(e,n,a){const i=this;return xe(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?n(o):a(o)}}function Rr(e){let n=(e||{}).singleTilde;const a={tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function i(o,s){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let u=d;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[d][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[d][1].end)},m={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[d][1].start)},c=[["enter",f,s],["enter",o[u][1],s],["exit",o[u][1],s],["enter",m,s]],w=s.parser.constructs.insideSpan.null;w&&Ct(c,c.length,0,la(w,o.slice(u+1,d),s)),Ct(c,c.length,0,[["exit",m,s],["enter",o[d][1],s],["exit",o[d][1],s],["exit",f,s]]),Ct(o,u-1,d-u+3,c),d=u+c.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,s,d){const u=this.previous,f=this.events;let m=0;return c;function c(y){return u===126&&f[f.length-1][1].type!=="characterEscape"?d(y):(o.enter("strikethroughSequenceTemporary"),w(y))}function w(y){const x=zt(u);if(y===126)return m>1?d(y):(o.consume(y),m++,w);if(m<2&&!n)return d(y);const A=o.exit("strikethroughSequenceTemporary"),M=zt(y);return A._open=!M||M===2&&!!x,A._close=!x||x===2&&!!M,s(y)}}}class Tr{constructor(){this.map=[]}add(n,a,i){zr(this,n,a,i)}consume(n){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(n.slice(this.map[a][0]+this.map[a][1])),i.push(this.map[a][2]),n.length=this.map[a][0];i.push([...n]),n.length=0;let l=i.pop();for(;l;)n.push(...l),l=i.pop();this.map.length=0}}function zr(e,n,a,i){let l=0;if(!(a===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=a,e.map[l][2].push(...i);return}l+=1}e.map.push([n,a,i])}}function Or(e,n){let a=!1;const i=[];for(;n<e.length;){const l=e[n];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return i}const Br={flow:{null:{tokenize:$r,resolveAll:Wr}}};function $r(e,n,a){const i=this;let l=0,o=0,s;return d;function d(h){let I=i.events.length-1;for(;I>-1;){const z=i.events[I][1].type;if(z==="lineEnding"||z==="linePrefix")I--;else break}const F=I>-1?i.events[I][1].type:null,ee=F==="tableHead"||F==="tableRow"?q:u;return ee===q&&i.parser.lazy[i.now().line]?a(h):ee(h)}function u(h){return e.enter("tableHead"),e.enter("tableRow"),f(h)}function f(h){return h===124||(s=!0,o+=1),m(h)}function m(h){return h===null?a(h):Te(h)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),y):a(h):Ve(h)?xe(e,m,"whitespace")(h):(o+=1,s&&(s=!1,l+=1),h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),s=!0,m):(e.enter("data"),c(h)))}function c(h){return h===null||h===124||X(h)?(e.exit("data"),m(h)):(e.consume(h),h===92?w:c)}function w(h){return h===92||h===124?(e.consume(h),c):c(h)}function y(h){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(h):(e.enter("tableDelimiterRow"),s=!1,Ve(h)?xe(e,x,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):x(h))}function x(h){return h===45||h===58?M(h):h===124?(s=!0,e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),A):E(h)}function A(h){return Ve(h)?xe(e,M,"whitespace")(h):M(h)}function M(h){return h===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),H):h===45?(o+=1,H(h)):h===null||Te(h)?j(h):E(h)}function H(h){return h===45?(e.enter("tableDelimiterFiller"),C(h)):E(h)}function C(h){return h===45?(e.consume(h),C):h===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(h))}function k(h){return Ve(h)?xe(e,j,"whitespace")(h):j(h)}function j(h){return h===124?x(h):h===null||Te(h)?!s||l!==o?E(h):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(h)):E(h)}function E(h){return a(h)}function q(h){return e.enter("tableRow"),L(h)}function L(h){return h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),L):h===null||Te(h)?(e.exit("tableRow"),n(h)):Ve(h)?xe(e,L,"whitespace")(h):(e.enter("data"),Z(h))}function Z(h){return h===null||h===124||X(h)?(e.exit("data"),L(h)):(e.consume(h),h===92?S:Z)}function S(h){return h===92||h===124?(e.consume(h),Z):Z(h)}}function Wr(e,n){let a=-1,i=!0,l=0,o=[0,0,0,0],s=[0,0,0,0],d=!1,u=0,f,m,c;const w=new Tr;for(;++a<e.length;){const y=e[a],x=y[1];y[0]==="enter"?x.type==="tableHead"?(d=!1,u!==0&&(Hn(w,n,u,f,m),m=void 0,u=0),f={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},w.add(a,0,[["enter",f,n]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,a+1,0,0],d&&(d=!1,m={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},w.add(a,0,[["enter",m,n]])),l=x.type==="tableDelimiterRow"?2:m?3:1):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=lt(w,n,o,l,void 0,c),o=[0,0,0,0]),s[2]=a)):x.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=lt(w,n,o,l,void 0,c)),o=s,s=[o[1],a,0,0])):x.type==="tableHead"?(d=!0,u=a):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=a,o[1]!==0?(s[0]=s[1],c=lt(w,n,o,l,a,c)):s[1]!==0&&(c=lt(w,n,s,l,a,c)),l=0):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=a)}for(u!==0&&Hn(w,n,u,f,m),w.consume(n.events),a=-1;++a<n.events.length;){const y=n.events[a];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=Or(n.events,a))}return e}function lt(e,n,a,i,l,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(o.end=Object.assign({},Le(n.events,a[0])),e.add(a[0],0,[["exit",o,n]]));const u=Le(n.events,a[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(a[1],0,[["enter",o,n]]),a[2]!==0){const f=Le(n.events,a[2]),m=Le(n.events,a[3]),c={type:d,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(a[2],0,[["enter",c,n]]),i!==2){const w=n.events[a[2]],y=n.events[a[3]];if(w[1].end=Object.assign({},y[1].end),w[1].type="chunkText",w[1].contentType="text",a[3]>a[2]+1){const x=a[2]+1,A=a[3]-a[2]-1;e.add(x,A,[])}}e.add(a[3]+1,0,[["exit",c,n]])}return l!==void 0&&(o.end=Object.assign({},Le(n.events,l)),e.add(l,0,[["exit",o,n]]),o=void 0),o}function Hn(e,n,a,i,l){const o=[],s=Le(n.events,a);l&&(l.end=Object.assign({},s),o.push(["exit",l,n])),i.end=Object.assign({},s),o.push(["exit",i,n]),e.add(a+1,0,o)}function Le(e,n){const a=e[n],i=a[0]==="enter"?"start":"end";return a[1][i]}const Pr={tokenize:Qr},Ur={text:{91:Pr}};function Qr(e,n,a){const i=this;return l;function l(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return X(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):a(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(u)}function d(u){return Te(u)?n(u):Ve(u)?e.check({tokenize:Kr},n,a)(u):a(u)}}function Kr(e,n,a){return xe(e,i,"whitespace");function i(l){return l===null?a(l):n(l)}}function Gr(e){return ca([wr,Vr(),Rr(e),Br,Ur])}function jn(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,l=a.indexOf(n);for(;l!==-1;)i++,l=a.indexOf(n,l+n.length);return i}function Xr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Jr={}.hasOwnProperty,Yr=(function(e,n,a,i){let l,o;typeof n=="string"||n instanceof RegExp?(o=[[n,a]],l=i):(o=n,l=a),l||(l={});const s=da(l.ignore||[]),d=ei(o);let u=-1;for(;++u<d.length;)ua(e,"text",f);return e;function f(c,w){let y=-1,x;for(;++y<w.length;){const A=w[y];if(s(A,x?x.children.indexOf(A):void 0,x))return;x=A}if(x)return m(c,w)}function m(c,w){const y=w[w.length-1],x=d[u][0],A=d[u][1];let M=0;const H=y.children.indexOf(c);let C=!1,k=[];x.lastIndex=0;let j=x.exec(c.value);for(;j;){const E=j.index,q={index:j.index,input:j.input,stack:[...w,c]};let L=A(...j,q);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L!==!1&&(M!==E&&k.push({type:"text",value:c.value.slice(M,E)}),Array.isArray(L)?k.push(...L):L&&k.push(L),M=E+j[0].length,C=!0),!x.global)break;j=x.exec(c.value)}return C?(M<c.value.length&&k.push({type:"text",value:c.value.slice(M)}),y.children.splice(H,1,...k)):k=[c],H+k.length}});function ei(e){const n=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let a=-1;for(;++a<e.length;)n.push([En(e[a][0]),_n(e[a][1])])}else{let a;for(a in e)Jr.call(e,a)&&n.push([En(a),_n(e[a])])}return n}function En(e){return typeof e=="string"?new RegExp(Xr(e),"g"):e}function _n(e){return typeof e=="function"?e:()=>e}const Et="phrasing",_t=["autolink","link","image","label"],ti={transforms:[li],enter:{literalAutolink:ai,literalAutolinkEmail:Zt,literalAutolinkHttp:Zt,literalAutolinkWww:Zt},exit:{literalAutolink:oi,literalAutolinkEmail:si,literalAutolinkHttp:ri,literalAutolinkWww:ii}},ni={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Et,notInConstruct:_t},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Et,notInConstruct:_t},{character:":",before:"[ps]",after:"\\/",inConstruct:Et,notInConstruct:_t}]};function ai(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zt(e){this.config.enter.autolinkProtocol.call(this,e)}function ri(e){this.config.exit.autolinkProtocol.call(this,e)}function ii(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.url="http://"+this.sliceSerialize(e)}function si(e){this.config.exit.autolinkEmail.call(this,e)}function oi(e){this.exit(e)}function li(e){Yr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ci],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,di]],{ignore:["link","linkReference"]})}function ci(e,n,a,i,l){let o="";if(!Zn(l)||(/^w/i.test(n)&&(a=n+a,n="",o="http://"),!ui(a)))return!1;const s=hi(a+i);if(!s[0])return!1;const d={type:"link",title:null,url:o+n+s[0],children:[{type:"text",value:n+s[0]}]};return s[1]?[d,{type:"text",value:s[1]}]:d}function di(e,n,a,i){return!Zn(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function ui(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function hi(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],i=a.indexOf(")");const l=jn(e,"(");let o=jn(e,")");for(;i!==-1&&l>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function Zn(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Ze(a)||bt(a))&&(!n||a!==47)}function Vn(e){return e.label||!e.identifier?e.label||"":ha(e.identifier)}function mi(e,n,a){const i=n.indexStack,l=e.children||[],o=n.createTracker(a),s=[];let d=-1;for(i.push(-1);++d<l.length;){const u=l[d];i[i.length-1]=d,s.push(o.move(n.handle(u,e,n,{before:`
|
|
152
|
+
`,after:`
|
|
153
|
+
`,...o.current()}))),u.type!=="list"&&(n.bulletLastUsed=void 0),d<l.length-1&&s.push(o.move(gi(u,l[d+1],e,n)))}return i.pop(),s.join("")}function gi(e,n,a,i){let l=i.join.length;for(;l--;){const o=i.join[l](e,n,a,i);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
154
|
+
`.repeat(1+o);if(o===!1)return`
|
|
155
|
+
|
|
156
|
+
<!---->
|
|
157
|
+
|
|
158
|
+
`}return`
|
|
159
|
+
|
|
160
|
+
`}const fi=/\r?\n|\r/g;function pi(e,n){const a=[];let i=0,l=0,o;for(;o=fi.exec(e);)s(e.slice(i,o.index)),a.push(o[0]),i=o.index+o[0].length,l++;return s(e.slice(i)),a.join("");function s(d){a.push(n(d,l,!d))}}function In(e){if(!e._compiled){const n=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function xi(e,n){return Ln(e,n.inConstruct,!0)&&!Ln(e,n.notInConstruct,!1)}function Ln(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let i=-1;for(;++i<n.length;)if(e.includes(n[i]))return!0;return!1}function Nn(e,n,a){const i=(a.before||"")+(n||"")+(a.after||""),l=[],o=[],s={};let d=-1;for(;++d<e.unsafe.length;){const m=e.unsafe[d];if(!xi(e.stack,m))continue;const c=In(m);let w;for(;w=c.exec(i);){const y="before"in m||!!m.atBreak,x="after"in m,A=w.index+(y?w[1].length:0);l.includes(A)?(s[A].before&&!y&&(s[A].before=!1),s[A].after&&!x&&(s[A].after=!1)):(l.push(A),s[A]={before:y,after:x})}}l.sort(yi);let u=a.before?a.before.length:0;const f=i.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const m=l[d];m<u||m>=f||m+1<f&&l[d+1]===m+1&&s[m].after&&!s[m+1].before&&!s[m+1].after||l[d-1]===m-1&&s[m].before&&!s[m-1].before&&!s[m-1].after||(u!==m&&o.push(Sn(i.slice(u,m),"\\")),u=m,/[!-/:-@[-`{-~]/.test(i.charAt(m))&&(!a.encode||!a.encode.includes(i.charAt(m)))?o.push("\\"):(o.push("&#x"+i.charCodeAt(m).toString(16).toUpperCase()+";"),u++))}return o.push(Sn(i.slice(u,f),a.after)),o.join("")}function yi(e,n){return e-n}function Sn(e,n){const a=/\\(?=[!-/:-@[-`{-~])/g,i=[],l=[],o=e+n;let s=-1,d=0,u;for(;u=a.exec(o);)i.push(u.index);for(;++s<i.length;)d!==i[s]&&l.push(e.slice(d,i[s])),l.push("\\"),d=i[s];return l.push(e.slice(d)),l.join("")}function ct(e){const n=e||{},a=n.now||{};let i=n.lineShift||0,l=a.line||1,o=a.column||1;return{move:u,current:s,shift:d};function s(){return{now:{line:l,column:o},lineShift:i}}function d(f){i+=f}function u(f){const m=f||"",c=m.split(/\r?\n|\r/g),w=c[c.length-1];return l+=c.length-1,o=c.length===1?o+w.length:1+w.length+i,m}}Fn.peek=_i;function bi(){return{enter:{gfmFootnoteDefinition:wi,gfmFootnoteDefinitionLabelString:ki,gfmFootnoteCall:Mi,gfmFootnoteCallString:Hi},exit:{gfmFootnoteDefinition:Ai,gfmFootnoteDefinitionLabelString:vi,gfmFootnoteCall:Ei,gfmFootnoteCallString:ji}}}function Ci(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Zi,footnoteReference:Fn}}}function wi(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ki(){this.buffer()}function vi(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Re(this.sliceSerialize(e)).toLowerCase()}function Ai(e){this.exit(e)}function Mi(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Hi(){this.buffer()}function ji(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Re(this.sliceSerialize(e)).toLowerCase()}function Ei(e){this.exit(e)}function Fn(e,n,a,i){const l=ct(i);let o=l.move("[^");const s=a.enter("footnoteReference"),d=a.enter("reference");return o+=l.move(Nn(a,Vn(e),{...l.current(),before:o,after:"]"})),d(),s(),o+=l.move("]"),o}function _i(){return"["}function Zi(e,n,a,i){const l=ct(i);let o=l.move("[^");const s=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(Nn(a,Vn(e),{...l.current(),before:o,after:"]"})),d(),o+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),o+=l.move(pi(mi(e,a,l.current()),Vi)),s(),o}function Vi(e,n,a){return n===0?e:(a?"":" ")+e}function Dn(e,n,a){const i=n.indexStack,l=e.children||[],o=[];let s=-1,d=a.before;i.push(-1);let u=n.createTracker(a);for(;++s<l.length;){const f=l[s];let m;if(i[i.length-1]=s,s+1<l.length){let c=n.handle.handlers[l[s+1].type];c&&c.peek&&(c=c.peek),m=c?c(l[s+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else m=a.after;o.length>0&&(d==="\r"||d===`
|
|
161
|
+
`)&&f.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),d=" ",u=n.createTracker(a),u.move(o.join(""))),o.push(u.move(n.handle(f,e,n,{...u.current(),before:d,after:m}))),d=o[o.length-1].slice(-1)}return i.pop(),o.join("")}const Ii=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qn.peek=Di;const Li={canContainEols:["delete"],enter:{strikethrough:Si},exit:{strikethrough:Fi}},Ni={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ii}],handlers:{delete:qn}};function Si(e){this.enter({type:"delete",children:[]},e)}function Fi(e){this.exit(e)}function qn(e,n,a,i){const l=ct(i),o=a.enter("strikethrough");let s=l.move("~~");return s+=Dn(e,a,{...l.current(),before:s,after:"~"}),s+=l.move("~~"),o(),s}function Di(){return"~"}Rn.peek=qi;function Rn(e,n,a){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const s=a.unsafe[o],d=In(s);let u;if(s.atBreak)for(;u=d.exec(i);){let f=u.index;i.charCodeAt(f)===10&&i.charCodeAt(f-1)===13&&f--,i=i.slice(0,f)+" "+i.slice(u.index+1)}}return l+i+l}function qi(){return"`"}function Ri(e){return e.length}function Ti(e,n){const a=n||{},i=(a.align||[]).concat(),l=a.stringLength||Ri,o=[],s=[],d=[],u=[];let f=0,m=-1;for(;++m<e.length;){const A=[],M=[];let H=-1;for(e[m].length>f&&(f=e[m].length);++H<e[m].length;){const C=zi(e[m][H]);if(a.alignDelimiters!==!1){const k=l(C);M[H]=k,(u[H]===void 0||k>u[H])&&(u[H]=k)}A.push(C)}s[m]=A,d[m]=M}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<f;)o[c]=Tn(i[c]);else{const A=Tn(i);for(;++c<f;)o[c]=A}c=-1;const w=[],y=[];for(;++c<f;){const A=o[c];let M="",H="";A===99?(M=":",H=":"):A===108?M=":":A===114&&(H=":");let C=a.alignDelimiters===!1?1:Math.max(1,u[c]-M.length-H.length);const k=M+"-".repeat(C)+H;a.alignDelimiters!==!1&&(C=M.length+C+H.length,C>u[c]&&(u[c]=C),y[c]=C),w[c]=k}s.splice(1,0,w),d.splice(1,0,y),m=-1;const x=[];for(;++m<s.length;){const A=s[m],M=d[m];c=-1;const H=[];for(;++c<f;){const C=A[c]||"";let k="",j="";if(a.alignDelimiters!==!1){const E=u[c]-(M[c]||0),q=o[c];q===114?k=" ".repeat(E):q===99?E%2?(k=" ".repeat(E/2+.5),j=" ".repeat(E/2-.5)):(k=" ".repeat(E/2),j=k):j=" ".repeat(E)}a.delimiterStart!==!1&&!c&&H.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&C==="")&&(a.delimiterStart!==!1||c)&&H.push(" "),a.alignDelimiters!==!1&&H.push(k),H.push(C),a.alignDelimiters!==!1&&H.push(j),a.padding!==!1&&H.push(" "),(a.delimiterEnd!==!1||c!==f-1)&&H.push("|")}x.push(a.delimiterEnd===!1?H.join("").replace(/ +$/,""):H.join(""))}return x.join(`
|
|
162
|
+
`)}function zi(e){return e==null?"":String(e)}function Tn(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const Oi={enter:{table:Bi,tableData:zn,tableHeader:zn,tableRow:Wi},exit:{codeText:Pi,table:$i,tableData:Vt,tableHeader:Vt,tableRow:Vt}};function Bi(e){const n=e._align;this.enter({type:"table",align:n.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function $i(e){this.exit(e),this.setData("inTable")}function Wi(e){this.enter({type:"tableRow",children:[]},e)}function Vt(e){this.exit(e)}function zn(e){this.enter({type:"tableCell",children:[]},e)}function Pi(e){let n=this.resume();this.getData("inTable")&&(n=n.replace(/\\([\\|])/g,Ui));const a=this.stack[this.stack.length-1];a.value=n,this.exit(e)}function Ui(e,n){return n==="|"?n:e}function Qi(e){const n=e||{},a=n.tableCellPadding,i=n.tablePipeAlign,l=n.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
163
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:s,tableRow:d,tableCell:u,inlineCode:w}};function s(y,x,A,M){return f(m(y,A,M),y.align)}function d(y,x,A,M){const H=c(y,A,M),C=f([H]);return C.slice(0,C.indexOf(`
|
|
164
|
+
`))}function u(y,x,A,M){const H=A.enter("tableCell"),C=A.enter("phrasing"),k=Dn(y,A,{...M,before:o,after:o});return C(),H(),k}function f(y,x){return Ti(y,{align:x,alignDelimiters:i,padding:a,stringLength:l})}function m(y,x,A){const M=y.children;let H=-1;const C=[],k=x.enter("table");for(;++H<M.length;)C[H]=c(M[H],x,A);return k(),C}function c(y,x,A){const M=y.children;let H=-1;const C=[],k=x.enter("tableRow");for(;++H<M.length;)C[H]=u(M[H],y,x,A);return k(),C}function w(y,x,A){let M=Rn(y,x,A);return A.stack.includes("tableCell")&&(M=M.replace(/\|/g,"\\$&")),M}}function Ki(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Gi(e){const n=e.options.listItemIndent||"tab";if(n===1||n==="1")return"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Xi(e,n,a,i){const l=Gi(a);let o=a.bulletCurrent||Ki(a);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(a.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let s=o.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(s=Math.ceil(s/4)*4);const d=a.createTracker(i);d.move(o+" ".repeat(s-o.length)),d.shift(s);const u=a.enter("listItem"),f=a.indentLines(a.containerFlow(e,d.current()),m);return u(),f;function m(c,w,y){return w?(y?"":" ".repeat(s))+c:(y?o:o+" ".repeat(s-o.length))+c}}const Ji={exit:{taskListCheckValueChecked:On,taskListCheckValueUnchecked:On,paragraph:e0}},Yi={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:t0}};function On(e){const n=this.stack[this.stack.length-2];n.checked=e.type==="taskListCheckValueChecked"}function e0(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const a=this.stack[this.stack.length-1],i=a.children[0];if(i&&i.type==="text"){const l=n.children;let o=-1,s;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){s=d;break}}s===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function t0(e,n,a,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",d=ct(i);o&&d.move(s);let u=Xi(e,n,a,{...i,...d.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(m){return m+s}}function n0(){return[ti,bi(),Li,Oi,Ji]}function a0(e){return{extensions:[ni,Ci(),Ni,Qi(e),Yi]}}function r0(e={}){const n=this.data();a("micromarkExtensions",Gr(e)),a("fromMarkdownExtensions",n0()),a("toMarkdownExtensions",a0(e));function a(i,l){(n[i]?n[i]:n[i]=[]).push(l)}}const i0=g.div.withConfig({displayName:"AssistantMarkdown__CodeBlockWrapper"})([`
|
|
165
|
+
margin: 1rem 0;
|
|
166
|
+
width: 100%;
|
|
167
|
+
`]),s0=g.div.withConfig({displayName:"AssistantMarkdown__MarkdownContent"})([`
|
|
168
|
+
margin: 0;
|
|
169
|
+
width: 100%;
|
|
170
|
+
font-family: `,`;
|
|
171
|
+
font-size: 1.4rem;
|
|
172
|
+
line-height: 2.1rem;
|
|
173
|
+
color: `,`;
|
|
174
|
+
word-break: break-word;
|
|
175
|
+
|
|
176
|
+
p {
|
|
177
|
+
margin: 0 0 1rem 0;
|
|
178
|
+
&:last-child {
|
|
179
|
+
margin-bottom: 0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
code {
|
|
184
|
+
background: `,`;
|
|
185
|
+
border: 1px solid `,`;
|
|
186
|
+
border-radius: 0.4rem;
|
|
187
|
+
padding: 0.1rem 0.4rem;
|
|
188
|
+
font-family: `,`;
|
|
189
|
+
font-size: 1.3rem;
|
|
190
|
+
color: `,`;
|
|
191
|
+
white-space: pre-wrap;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
strong {
|
|
195
|
+
font-weight: 600;
|
|
196
|
+
color: `,`;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
em {
|
|
200
|
+
font-style: italic;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
ul,
|
|
204
|
+
ol {
|
|
205
|
+
margin: 0.5rem 0;
|
|
206
|
+
padding-left: 2rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
li {
|
|
210
|
+
margin-bottom: 0.3rem;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
a {
|
|
214
|
+
color: `,`;
|
|
215
|
+
text-decoration: none;
|
|
216
|
+
&:hover {
|
|
217
|
+
text-decoration: underline;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
h1,
|
|
222
|
+
h2,
|
|
223
|
+
h3,
|
|
224
|
+
h4 {
|
|
225
|
+
margin: 1rem 0 0.5rem 0;
|
|
226
|
+
font-weight: 600;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
h1 {
|
|
230
|
+
font-size: 1.8rem;
|
|
231
|
+
}
|
|
232
|
+
h2 {
|
|
233
|
+
font-size: 1.6rem;
|
|
234
|
+
}
|
|
235
|
+
h3 {
|
|
236
|
+
font-size: 1.5rem;
|
|
237
|
+
}
|
|
238
|
+
h4 {
|
|
239
|
+
font-size: 1.4rem;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
blockquote {
|
|
243
|
+
border-left: 3px solid `,`;
|
|
244
|
+
margin: 1rem 0;
|
|
245
|
+
padding-left: 1rem;
|
|
246
|
+
color: `,`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.table-wrapper {
|
|
250
|
+
overflow-x: auto;
|
|
251
|
+
margin: 1rem 0;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
table {
|
|
255
|
+
border-collapse: collapse;
|
|
256
|
+
min-width: max-content;
|
|
257
|
+
border-radius: 0.8rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
th,
|
|
261
|
+
td {
|
|
262
|
+
padding: 0.6rem 0.8rem;
|
|
263
|
+
border: 1px solid `,`;
|
|
264
|
+
text-align: left;
|
|
265
|
+
white-space: nowrap;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
th {
|
|
269
|
+
background: `,`;
|
|
270
|
+
font-weight: 600;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
td:last-child {
|
|
274
|
+
white-space: normal;
|
|
275
|
+
min-width: 200px;
|
|
276
|
+
}
|
|
277
|
+
`],({theme:e})=>e.font,p("foreground"),p("background"),p("selection"),({theme:e})=>e.fontMonospace,p("purple"),p("foreground"),({theme:e})=>e.color.cyan,p("selection"),p("gray2"),p("selection"),p("backgroundDarker")),o0=e=>({a:({children:n,href:a,...i})=>r.jsx("a",{...typeof a=="string"&&a.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:a,...i,children:n}),table:({children:n,...a})=>r.jsx("div",{className:"table-wrapper",children:r.jsx("table",{...a,children:n})}),pre:({children:n})=>r.jsx(r.Fragment,{children:n}),code:t.memo(({children:n,className:a})=>{if(typeof a=="string"&&a.includes("language-")){const i=(Array.isArray(n)?n.join(""):typeof n=="string"?n:"").replace(/\n$/,"");return r.jsx(i0,{"data-hook":"chat-message-code-block",children:r.jsx(ze,{value:i,maxHeight:216,onOpenInEditor:()=>{var l;(l=e.current)==null||l.call(e,{type:"code",value:i})}})},i)}return r.jsx("code",{children:n})},(n,a)=>n.children===a.children&&n.className===a.className)}),l0=({content:e,messageId:n,onOpenInEditor:a})=>{const i=t.useRef(a);t.useEffect(()=>{i.current=a},[a]);const l=t.useMemo(()=>o0(i),[]);return r.jsx(s0,{children:r.jsx(ma,{remarkPlugins:[r0],components:l,children:e})},n)},c0=Kt([`
|
|
278
|
+
from {
|
|
279
|
+
transform: rotate(0deg);
|
|
280
|
+
}
|
|
281
|
+
to {
|
|
282
|
+
transform: rotate(360deg);
|
|
283
|
+
}
|
|
284
|
+
`]),d0=g.span.withConfig({displayName:"ChatMessages__LoadingIconWrapper"})([`
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
animation: `,` 3s linear infinite;
|
|
289
|
+
`],c0),u0=()=>r.jsx(d0,{children:r.jsx(Ea,{})}),h0=g(D).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
|
|
290
|
+
display: flex;
|
|
291
|
+
flex-direction: column;
|
|
292
|
+
gap: 1.5rem;
|
|
293
|
+
padding: 2rem 1rem;
|
|
294
|
+
overflow-y: auto;
|
|
295
|
+
flex: 1 1 auto;
|
|
296
|
+
min-height: 0;
|
|
297
|
+
width: 100%;
|
|
298
|
+
`,`
|
|
299
|
+
`],({$scrolled:e})=>!e&&J([`
|
|
300
|
+
opacity: 0;
|
|
301
|
+
`])),m0=g(D).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
gap: 0.5rem;
|
|
305
|
+
padding: 0.8rem;
|
|
306
|
+
border-radius: 0.8rem;
|
|
307
|
+
width: 100%;
|
|
308
|
+
align-self: flex-end;
|
|
309
|
+
background: `,`;
|
|
310
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
311
|
+
flex-shrink: 0;
|
|
312
|
+
`],p("loginBackground")),Bn=g(D).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
gap: 0.5rem;
|
|
316
|
+
padding: 0.8rem;
|
|
317
|
+
width: 100%;
|
|
318
|
+
align-self: flex-end;
|
|
319
|
+
background: `,`;
|
|
320
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
321
|
+
border-radius: 0.6rem;
|
|
322
|
+
flex-shrink: 0;
|
|
323
|
+
`],p("loginBackground")),g0=g(D).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
|
|
324
|
+
width: 100%;
|
|
325
|
+
padding: 0.4rem;
|
|
326
|
+
flex: 1 0 auto;
|
|
327
|
+
`]),dt=g(D).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
|
|
328
|
+
display: flex;
|
|
329
|
+
flex-direction: column;
|
|
330
|
+
border-radius: 0.6rem;
|
|
331
|
+
overflow: hidden;
|
|
332
|
+
flex-shrink: 0;
|
|
333
|
+
width: 100%;
|
|
334
|
+
align-items: flex-start;
|
|
335
|
+
`]),$n=g.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
|
|
336
|
+
width: 100%;
|
|
337
|
+
`]),f0=g(D).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
|
|
338
|
+
width: 100%;
|
|
339
|
+
padding: 0 0.4rem;
|
|
340
|
+
`]),p0=g(D).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
|
|
341
|
+
background: #290a13;
|
|
342
|
+
border: 1px solid rgba(122, 31, 58, 0.64);
|
|
343
|
+
border-radius: 0.4rem;
|
|
344
|
+
padding: 0.8rem;
|
|
345
|
+
width: 4.8rem;
|
|
346
|
+
height: 4rem;
|
|
347
|
+
flex-shrink: 0;
|
|
348
|
+
`]),x0=g.div.withConfig({displayName:"ChatMessages__BadgeIconWrapper"})([`
|
|
349
|
+
width: 2.4rem;
|
|
350
|
+
height: 2.4rem;
|
|
351
|
+
display: flex;
|
|
352
|
+
align-items: center;
|
|
353
|
+
justify-content: center;
|
|
354
|
+
color: `,`;
|
|
355
|
+
|
|
356
|
+
svg {
|
|
357
|
+
width: 100%;
|
|
358
|
+
height: 100%;
|
|
359
|
+
}
|
|
360
|
+
`],({theme:e})=>e.color.pink),y0=g(ye).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
|
|
361
|
+
font-weight: 500;
|
|
362
|
+
font-size: 1.6rem;
|
|
363
|
+
line-height: 1.6rem;
|
|
364
|
+
color: `,`;
|
|
365
|
+
`],p("foreground")),b0=g(D).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
|
|
366
|
+
align-items: flex-start;
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
padding: 0.8rem;
|
|
369
|
+
width: 100%;
|
|
370
|
+
`]),C0=g(ye).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
|
|
371
|
+
font-size: 1.4rem;
|
|
372
|
+
line-height: 2.1rem;
|
|
373
|
+
color: `,`;
|
|
374
|
+
`],p("foreground")),w0=g(ye).withConfig({displayName:"ChatMessages__BadgeDescriptionIssueText"})([`
|
|
375
|
+
font-size: 1.4rem;
|
|
376
|
+
line-height: 2.1rem;
|
|
377
|
+
font-weight: 600;
|
|
378
|
+
`]),k0=g(D).withConfig({displayName:"ChatMessages__IssueMessageRow"})([`
|
|
379
|
+
display: flex;
|
|
380
|
+
align-items: center;
|
|
381
|
+
gap: 0.5rem;
|
|
382
|
+
`]),Wn=g(D).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
|
|
383
|
+
margin-left: 0.4rem;
|
|
384
|
+
padding: 0.8rem 1.2rem;
|
|
385
|
+
align-items: center;
|
|
386
|
+
gap: 1rem;
|
|
387
|
+
border-radius: 8px;
|
|
388
|
+
border: 1px solid `,`;
|
|
389
|
+
background: `,`;
|
|
390
|
+
`],p("selection"),p("backgroundDarker")),Pn=g(ye).withConfig({displayName:"ChatMessages__SchemaName"})([`
|
|
391
|
+
font-size: 1.4rem;
|
|
392
|
+
color: `,`;
|
|
393
|
+
`],p("foreground")),Un=g(ye).withConfig({displayName:"ChatMessages__MessageContent"})([`
|
|
394
|
+
font-size: 1.4rem;
|
|
395
|
+
line-height: 1.8rem;
|
|
396
|
+
color: `,`;
|
|
397
|
+
white-space: pre-wrap;
|
|
398
|
+
word-wrap: break-word;
|
|
399
|
+
`],p("foreground")),v0=g(D).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
|
|
400
|
+
display: flex;
|
|
401
|
+
flex-direction: column;
|
|
402
|
+
gap: 0.5rem;
|
|
403
|
+
width: 100%;
|
|
404
|
+
align-self: flex-start;
|
|
405
|
+
text-align: left;
|
|
406
|
+
background: transparent;
|
|
407
|
+
padding: 0.4rem;
|
|
408
|
+
border-radius: 0.6rem;
|
|
409
|
+
flex-shrink: 0;
|
|
410
|
+
|
|
411
|
+
`,`
|
|
412
|
+
|
|
413
|
+
.assistant-label,
|
|
414
|
+
.token-display {
|
|
415
|
+
transition: opacity 0.2s;
|
|
416
|
+
opacity: 0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
&:hover {
|
|
420
|
+
.assistant-label,
|
|
421
|
+
.token-display {
|
|
422
|
+
opacity: 1;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
`],({$hasOperationHistory:e})=>e&&J([`
|
|
426
|
+
padding-top: 0;
|
|
427
|
+
`])),A0=g(D).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"ChatMessages__AssistantHeader"})([`
|
|
428
|
+
width: 100%;
|
|
429
|
+
padding: 0.4rem;
|
|
430
|
+
flex: 1 0 auto;
|
|
431
|
+
`]),M0=g(ye).attrs({className:"assistant-label"}).withConfig({displayName:"ChatMessages__AssistantLabel"})([`
|
|
432
|
+
font-family: `,`;
|
|
433
|
+
font-size: 1.4rem;
|
|
434
|
+
text-transform: uppercase;
|
|
435
|
+
color: `,`;
|
|
436
|
+
line-height: 1;
|
|
437
|
+
`],({theme:e})=>e.fontMonospace,p("foreground")),H0=g(D).attrs({className:"token-display"}).withConfig({displayName:"ChatMessages__TokenDisplay"})([`
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: 0.9rem;
|
|
440
|
+
margin: 0 0 0 auto;
|
|
441
|
+
`]),j0=g(D).withConfig({displayName:"ChatMessages__ExplanationContent"})([`
|
|
442
|
+
display: flex;
|
|
443
|
+
flex-direction: column;
|
|
444
|
+
border-radius: 0.6rem;
|
|
445
|
+
padding: 0.8rem;
|
|
446
|
+
flex-shrink: 0;
|
|
447
|
+
width: 100%;
|
|
448
|
+
`]),E0=g.div.withConfig({displayName:"ChatMessages__Divider"})([`
|
|
449
|
+
width: 100%;
|
|
450
|
+
height: 1px;
|
|
451
|
+
background: linear-gradient(90deg, #9c274b 0%, rgba(54, 14, 26, 0) 100%);
|
|
452
|
+
margin-bottom: 1rem;
|
|
453
|
+
`]),_0=g.div.withConfig({displayName:"ChatMessages__OperationHistoryContainer"})([`
|
|
454
|
+
margin-bottom: 0.6rem;
|
|
455
|
+
width: 100%;
|
|
456
|
+
`,`
|
|
457
|
+
`],({$trimBottom:e})=>e&&J([`
|
|
458
|
+
margin-bottom: 0;
|
|
459
|
+
padding-bottom: 0.3rem;
|
|
460
|
+
`])),Z0=g.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
|
|
461
|
+
display: flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
flex-shrink: 0;
|
|
464
|
+
gap: 0.5rem;
|
|
465
|
+
padding: 0.4rem 0.4rem 0.4rem 0.8rem;
|
|
466
|
+
border: 1px solid `,`;
|
|
467
|
+
border-radius: 0.6rem;
|
|
468
|
+
color: `,`;
|
|
469
|
+
font-size: 1.4rem;
|
|
470
|
+
line-height: 2rem;
|
|
471
|
+
width: 100%;
|
|
472
|
+
`],p("red"),p("foreground")),V0=g(pe).withConfig({displayName:"ChatMessages__RetryButton"})([`
|
|
473
|
+
margin-left: auto;
|
|
474
|
+
flex-shrink: 0;
|
|
475
|
+
padding: 0.5rem 0.8rem;
|
|
476
|
+
height: auto;
|
|
477
|
+
`]),I0=Kt([`
|
|
478
|
+
0%, 50% { opacity: 1; }
|
|
479
|
+
51%, 100% { opacity: 0; }
|
|
480
|
+
`]),L0=g.span.withConfig({displayName:"ChatMessages__StreamingCursor"})([`
|
|
481
|
+
display: inline-block;
|
|
482
|
+
width: 2px;
|
|
483
|
+
height: 1.4em;
|
|
484
|
+
background: `,`;
|
|
485
|
+
margin-left: 2px;
|
|
486
|
+
margin-right: auto;
|
|
487
|
+
vertical-align: text-bottom;
|
|
488
|
+
animation: `,` 1s infinite;
|
|
489
|
+
`],p("foreground"),I0),N0=g.div.withConfig({displayName:"ChatMessages__MessagesEnd"})([`
|
|
490
|
+
min-height: 1px;
|
|
491
|
+
width: 100%;
|
|
492
|
+
background: transparent;
|
|
493
|
+
`]),S0=g(D).withConfig({displayName:"ChatMessages__DiffContainer"})([`
|
|
494
|
+
display: flex;
|
|
495
|
+
flex-direction: column;
|
|
496
|
+
gap: 10px;
|
|
497
|
+
margin-top: 1rem;
|
|
498
|
+
padding: 8px 12px;
|
|
499
|
+
border: 1px solid `,`;
|
|
500
|
+
border-radius: 8px;
|
|
501
|
+
background: `,`;
|
|
502
|
+
width: 100%;
|
|
503
|
+
`],p("selection"),p("backgroundDarker")),F0=g(D).withConfig({displayName:"ChatMessages__DiffHeader"})([`
|
|
504
|
+
display: flex;
|
|
505
|
+
align-items: center;
|
|
506
|
+
justify-content: space-between;
|
|
507
|
+
padding-bottom: 8px;
|
|
508
|
+
border-bottom: 1px solid `,`;
|
|
509
|
+
width: 100%;
|
|
510
|
+
`,`
|
|
511
|
+
`],p("selectionDarker"),({$isExpanded:e})=>!e&&J([`
|
|
512
|
+
border-bottom: 0;
|
|
513
|
+
padding-bottom: 0;
|
|
514
|
+
`])),D0=g(D).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
|
|
515
|
+
display: flex;
|
|
516
|
+
align-items: center;
|
|
517
|
+
gap: 1rem;
|
|
518
|
+
padding: 4px 0;
|
|
519
|
+
`]),q0=g.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
|
|
520
|
+
font-size: 1.4rem;
|
|
521
|
+
color: `,`;
|
|
522
|
+
`],p("offWhite")),R0=g(D).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: 1.8rem;
|
|
526
|
+
margin-left: auto;
|
|
527
|
+
`]),T0=g(D).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
|
|
528
|
+
display: flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
gap: 0.8rem;
|
|
531
|
+
color: `,`;
|
|
532
|
+
font-size: 1.3rem;
|
|
533
|
+
`],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?p("red"):a?p("cyan"):e?p("greenDarker"):p("gray2")),z0=g.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
|
|
534
|
+
display: flex;
|
|
535
|
+
align-items: center;
|
|
536
|
+
color: `,`;
|
|
537
|
+
`],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?p("red"):a?p("cyan"):e?p("greenDarker"):p("gray2")),It=g.button.withConfig({displayName:"ChatMessages__IconButton"})([`
|
|
538
|
+
display: flex;
|
|
539
|
+
align-items: center;
|
|
540
|
+
justify-content: center;
|
|
541
|
+
padding: 0;
|
|
542
|
+
background: transparent;
|
|
543
|
+
border: none;
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
height: 22px;
|
|
546
|
+
width: 22px;
|
|
547
|
+
color: `,`;
|
|
548
|
+
|
|
549
|
+
&:hover {
|
|
550
|
+
svg {
|
|
551
|
+
filter: brightness(1.3);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
`],p("gray2")),O0=g(It).withConfig({displayName:"ChatMessages__ExpandButton"})([`
|
|
555
|
+
width: 16px;
|
|
556
|
+
height: 16px;
|
|
557
|
+
`]),B0=g.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
|
|
558
|
+
position: relative;
|
|
559
|
+
width: 100%;
|
|
560
|
+
`]),$0=g(D).withConfig({displayName:"ChatMessages__ButtonBar"})([`
|
|
561
|
+
padding: 0.5rem;
|
|
562
|
+
gap: 1rem;
|
|
563
|
+
justify-content: center;
|
|
564
|
+
flex-shrink: 0;
|
|
565
|
+
width: fit-content;
|
|
566
|
+
margin: 0 auto;
|
|
567
|
+
background: `,`;
|
|
568
|
+
border: 1px solid `,`;
|
|
569
|
+
border-radius: 0.4rem;
|
|
570
|
+
`],p("backgroundDarker"),p("selection")),W0=g(pe).withConfig({displayName:"ChatMessages__AcceptButton"})([`
|
|
571
|
+
background: `,`;
|
|
572
|
+
color: `,`;
|
|
573
|
+
border: 0.1rem solid `,`;
|
|
574
|
+
width: 10rem;
|
|
575
|
+
|
|
576
|
+
&:hover:not(:disabled) {
|
|
577
|
+
background: `,`;
|
|
578
|
+
border-color: `,`;
|
|
579
|
+
filter: brightness(1.2);
|
|
580
|
+
}
|
|
581
|
+
`],({theme:e})=>e.color.pinkDarker,p("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),P0=g(pe).withConfig({displayName:"ChatMessages__RejectButton"})([`
|
|
582
|
+
background: `,`;
|
|
583
|
+
color: `,`;
|
|
584
|
+
border: 1px solid transparent;
|
|
585
|
+
width: 10rem;
|
|
586
|
+
|
|
587
|
+
&:hover:not(:disabled) {
|
|
588
|
+
background: `,`;
|
|
589
|
+
border-color: transparent;
|
|
590
|
+
}
|
|
591
|
+
`],p("background"),p("foreground"),p("selection")),U0=e=>{switch(e){case"fix_request":return{icon:r.jsx(Aa,{size:24}),title:"Fix Query",description:"Help me debug and fix the error with the attached SQL query"};case"explain_request":return{icon:r.jsx(va,{size:24}),title:"Explain Query",description:"Explain this query in detail"};case"schema_explain_request":return{icon:r.jsx(ka,{size:24}),title:"Explain Schema",description:"Provide an overview, detailed column descriptions and storage details."};case"health_issue_request":return{icon:r.jsx(wa,{size:24}),title:"Health Issue Analysis",description:"Analyze table health issue and provide steps for resolution:"};default:return null}},Q0=e=>{switch(e){case"loading":return r.jsx(u0,{});case"success":return r.jsx(ja,{});case"error":return r.jsx(Ha,{});default:return r.jsx(Ma,{})}},K0=({messages:e,onAcceptChange:n,onRejectChange:a,onRunQuery:i,onOpenInEditor:l,onApplyToEditor:o,onRetry:s,running:d,aiSuggestionRequest:u,queryNotifications:f,queryStartOffset:m=0,isOperationInProgress:c,editorSQL:w,isStreaming:y,isLoadingMessages:x,scrollToMessageId:A,onScrollToMessageComplete:M})=>{const H=Ut(),C=t.useRef(null),k=t.useRef(null),j=t.useRef(new Map),{status:E}=_e(),[q,L]=t.useState(!1),Z=t.useRef(!1),S=t.useCallback(()=>{if(q&&Z.current||A)return;const b=q?"smooth":"instant";setTimeout(()=>{var V;(V=C.current)==null||V.scrollIntoView({behavior:b}),L(!0)})},[q,A]);t.useEffect(()=>{const b=k.current;if(!b)return;const V=()=>{Z.current=!0};return b.addEventListener("wheel",V),()=>b.removeEventListener("wheel",V)},[]),t.useEffect(()=>{Z.current=!1},[e.length]);const h=t.useMemo(()=>{for(let b=e.length-1;b>=0;b--){const V=e[b];if(V.role==="assistant"&&V.sql)return b}return-1},[e]),I=t.useRef(h>=0?h:-1),[F,ee]=t.useState(h>=0?new Set([h]):new Set);t.useEffect(()=>{h>=0&&h!==I.current&&(ee(b=>new Set([...b,h])),I.current=h)},[h]);const z=b=>b>=1e3?`${(b/1e3).toFixed(1)}K`:b.toString(),re=t.useMemo(()=>e.reduce((b,V)=>{var v;return b+(V.hideFromUI?0:(((v=V.operationHistory)==null?void 0:v.length)??0)+(V.error||V.content?1:0))},0),[e]),Ae=t.useMemo(()=>{var b,V;return y?((V=(b=e[e.length-1])==null?void 0:b.content)==null?void 0:V.length)??0:0},[e,y]);t.useEffect(()=>{S()},[re,Ae]),t.useLayoutEffect(()=>{if(!A||x)return;const b=j.current.get(A);if(b){const V=setTimeout(()=>{b.scrollIntoView({behavior:"smooth",block:"start"}),L(!0),M()},100);return()=>clearTimeout(V)}},[A,x,M]),t.useEffect(()=>()=>{M()},[]);const me=[];e.forEach((b,V)=>{b.hideFromUI||me.push({message:b,originalIndex:V})});const Be=me.length>0?me[me.length-1].originalIndex:-1,Me=t.useMemo(()=>{for(let b=e.length-1;b>=0;b--)if(e[b].role==="assistant"&&!e[b].hideFromUI)return b;return-1},[e]),ut=b=>{for(let V=b+1;V<e.length;V++)if(e[V].role==="user"&&!e[V].hideFromUI)return!0;return!1};return r.jsxs(h0,{ref:k,$scrolled:q,"data-hook":"chat-messages-container",children:[me.map(({message:b,originalIndex:V})=>{var Se,O,ge,K;const v=`${b.id}`,Ne=at(b.sql||"")===at(w||""),$e=(Se=b.displayHealthIssueData)==null?void 0:Se.severity;if(b.role==="user"){const te=b.displayType,P=b.sql;if(te&&te!=="ask_request"){const N=U0(te);let G=null;if(te==="schema_explain_request"&&b.displaySchemaData){const B=b.displaySchemaData;G=r.jsx(dt,{children:r.jsxs(Wn,{children:[r.jsx(wt,{kind:B.kind,partitionBy:B.partitionBy,walEnabled:B.walEnabled,designatedTimestamp:B.designatedTimestamp}),r.jsx(Pn,{children:B.tableName})]})})}else if(te==="health_issue_request"&&b.displayHealthIssueData){const B=b.displayHealthIssueData;G=r.jsx(dt,{children:r.jsxs(Wn,{children:[r.jsx(wt,{kind:"table"}),r.jsx(Pn,{children:B.tableName})]})})}else P&&(G=r.jsx(dt,{children:r.jsx($n,{"data-hook":"user-request-sql-editor",children:r.jsx(ze,{value:P,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:P},Ne)})})}));return r.jsxs(Bn,{"data-hook":"chat-message-user",ref:B=>{B&&j.current.set(b.id,B)},children:[r.jsxs(f0,{children:[r.jsx(p0,{children:r.jsx(x0,{children:N==null?void 0:N.icon})}),r.jsx(y0,{children:N==null?void 0:N.title})]}),(N==null?void 0:N.description)&&r.jsxs(b0,{children:[r.jsx(C0,{children:N.description}),te==="health_issue_request"&&((O=b.displayHealthIssueData)==null?void 0:O.issueMessage)&&r.jsxs(k0,{children:[$e==="critical"?r.jsx(ga,{size:14,weight:"fill",color:H.color.red}):r.jsx(fa,{size:14,weight:"fill",color:H.color.orange}),r.jsx(w0,{color:$e==="critical"?"red":"orange",children:b.displayHealthIssueData.issueMessage})]})]}),G]},v)}if(te==="ask_request"&&P){const N=b.displayUserMessage||b.content;return r.jsxs(Bn,{"data-hook":"chat-message-user",ref:G=>{G&&j.current.set(b.id,G)},children:[r.jsx(g0,{children:r.jsx(Un,{children:N})}),r.jsx(dt,{children:r.jsx($n,{"data-hook":"user-request-sql-editor",children:r.jsx(ze,{value:P,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:P},Ne)})})})]},v)}return r.jsx(m0,{"data-hook":"chat-message-user",ref:N=>{N&&j.current.set(b.id,N)},children:r.jsx(Un,{children:b.content})},v)}else{const te=b.explanation||b.content,P=b.tokenUsage;let N=null;P&&typeof P.inputTokens=="number"&&typeof P.outputTokens=="number"&&(N=r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{fontWeight:600},children:z(P.inputTokens)})," ","input /"," ",r.jsx("span",{style:{fontWeight:600},children:z(P.outputTokens)})," ","output tokens"]}));const G=!!b.sql,B=F.has(V),$=b.isAccepted===!0,ie=b.isRejected===!0,oe=G&&!$&&!ie&&ut(V),Fe=V===Be,We=y&&Fe,Pe=G&&!$&&!ie&&!oe&&Fe;let He="neutral";if(b.sql){const R=at(b.sql);if(d===Ot.AI_SUGGESTION&&u&&at(u.query)===R)He="loading";else if(f){const ne=pa(R,m),le=(ge=f[ne])==null?void 0:ge.latest;le&&(le.type===kt.ERROR?He="error":(le.type===kt.SUCCESS||le.type===kt.INFO)&&(He="success"))}}const Ue=vt(b.previousSQL),Qe=vt(b.sql),De=(K=b.operationHistory)==null?void 0:K.filter(R=>R.type!==Ce.Aborted),je=!!b.error,ht=je&&!y&&!c&&Fe,Ke=V===Me&&c===!0,Ge=!!De&&De.length>0;return r.jsxs(v0,{$hasOperationHistory:Ge,"data-hook":"chat-message-assistant",ref:R=>{R&&j.current.set(b.id,R)},children:[Ge&&r.jsxs(r.Fragment,{children:[r.jsx(E0,{}),r.jsx(_0,{$trimBottom:!b.content,children:r.jsx(yr,{operationHistory:De,status:E,isLive:Ke,onScrollNeeded:S,collapsed:!!b.content||!!b.error,responseStart:b.responseStart})})]}),b.content&&r.jsxs(r.Fragment,{children:[r.jsxs(A0,{"data-hook":"assistant-header",children:[r.jsx(tt,{size:20,variant:"filled"}),r.jsx(M0,{children:"Assistant"}),N&&r.jsxs(H0,{className:"token-display",children:[r.jsx(rn,{size:"16px",color:H.color.gray2}),r.jsx(ye,{size:"sm",color:"gray2",children:N})]})]}),r.jsxs(j0,{children:[r.jsx(l0,{content:te,messageId:b.id,onOpenInEditor:l}),We&&r.jsx(L0,{"data-hook":"streaming-cursor"}),G&&!We&&r.jsxs(S0,{"data-hook":"inline-diff-container",children:[r.jsxs(F0,{$isExpanded:B,children:[r.jsxs(D0,{children:[r.jsx(xa,{size:22,color:"#BDBDBD"}),r.jsx(q0,{children:"Suggested change"})]}),($||ie||oe)&&r.jsxs(T0,{$isAccepted:$,$isRejected:ie,$isRejectedWithFollowUp:oe,"data-hook":ie?"diff-status-rejected":oe?"diff-status-followed-up":"diff-status-accepted",children:[r.jsx(z0,{$isAccepted:$,$isRejected:ie,$isRejectedWithFollowUp:oe,children:ie?r.jsx(ya,{size:"14px"}):oe?r.jsx(Jt,{size:"14px"}):r.jsx(ba,{size:"14px"})}),ie?"Rejected":oe?"Followed up":"Accepted"]}),r.jsxs(R0,{children:[r.jsx(It,{onClick:R=>{R.stopPropagation(),b.sql&&i&&i(b.sql)},title:"Run this query","data-hook":"message-action-run-sql",children:Q0(He)}),!Pe&&o&&!(V===h&&$)&&!Ne&&r.jsx(It,{onClick:R=>{R.stopPropagation(),b.id&&b.sql&&!c&&o(b.id,b.sql)},title:"Apply to editor",disabled:c,style:{opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},"data-hook":"message-action-apply",children:r.jsx(sn,{size:22,color:"#BDBDBD"})}),r.jsx(O0,{title:"Expand diff view","data-hook":"diff-expand-button",onClick:()=>{ee(R=>{const ne=new Set(R);return ne.has(V)?ne.delete(V):ne.add(V),ne})},children:r.jsx(Ca,{})})]})]}),B&&r.jsxs(r.Fragment,{children:[r.jsx(B0,{children:r.jsx(ze,{diffEditor:!0,original:Ue,modified:Qe,maxHeight:300,onOpenInEditor:()=>l({type:"diff",original:Ue??"",modified:Qe??""}),handleScrollNeeded:S})}),Pe&&r.jsxs($0,{align:"center",justifyContent:"center",children:[a&&b.id&&r.jsx(P0,{onClick:()=>a(b.id),"data-hook":"message-action-reject",children:"Reject"}),n&&b.id&&r.jsx(W0,{onClick:()=>n(b.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]})]})]}),je&&r.jsxs(Z0,{"data-hook":"chat-message-error",children:[r.jsx(Rt,{size:16,color:H.color.red,style:{flexShrink:0}}),b.error,ht&&s&&r.jsx(V0,{size:"sm",skin:"secondary",prefixIcon:r.jsx(Gt,{size:12}),onClick:()=>{const R=e.slice(0,V).findLastIndex(ne=>ne.role==="user");R>=0&&s(e[R].id,b.id)},"data-hook":"retry-button",children:"Retry"})]})]},v)}}),r.jsx(N0,{ref:C,"data-hook":"messages-end"})]})},G0=g(D).withConfig({displayName:"ChatInput__InputContainer"})([`
|
|
592
|
+
display: flex;
|
|
593
|
+
flex-direction: column;
|
|
594
|
+
align-items: stretch;
|
|
595
|
+
gap: 0.8rem;
|
|
596
|
+
padding: 1rem 1.2rem;
|
|
597
|
+
flex-shrink: 0;
|
|
598
|
+
width: 100%;
|
|
599
|
+
margin-top: auto;
|
|
600
|
+
border-top: 1px solid `,`;
|
|
601
|
+
`],p("selection")),X0=g(D).withConfig({displayName:"ChatInput__InputWrapper"})([`
|
|
602
|
+
display: flex;
|
|
603
|
+
position: relative;
|
|
604
|
+
width: 100%;
|
|
605
|
+
overflow: hidden;
|
|
606
|
+
`]),J0=g.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
|
|
607
|
+
flex: 1;
|
|
608
|
+
min-height: 8rem;
|
|
609
|
+
max-height: 30rem;
|
|
610
|
+
line-height: 1.3;
|
|
611
|
+
padding: `,`;
|
|
612
|
+
background: `,`;
|
|
613
|
+
border: 1px solid `,`;
|
|
614
|
+
border-radius: 0.6rem;
|
|
615
|
+
color: `,`;
|
|
616
|
+
font-size: 1.4rem;
|
|
617
|
+
font-family: `,`;
|
|
618
|
+
resize: none;
|
|
619
|
+
outline: none;
|
|
620
|
+
|
|
621
|
+
&:focus {
|
|
622
|
+
border-color: `,`;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
&::placeholder {
|
|
626
|
+
color: `,`;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
&:disabled {
|
|
630
|
+
opacity: 0.5;
|
|
631
|
+
}
|
|
632
|
+
`],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",p("backgroundDarker"),p("selection"),p("foreground"),({theme:e})=>e.font,p("pinkDarker"),p("gray2")),Y0=g.button.withConfig({displayName:"ChatInput__ActionButton"})([`
|
|
633
|
+
position: absolute;
|
|
634
|
+
right: 0.8rem;
|
|
635
|
+
bottom: 0.8rem;
|
|
636
|
+
padding: 0.6rem;
|
|
637
|
+
border: none;
|
|
638
|
+
display: flex;
|
|
639
|
+
align-items: center;
|
|
640
|
+
justify-content: center;
|
|
641
|
+
border-radius: 0.4rem;
|
|
642
|
+
cursor: pointer;
|
|
643
|
+
`]),e1=g.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
|
|
644
|
+
position: absolute;
|
|
645
|
+
padding: 0.8rem;
|
|
646
|
+
top: 2px;
|
|
647
|
+
border-radius: 0.6rem;
|
|
648
|
+
left: 1px;
|
|
649
|
+
width: calc(100% - 0.2rem);
|
|
650
|
+
display: inline-flex;
|
|
651
|
+
background: `,`;
|
|
652
|
+
`],p("backgroundDarker")),t1=g.div.withConfig({displayName:"ChatInput__ContextBadge"})([`
|
|
653
|
+
display: flex;
|
|
654
|
+
padding: 0.3rem 0.6rem;
|
|
655
|
+
align-items: center;
|
|
656
|
+
gap: 0.4rem;
|
|
657
|
+
line-height: 1.4;
|
|
658
|
+
border-radius: 0.6rem;
|
|
659
|
+
border: 1px solid `,`;
|
|
660
|
+
background: `,`;
|
|
661
|
+
color: `,`;
|
|
662
|
+
font-size: 1.3rem;
|
|
663
|
+
user-select: none;
|
|
664
|
+
cursor: pointer;
|
|
665
|
+
|
|
666
|
+
&:hover {
|
|
667
|
+
border: 1px solid `,`;
|
|
668
|
+
color: `,`;
|
|
669
|
+
}
|
|
670
|
+
`],p("selection"),p("chatBackground"),p("gray2"),p("offWhite"),p("offWhite")),n1=g.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
|
|
671
|
+
display: flex;
|
|
672
|
+
align-items: center;
|
|
673
|
+
color: `,`;
|
|
674
|
+
flex-shrink: 0;
|
|
675
|
+
|
|
676
|
+
svg {
|
|
677
|
+
color: `,`;
|
|
678
|
+
}
|
|
679
|
+
`],p("gray2"),p("gray2")),a1=g(Y0).withConfig({displayName:"ChatInput__SendButton"})([`
|
|
680
|
+
background: `,`;
|
|
681
|
+
color: `,`;
|
|
682
|
+
|
|
683
|
+
&:hover:not(:disabled) {
|
|
684
|
+
background: `,`;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
&:disabled {
|
|
688
|
+
opacity: 0.5;
|
|
689
|
+
cursor: not-allowed;
|
|
690
|
+
}
|
|
691
|
+
`],p("pinkDarker"),p("foreground"),p("pink")),r1=g.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
|
|
692
|
+
display: flex;
|
|
693
|
+
position: relative;
|
|
694
|
+
width: 100%;
|
|
695
|
+
background: `,`;
|
|
696
|
+
border: 1px solid transparent;
|
|
697
|
+
background:
|
|
698
|
+
linear-gradient(`,", ",`)
|
|
699
|
+
padding-box,
|
|
700
|
+
`,` border-box;
|
|
701
|
+
border-radius: 0.6rem;
|
|
702
|
+
height: 4rem;
|
|
703
|
+
`],p("backgroundDarker"),p("backgroundDarker"),p("backgroundDarker"),Za),i1=g.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
|
|
704
|
+
display: flex;
|
|
705
|
+
align-items: center;
|
|
706
|
+
background: `,`;
|
|
707
|
+
gap: 0.8rem;
|
|
708
|
+
width: 100%;
|
|
709
|
+
height: 100%;
|
|
710
|
+
border-radius: 0.6rem;
|
|
711
|
+
padding: 0 1.2rem;
|
|
712
|
+
padding-right: 4.5rem;
|
|
713
|
+
`],p("backgroundDarker")),s1=g.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
|
|
714
|
+
font-weight: 500;
|
|
715
|
+
font-size: 1.4rem;
|
|
716
|
+
color: `,`;
|
|
717
|
+
`,`
|
|
718
|
+
`],p("gray2"),Tt),o1=g.button.withConfig({displayName:"ChatInput__StopButton"})([`
|
|
719
|
+
position: absolute;
|
|
720
|
+
right: 0.8rem;
|
|
721
|
+
top: 50%;
|
|
722
|
+
transform: translateY(-50%);
|
|
723
|
+
width: 2.6rem;
|
|
724
|
+
height: 2.6rem;
|
|
725
|
+
border-radius: 50%;
|
|
726
|
+
border: none;
|
|
727
|
+
display: flex;
|
|
728
|
+
align-items: center;
|
|
729
|
+
justify-content: center;
|
|
730
|
+
cursor: pointer;
|
|
731
|
+
transition: all 0.15s ease;
|
|
732
|
+
background: #da152832;
|
|
733
|
+
color: #da1e28;
|
|
734
|
+
|
|
735
|
+
&:hover {
|
|
736
|
+
background: `,`;
|
|
737
|
+
color: `,`;
|
|
738
|
+
}
|
|
739
|
+
`],p("red"),p("foreground")),Qn=(e,n=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=n?a:a.slice(0,n)+"..."},l1=e=>{switch(e){case"T":return"table";case"M":return"matview";case"V":return"view";default:return"table"}},c1=t.forwardRef(({onSend:e,disabled:n=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:i,contextTableId:l,onContextClick:o},s)=>{const[d,u]=t.useState(""),f=t.useRef(null),m=ue(ce.query.getTables),c=t.useMemo(()=>l==null?null:m.find(E=>E.id===l)??null,[l,m]),w=c!=null&&c.table_name?Qn(c.table_name):i?Qn(i):null,y=!!w;t.useImperativeHandle(s,()=>({focus:()=>{var E;(E=f.current)==null||E.focus()}}));const{status:x,abortOperation:A}=_e(),M=de(x);t.useEffect(()=>{f.current&&(f.current.style.height="auto",f.current.style.height=`${f.current.scrollHeight}px`)},[d]);const H=()=>{const E=d.trim();E&&!n&&!M&&(e(E),u(""),f.current&&(f.current.style.height="auto"))},C=E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),H())},k=()=>{A()},j=M;return r.jsxs(G0,{children:[j?r.jsxs(r1,{"data-hook":"chat-assistant-modes",children:[r.jsxs(i1,{children:[r.jsx(xt,{size:20}),r.jsx(s1,{children:x})]}),r.jsx(o1,{onClick:k,title:"Stop generation","data-hook":"chat-stop-button",children:r.jsx(_a,{size:"14px"})})]}):r.jsxs(X0,{children:[y&&r.jsx(e1,{children:r.jsxs(t1,{role:"presentation",onClick:o,"data-hook":"chat-context-badge",children:[r.jsx(n1,{children:c?r.jsx(wt,{kind:l1(c.table_type??"T"),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):r.jsx(an,{size:14,weight:"regular"})}),w]})}),r.jsx(J0,{ref:f,value:d,onChange:E=>u(E.target.value),onKeyDown:C,placeholder:a,disabled:n,rows:1,$hasContext:y,"data-hook":"chat-input-textarea"}),r.jsx(a1,{onClick:H,disabled:!d.trim()||n,title:"Send (Enter) \u2022 New line (Shift+Enter)","data-hook":"chat-send-button",children:r.jsx(Xt,{size:20,weight:"bold"})})]}),r.jsx(ye,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),Kn=g.button.withConfig({displayName:"ChatHistoryItem__Container"})([`
|
|
740
|
+
display: flex;
|
|
741
|
+
align-items: center;
|
|
742
|
+
gap: 0.6rem;
|
|
743
|
+
padding: 0.4rem 0.8rem;
|
|
744
|
+
border-radius: 4px;
|
|
745
|
+
cursor: `,`;
|
|
746
|
+
background: `,`;
|
|
747
|
+
opacity: `,`;
|
|
748
|
+
border: 0;
|
|
749
|
+
width: 100%;
|
|
750
|
+
text-align: left;
|
|
751
|
+
|
|
752
|
+
&:hover {
|
|
753
|
+
background: `,`;
|
|
754
|
+
|
|
755
|
+
.chat-title {
|
|
756
|
+
color: `,`;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
`],({disabled:e})=>e?"not-allowed":"pointer",p("transparent"),({disabled:e})=>e?.5:1,({disabled:e})=>e?"transparent":p("selection"),({disabled:e})=>e?p("offWhite"):p("foreground")),d1=g.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
|
|
760
|
+
display: flex;
|
|
761
|
+
align-items: center;
|
|
762
|
+
justify-content: center;
|
|
763
|
+
flex-shrink: 0;
|
|
764
|
+
color: `,`;
|
|
765
|
+
`],p("gray2")),u1=g.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
|
|
766
|
+
display: flex;
|
|
767
|
+
flex-direction: column;
|
|
768
|
+
flex: 1;
|
|
769
|
+
min-width: 0;
|
|
770
|
+
padding-left: 0.4rem;
|
|
771
|
+
`]),h1=g.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
|
|
772
|
+
padding: 0.2rem 0.4rem;
|
|
773
|
+
border: 1px solid transparent;
|
|
774
|
+
color: `,`;
|
|
775
|
+
white-space: nowrap;
|
|
776
|
+
overflow: hidden;
|
|
777
|
+
text-overflow: ellipsis;
|
|
778
|
+
transform: translateX(-0.4rem);
|
|
779
|
+
`],p("offWhite")),m1=g.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
|
|
780
|
+
color: `,`;
|
|
781
|
+
background: transparent;
|
|
782
|
+
border: 1px solid `,`;
|
|
783
|
+
border-radius: 6px;
|
|
784
|
+
outline: none;
|
|
785
|
+
padding: 0.2rem 0.4rem;
|
|
786
|
+
font-family: inherit;
|
|
787
|
+
transform: translateX(-0.4rem);
|
|
788
|
+
|
|
789
|
+
&:focus {
|
|
790
|
+
outline: none;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
&::selection {
|
|
794
|
+
background: `,`;
|
|
795
|
+
}
|
|
796
|
+
&::-moz-selection {
|
|
797
|
+
background: `,`;
|
|
798
|
+
}
|
|
799
|
+
&::-webkit-selection {
|
|
800
|
+
background: `,`;
|
|
801
|
+
}
|
|
802
|
+
`],p("foreground"),p("pinkDarker"),p("pinkPrimary"),p("pinkPrimary"),p("pinkPrimary")),g1=g.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
|
|
803
|
+
font-size: 1.2rem;
|
|
804
|
+
line-height: 1.5;
|
|
805
|
+
color: `,`;
|
|
806
|
+
white-space: nowrap;
|
|
807
|
+
overflow: hidden;
|
|
808
|
+
text-overflow: ellipsis;
|
|
809
|
+
`],p("gray2")),f1=g.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
|
|
810
|
+
display: flex;
|
|
811
|
+
align-items: center;
|
|
812
|
+
gap: 0.4rem;
|
|
813
|
+
flex-shrink: 0;
|
|
814
|
+
`]),Gn=g.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
|
|
815
|
+
display: flex;
|
|
816
|
+
align-items: center;
|
|
817
|
+
justify-content: center;
|
|
818
|
+
padding: 0.4rem;
|
|
819
|
+
background: transparent;
|
|
820
|
+
border: none;
|
|
821
|
+
border-radius: 4px;
|
|
822
|
+
cursor: pointer;
|
|
823
|
+
color: `,`;
|
|
824
|
+
opacity: 0;
|
|
825
|
+
|
|
826
|
+
`,`:hover & {
|
|
827
|
+
opacity: 1;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
&:hover {
|
|
831
|
+
background: `,`;
|
|
832
|
+
}
|
|
833
|
+
`],p("foreground"),Kn,p("backgroundDarker")),p1=g.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
|
|
834
|
+
font-size: 1.2rem;
|
|
835
|
+
line-height: 1.5rem;
|
|
836
|
+
color: #9ca3af;
|
|
837
|
+
white-space: nowrap;
|
|
838
|
+
`]),x1=({conversation:e,subtitle:n,isCurrent:a,hasOngoingProcess:i,disabled:l,onSelect:o,onRename:s,onDelete:d})=>{const[u,f]=t.useState(!1),[m,c]=t.useState(e.conversationName),w=t.useRef(null);t.useEffect(()=>{u&&w.current&&(w.current.focus(),w.current.select())},[u]);const y=k=>{k.stopPropagation(),c(e.conversationName),f(!0)},x=k=>{k.stopPropagation(),d(e.id)},A=async()=>{const k=m.trim();k&&k!==e.conversationName&&await s(e.id,k),f(!1)},M=async k=>{k.key==="Enter"?await A():k.key==="Escape"&&(c(e.conversationName),f(!1))},H=async()=>{await A()},C=async()=>{!u&&!l&&await o(e.id)};return r.jsxs(Kn,{onClick:C,disabled:l,"data-hook":"chat-history-item",children:[r.jsx(d1,{children:r.jsx(Yt,{size:18})}),r.jsxs(u1,{children:[u?r.jsx(m1,{ref:w,value:m,onChange:k=>c(k.target.value),onKeyDown:M,onBlur:H,onClick:k=>k.stopPropagation(),"data-hook":"chat-history-rename"}):r.jsx(h1,{"data-hook":"chat-history-title",children:e.conversationName}),n&&r.jsx(g1,{children:n})]}),r.jsxs(f1,{children:[!u&&r.jsxs(r.Fragment,{children:[r.jsx(Gn,{onClick:y,title:"Edit title","data-hook":"chat-history-edit",children:r.jsx(ln,{size:18})}),!i&&r.jsx(Gn,{onClick:x,title:"Delete","data-hook":"chat-history-delete",children:r.jsx(dn,{size:18})})]}),a&&r.jsx(p1,{children:"Current"})]})]})},y1=g.div.withConfig({displayName:"DateSeparator__Container"})([`
|
|
839
|
+
display: flex;
|
|
840
|
+
align-items: center;
|
|
841
|
+
gap: 1rem;
|
|
842
|
+
padding: 0.4rem 0;
|
|
843
|
+
width: 100%;
|
|
844
|
+
`]),Xn=g.div.withConfig({displayName:"DateSeparator__Line"})([`
|
|
845
|
+
flex: 1;
|
|
846
|
+
height: 1px;
|
|
847
|
+
background: `,`;
|
|
848
|
+
`],p("selection")),b1=g.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
|
|
849
|
+
display: flex;
|
|
850
|
+
align-items: center;
|
|
851
|
+
gap: 0.8rem;
|
|
852
|
+
color: `,`;
|
|
853
|
+
`],p("gray2")),C1=g.span.withConfig({displayName:"DateSeparator__Label"})([`
|
|
854
|
+
font-size: 1.3rem;
|
|
855
|
+
letter-spacing: 0.016rem;
|
|
856
|
+
white-space: nowrap;
|
|
857
|
+
`]),w1=({label:e})=>r.jsxs(y1,{children:[r.jsx(Xn,{}),r.jsxs(b1,{children:[r.jsx(tn,{size:16}),r.jsx(C1,{children:e})]}),r.jsx(Xn,{})]}),k1=6e4;function Jn(e){const n=Va(),a=La(n);return Ia(e,new Date().getTime(),{locale:a})+" ago"}function v1(e){const n=[...e].sort((o,s)=>s.updatedAt-o.updatedAt),a=new Map;for(const o of n){const s=Jn(o.updatedAt),d=a.get(s)||[];a.set(s,[...d,o])}const i=[],l=new Set;for(const o of n){const s=Jn(o.updatedAt);l.has(s)||(l.add(s),i.push({label:s,conversations:a.get(s)||[]}))}return i}function A1(e){const[n,a]=t.useState(0);return t.useEffect(()=>{const i=setInterval(()=>{a(l=>l+1)},k1);return()=>clearInterval(i)},[]),t.useMemo(()=>v1(e),[e,n])}function M1(e,n){if(!n.trim())return e;const a=n.toLowerCase().trim();return e.filter(i=>i.conversationName.toLowerCase().includes(a))}const Yn=g.div.withConfig({displayName:"ChatHistoryView__Container"})([`
|
|
858
|
+
display: flex;
|
|
859
|
+
flex-direction: column;
|
|
860
|
+
height: 100%;
|
|
861
|
+
width: 100%;
|
|
862
|
+
padding: 2rem 1rem 4rem 1rem;
|
|
863
|
+
background: `,`;
|
|
864
|
+
overflow: hidden;
|
|
865
|
+
`],p("chatBackground")),H1=g.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
|
|
866
|
+
position: relative;
|
|
867
|
+
display: flex;
|
|
868
|
+
align-items: center;
|
|
869
|
+
flex-shrink: 0;
|
|
870
|
+
`]),j1=g.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
|
|
871
|
+
position: absolute;
|
|
872
|
+
left: 1.2rem;
|
|
873
|
+
display: flex;
|
|
874
|
+
align-items: center;
|
|
875
|
+
color: `,`;
|
|
876
|
+
pointer-events: none;
|
|
877
|
+
z-index: 1;
|
|
878
|
+
`],p("gray2")),E1=g.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
|
|
879
|
+
position: absolute;
|
|
880
|
+
right: 0.8rem;
|
|
881
|
+
display: flex;
|
|
882
|
+
align-items: center;
|
|
883
|
+
justify-content: center;
|
|
884
|
+
padding: 0.2rem;
|
|
885
|
+
background: transparent;
|
|
886
|
+
border: none;
|
|
887
|
+
border-radius: 4px;
|
|
888
|
+
cursor: pointer;
|
|
889
|
+
color: `,`;
|
|
890
|
+
|
|
891
|
+
&:hover {
|
|
892
|
+
color: `,`;
|
|
893
|
+
}
|
|
894
|
+
`],p("gray2"),p("foreground")),_1=g(Fa).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
|
|
895
|
+
width: 100%;
|
|
896
|
+
background: transparent;
|
|
897
|
+
color: `,`;
|
|
898
|
+
padding: 0.8rem 3.6rem 0.8rem 3.6rem;
|
|
899
|
+
border: 1px solid `,`4d;
|
|
900
|
+
height: 3rem;
|
|
901
|
+
border-radius: 0.6rem;
|
|
902
|
+
|
|
903
|
+
&:focus {
|
|
904
|
+
background: transparent;
|
|
905
|
+
border-color: `,`;
|
|
906
|
+
}
|
|
907
|
+
`],p("foreground"),p("gray2"),p("pinkDarker")),Z1=g.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
|
|
908
|
+
display: flex;
|
|
909
|
+
flex-direction: column;
|
|
910
|
+
gap: 0.6rem;
|
|
911
|
+
padding: 2rem 0.4rem;
|
|
912
|
+
overflow-y: auto;
|
|
913
|
+
flex: 1;
|
|
914
|
+
min-height: 0;
|
|
915
|
+
`]),ea=g.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
|
|
916
|
+
display: flex;
|
|
917
|
+
flex-direction: column;
|
|
918
|
+
align-items: center;
|
|
919
|
+
justify-content: center;
|
|
920
|
+
flex: 1;
|
|
921
|
+
color: `,`;
|
|
922
|
+
font-size: 1.3rem;
|
|
923
|
+
text-align: center;
|
|
924
|
+
padding: 2rem;
|
|
925
|
+
`],p("gray2")),V1=g(Ie.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
|
|
926
|
+
background: `,`;
|
|
927
|
+
`],p("chatBackground")),I1=g.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
|
|
928
|
+
display: flex;
|
|
929
|
+
align-items: center;
|
|
930
|
+
justify-content: space-between;
|
|
931
|
+
padding: 1.5rem 2rem;
|
|
932
|
+
border-bottom: 1px solid `,`;
|
|
933
|
+
`],p("selection")),L1=g.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
|
|
934
|
+
margin: 0;
|
|
935
|
+
font-weight: 500;
|
|
936
|
+
color: `,`;
|
|
937
|
+
`],p("foreground")),N1=g.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
|
|
938
|
+
margin: 2rem;
|
|
939
|
+
font-size: 1.4rem;
|
|
940
|
+
line-height: 1.5;
|
|
941
|
+
`]),S1=g.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
|
|
942
|
+
display: flex;
|
|
943
|
+
justify-content: flex-end;
|
|
944
|
+
gap: 1rem;
|
|
945
|
+
padding: 0 2rem 0 2rem;
|
|
946
|
+
`]),F1=g(pe).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),D1=g(pe).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
|
|
947
|
+
background: `,`;
|
|
948
|
+
border-color: `,`;
|
|
949
|
+
|
|
950
|
+
&:hover:not(:disabled) {
|
|
951
|
+
background: `,`;
|
|
952
|
+
filter: brightness(1.1);
|
|
953
|
+
}
|
|
954
|
+
`],p("red"),p("red"),p("red")),q1=({currentConversationId:e})=>{const[n,a]=t.useState(""),[i,l]=t.useState(!1),[o,s]=t.useState(null),d=t.useRef(null),{conversationMetas:u,chatWindowState:f,openChatWindow:m,updateConversationName:c,deleteConversation:w}=et(),{status:y}=_e(),{buffers:x}=pt(),A=ue(ce.query.getTables),M=t.useMemo(()=>Array.from(u.values()),[u]),H=t.useMemo(()=>M1(M,n),[M,n]),C=A1(H),k=(S,h)=>{if(S){if(h==="buffer"){const I=x.find(F=>F.id===S);if(I)return I.label}else if(h==="table"){const I=A.find(F=>F.id===S);if(I)return I.table_name}}},j=async S=>{await m(S)},E=async(S,h)=>{await c(S,h)},q=S=>{s(S),l(!0)},L=async()=>{o&&await w(o),l(!1),s(null)},Z=()=>{l(!1),s(null)};return t.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),M.length===0?r.jsx(Yn,{children:r.jsx(ea,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):r.jsxs(Yn,{children:[r.jsxs(H1,{children:[r.jsx(j1,{children:r.jsx(on,{size:18})}),r.jsx(_1,{type:"text",placeholder:"Search chats",value:n,onChange:S=>a(S.target.value),"data-hook":"chat-history-search"}),n&&r.jsx(E1,{onClick:()=>a(""),title:"Clear search","data-hook":"chat-history-search-clear",children:r.jsx(Bt,{size:16})})]}),r.jsxs(Z1,{"data-hook":"chat-history-list",children:[C.map((S,h)=>r.jsxs(Qt.Fragment,{children:[h>0&&r.jsx(w1,{label:S.label}),S.conversations.map(I=>{const F=I.id===e;return r.jsx("div",{ref:F?d:void 0,children:r.jsx(x1,{conversation:I,subtitle:I.bufferId??I.tableId?k(I.bufferId??I.tableId,I.bufferId?"buffer":"table"):void 0,isCurrent:F,hasOngoingProcess:I.id===f.activeConversationId&&de(y),disabled:de(y)&&I.id!==f.activeConversationId,onSelect:j,onRename:E,onDelete:q})},I.id)})]},S.label)),H.length===0&&n&&r.jsx(ea,{children:"No chats match your search"})]}),r.jsx(Ie.Root,{open:i,onOpenChange:l,children:r.jsxs(Ie.Portal,{children:[r.jsx(Na,{children:r.jsx(Sa,{primitive:Ie.Overlay})}),r.jsxs(V1,{maxwidth:"40rem",children:[r.jsx(I1,{children:r.jsx(L1,{children:"Delete conversation"})}),r.jsx(N1,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),r.jsxs(S1,{children:[r.jsx(Ie.Cancel,{asChild:!0,children:r.jsx(F1,{onClick:Z,children:"Cancel"})}),r.jsx(Ie.Action,{asChild:!0,children:r.jsx(D1,{onClick:L,children:"Delete"})})]})]})]})})]})},R1=g.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
|
|
955
|
+
display: flex;
|
|
956
|
+
align-items: center;
|
|
957
|
+
gap: 1rem;
|
|
958
|
+
flex: 1;
|
|
959
|
+
min-width: 0;
|
|
960
|
+
overflow: hidden;
|
|
961
|
+
`]),T1=g.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
|
|
962
|
+
white-space: nowrap;
|
|
963
|
+
overflow: hidden;
|
|
964
|
+
text-overflow: ellipsis;
|
|
965
|
+
font-size: 1.6rem;
|
|
966
|
+
`]),Lt=g(pe).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
|
|
967
|
+
color: `,`;
|
|
968
|
+
padding: 0.6rem;
|
|
969
|
+
|
|
970
|
+
`,`
|
|
971
|
+
`],p("foreground"),({$active:e})=>e&&J([`
|
|
972
|
+
background: `,`;
|
|
973
|
+
`],p("selection"))),z1=g.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
|
|
974
|
+
display: flex;
|
|
975
|
+
align-items: center;
|
|
976
|
+
gap: 0.5rem;
|
|
977
|
+
flex-shrink: 0;
|
|
978
|
+
`]),O1=g.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
|
|
979
|
+
display: flex;
|
|
980
|
+
height: 100%;
|
|
981
|
+
width: 100%;
|
|
982
|
+
overflow: hidden;
|
|
983
|
+
`]),B1=g.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
|
|
984
|
+
display: flex;
|
|
985
|
+
flex-direction: column;
|
|
986
|
+
gap: 1rem;
|
|
987
|
+
padding: 1.5rem;
|
|
988
|
+
overflow-y: auto;
|
|
989
|
+
flex: 1 1 auto;
|
|
990
|
+
min-height: 0;
|
|
991
|
+
width: 100%;
|
|
992
|
+
`]),$1=g.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
|
|
993
|
+
display: flex;
|
|
994
|
+
flex-direction: column;
|
|
995
|
+
align-self: flex-end;
|
|
996
|
+
flex-shrink: 0;
|
|
997
|
+
overflow: hidden;
|
|
998
|
+
width: 100%;
|
|
999
|
+
`]),W1=g.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
|
|
1000
|
+
width: 100%;
|
|
1001
|
+
overflow: hidden;
|
|
1002
|
+
`]),P1=g.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
|
|
1003
|
+
display: flex;
|
|
1004
|
+
justify-content: flex-start;
|
|
1005
|
+
align-items: center;
|
|
1006
|
+
gap: 1rem;
|
|
1007
|
+
width: 100%;
|
|
1008
|
+
margin-top: 0.5rem;
|
|
1009
|
+
`]),U1=g.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
|
|
1010
|
+
display: flex;
|
|
1011
|
+
flex-direction: column;
|
|
1012
|
+
align-items: flex-start;
|
|
1013
|
+
justify-content: center;
|
|
1014
|
+
gap: 1.2rem;
|
|
1015
|
+
padding: 1.8rem;
|
|
1016
|
+
flex: 1 1 auto;
|
|
1017
|
+
min-height: 0;
|
|
1018
|
+
max-width: 40rem;
|
|
1019
|
+
text-align: center;
|
|
1020
|
+
margin: 0 auto;
|
|
1021
|
+
`]),Q1=g.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
|
|
1022
|
+
font-size: 2rem;
|
|
1023
|
+
font-weight: 600;
|
|
1024
|
+
text-align: left;
|
|
1025
|
+
color: `,`;
|
|
1026
|
+
margin: 0;
|
|
1027
|
+
`],p("foreground")),K1=g.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
|
|
1028
|
+
font-size: 1.4rem;
|
|
1029
|
+
font-weight: 400;
|
|
1030
|
+
color: `,`;
|
|
1031
|
+
text-align: left;
|
|
1032
|
+
margin: 0;
|
|
1033
|
+
line-height: 1.5;
|
|
1034
|
+
`],p("gray2")),ta=g(D).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
|
|
1035
|
+
display: flex;
|
|
1036
|
+
flex-direction: column;
|
|
1037
|
+
align-items: stretch;
|
|
1038
|
+
height: 100%;
|
|
1039
|
+
width: 100%;
|
|
1040
|
+
gap: 0;
|
|
1041
|
+
`]),G1=()=>{const e=$a(),n=ue(ce.console.getActiveSidebar),{quest:a}=t.useContext(ft),{editorRef:i,showPreviewBuffer:l,closePreviewBuffer:o,executionRefs:s,highlightQuery:d}=pt(),{conversationMetas:u,activeConversationMessages:f,chatWindowState:m,isLoadingMessages:c,isStreaming:w,setIsStreaming:y,scrollToMessageId:x,setScrollToMessageId:A,closeChatWindow:M,openBlankChatWindow:H,openHistoryView:C,closeHistoryView:k,getConversationMeta:j,addMessage:E,updateMessage:q,replaceConversationMessages:L,updateConversationName:Z,acceptSuggestion:S,rejectSuggestion:h,persistMessages:I}=et(),{status:F,setStatus:ee,abortController:z,canUse:re,hasSchemaAccess:Ae,currentModel:me,apiKey:Be}=_e(),Me=ue(ce.query.getTables),ut=ue(ce.query.getRunning),b=ue(ce.query.getAISuggestionRequest),V=m.activeConversationId?j(m.activeConversationId):null,v=t.useMemo(()=>V?{...V,messages:f}:null,[V,f]),Ne=v==null?void 0:v.bufferId,$e=ue(ce.query.getQueryNotificationsForBuffer(Ne??-1)),Se=t.useRef(null),O=t.useMemo(()=>vt(v==null?void 0:v.currentSQL),[v]),ge=t.useMemo(()=>Da(v==null?void 0:v.queryKey),[v==null?void 0:v.queryKey]),K=f,te=t.useMemo(()=>qa(K),[K]),P=t.useMemo(()=>K.length>0&&!c,[K,c]),N=t.useMemo(()=>K.length===0&&O&&O.trim()!==`
|
|
1042
|
+
`&&re&&!de(F),[K.length,O,re,F]),G=t.useMemo(()=>!N||!v||!v.queryKey||!v.bufferId||!i.current?!1:un(v.queryKey,v.bufferId,s,i)!==null,[N,v,i,s]),B=N&&G&&re&&!de(F),$=m.isHistoryOpen??!1,ie=u.size>0,oe=t.useMemo(()=>de(F)?!0:v?v.messages.length===0&&!v.queryKey&&!v.tableId:!1,[v,F]),Fe=t.useMemo(()=>{if($)return"Chat history";if(!v)return"";if(v.conversationName)return v.conversationName;const _=v.messages[0];if(_!=null&&_.displayType)switch(_.displayType){case"fix_request":return"Fix query";case"explain_request":return"Explain query";case"ask_request":return"Ask AI";case"health_issue_request":return"Health issue analysis";default:return"AI Assistant"}return"AI Assistant"},[v,$]),We=t.useCallback(()=>{$?k():C()},[$,k,C]),Pe=()=>K.length>0?"Ask a follow up question or request refinement...":(v==null?void 0:v.tableId)!=null||O!=null&&O.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",He=(_,T=!1)=>{if(!re||!m.activeConversationId||!v)return;const fe=m.activeConversationId;T&&o();const W=v.messages.some(Ee=>Ee.role==="assistant");be(Pt({conversationId:fe,userMessage:_,currentSQL:O,conversationHistory:v.messages,isFirstMessage:!W,settings:{model:me,apiKey:Be},questClient:a,tables:Me,hasSchemaAccess:Ae,abortSignal:z==null?void 0:z.signal}),{addMessage:E,updateMessage:q,setStatus:ee,setIsStreaming:y,persistMessages:I,updateConversationName:Z,replaceConversationMessages:L})},Ue=t.useCallback(async _=>{m.activeConversationId&&(await S({conversationId:m.activeConversationId,messageId:_}),e(rt.query.setAISuggestionRequest(null)))},[m.activeConversationId,S]),Qe=t.useCallback(async _=>{m.activeConversationId&&(await h(m.activeConversationId,_),setTimeout(()=>{var T;(T=Se.current)==null||T.focus()},100))},[m.activeConversationId,h]),De=t.useCallback(_=>{const T=_.trim().endsWith(";")?_.trim().slice(0,-1):_.trim();e(rt.query.setAISuggestionRequest({query:T,startOffset:ge.startOffset})),e(rt.query.toggleRunning(Ot.AI_SUGGESTION))},[ge.startOffset]),je=t.useCallback(async()=>{if(v!=null&&v.queryKey&&(v!=null&&v.bufferId))return await d(v.queryKey,v.bufferId);if(v!=null&&v.tableId){const _=Me.find(T=>T.id===v.tableId);if(_)return e(rt.console.pushSidebarHistory({type:"tableDetails",payload:{tableName:_.table_name,isMatView:_.table_type==="M"}})),!0}return!1},[v==null?void 0:v.queryKey,v==null?void 0:v.bufferId,v==null?void 0:v.tableId,d,Me]),ht=t.useCallback(()=>{A(null)},[A]),Ke=t.useCallback(async(_,T=!1)=>{if(!(T&&await je()))if(_.type==="diff"){if(!m.activeConversationId)return;l({type:"diff",original:_.original,modified:_.modified,conversationId:m.activeConversationId})}else l({type:"code",value:_.value})},[l,m.activeConversationId,je]),Ge=t.useCallback(async(_,T)=>{if(!m.activeConversationId)return;const fe=Ra(T,!1);try{await S({conversationId:m.activeConversationId,messageId:_,skipDefaultMessage:!0}),E({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
|
|
1043
|
+
|
|
1044
|
+
\`\`\`sql
|
|
1045
|
+
${fe.replaceAll(/\s+/g," ").trim()}
|
|
1046
|
+
\`\`\``,timestamp:Date.now(),hideFromUI:!0}),await I(m.activeConversationId)}catch(W){console.error("Error applying SQL to editor:",W),it.error("Failed to apply changes to editor")}},[m.activeConversationId,S,E,I]),R=async(_,T)=>{if(!m.activeConversationId||!re)return;const fe=m.activeConversationId,W=K.find(U=>U.id===_);if(!W)return;const Ee={settings:{model:me,apiKey:Be},questClient:a,tables:Me,hasSchemaAccess:Ae,abortSignal:z==null?void 0:z.signal};let gt=!1;const Xe={addMessage:U=>{E(U,gt?[]:[_,T]),gt||(gt=!0)},updateMessage:q,setStatus:ee,setIsStreaming:y,persistMessages:I,updateConversationName:Z,replaceConversationMessages:L};switch(W.displayType){case"explain_request":{if(!W.sql)return;be(St({conversationId:fe,queryText:W.sql,...Ee}),Xe);break}case"fix_request":{if(!W.sql)return;be(Ft({conversationId:fe,queryText:W.sql,...Ee}),Xe);break}case"schema_explain_request":{if(!W.displaySchemaData)return;const U=W.displaySchemaData;try{const ae=U.kind==="matview"?await a.showMatViewDDL(U.tableName):U.kind==="view"?await a.showViewDDL(U.tableName):await a.showTableDDL(U.tableName);if((ae==null?void 0:ae.type)!==za.DQL||!ae.data||ae.data.length===0){it.error("Failed to fetch table schema for retry");return}const Je=ae.data[0];if(!Je.ddl){it.error("Failed to fetch table schema for retry");return}be(Oa({conversationId:fe,tableName:U.tableName,schema:Je.ddl,kindLabel:Ba(U.kind),schemaDisplayData:U,...Ee}),Xe)}catch(ae){console.error("Error fetching DDL for retry:",ae),it.error("Failed to fetch table schema for retry")}break}case"ask_request":default:{const U=W.displayUserMessage||W.content,ae=K.filter(Ye=>Ye.id!==_&&Ye.id!==T),Je=ae.some(Ye=>Ye.role==="assistant");be(Pt({conversationId:fe,userMessage:U,currentSQL:W.sql||O,conversationHistory:ae,isFirstMessage:!Je,...Ee}),Xe);break}}},ne=t.useRef(null),le=t.useCallback(()=>{var _,T;(T=(_=ne.current)==null?void 0:_.querySelector('button[data-hook="button-explain-query"]'))==null||T.click()},[]),mt=t.useCallback(_=>{N&&(_.metaKey||_.ctrlKey)&&(_.key==="e"||_.key==="E")&&(_.preventDefault(),le())},[N]);return t.useEffect(()=>{if(N)return $t.subscribe(Wt.EXPLAIN_QUERY_EXEC,le),document.addEventListener("keydown",mt),()=>{document.removeEventListener("keydown",mt),$t.unsubscribe(Wt.EXPLAIN_QUERY_EXEC,le)}},[N,mt,le]),(n==null?void 0:n.type)!=="aiChat"||!v&&!$?null:r.jsx(Ta,{mode:"side","data-hook":"ai-chat-window",open:(n==null?void 0:n.type)==="aiChat",onOpenChange:_=>{_||M()},onDismiss:M,trigger:r.jsx("span",{}),title:r.jsxs(R1,{children:[r.jsx(tt,{size:20,variant:"filled"}),r.jsx(T1,{"data-hook":"chat-window-title",children:Fe})]}),afterTitle:r.jsxs(z1,{children:[r.jsx(Lt,{onClick:H,title:"New chat",disabled:oe,"data-hook":"chat-window-new",children:r.jsx(cn,{size:16,weight:"bold"})}),r.jsx(Lt,{$active:$,onClick:We,title:$?"Back to chat":"Chat history",disabled:!ie||de(F),"data-hook":"chat-window-history",children:r.jsx(nn,{size:16,weight:"bold"})}),r.jsx(Lt,{onClick:M,title:"Close","data-hook":"chat-window-close",children:r.jsx(Bt,{size:16,weight:"bold"})})]}),children:r.jsx(O1,{children:c?r.jsx(ta,{children:r.jsx(xt,{size:20,style:{margin:"auto"}})}):$?r.jsx(q1,{currentConversationId:m.previousConversationId??null}):r.jsxs(ta,{children:[P?r.jsx(K0,{messages:K,onAcceptChange:Ue,onRejectChange:Qe,onRunQuery:De,onOpenInEditor:Ke,onApplyToEditor:Ge,onRetry:R,running:ut,aiSuggestionRequest:b,queryNotifications:$e,queryStartOffset:ge.startOffset,isOperationInProgress:de(F),editorSQL:ge.queryText,isStreaming:w,isLoadingMessages:c,scrollToMessageId:x,onScrollToMessageComplete:ht}):O&&O.trim()?r.jsxs(B1,{children:[r.jsx($1,{"data-hook":"chat-initial-query-box",children:r.jsx(W1,{"data-hook":"chat-lite-editor",children:r.jsx(ze,{value:O.trim(),maxHeight:216,onOpenInEditor:()=>Ke({type:"code",value:O.trim()},!0)})})}),(N||B)&&r.jsxs(P1,{ref:ne,children:[N&&r.jsx(cr,{conversationId:v.id,queryText:O.trim()}),B&&r.jsx(ur,{})]})]}):r.jsxs(U1,{"data-hook":"chat-blank-state",children:[r.jsx(Q1,{children:"Leverage AI directly in your database"}),r.jsx(K1,{children:"Our AI Assistant is a specialized programming and support agent that makes you more effective and helps you solve problems as you interface with your QuestDB database. Start a conversation."})]}),r.jsx(c1,{ref:Se,onSend:_=>He(_,te),disabled:!re||de(F),placeholder:Pe(),contextSQL:ge.queryText,contextTableId:v==null?void 0:v.tableId,onContextClick:je})]})})})};export{G1 as default};
|