test-chat-sdk 0.1.1 → 0.1.2
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/index.es.js +1 -1
- package/package.json +1 -1
- package/src/service/axiosInstance.ts +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as n,__generator as t,__spreadArray as o}from"tslib";import{jsx as a,jsxs as i,Fragment as l}from"react/jsx-runtime";import r from"moment";import{isString as c,isArray as d,debounce as s,isEqual as u,isBoolean as m,cloneDeep as _}from"lodash";import{useState as p,useEffect as f,useRef as h,useMemo as v,useCallback as g,useContext as y,createContext as x,memo as b,forwardRef as w,useImperativeHandle as I}from"react";import{Avatar as N,Table as S,Popover as C,Select as T,InputNumber as E,DatePicker as L,Spin as M,Dropdown as A,Menu as k,Row as z,Col as D,Button as q,message as R,Space as O,Switch as F,Form as B,Modal as P,Input as Q,Tag as j,AutoComplete as Y,Drawer as W,ConfigProvider as V,Tooltip as U}from"antd";import G from"classnames";import{createFromIconfontCN as H,DownOutlined as X,CheckCircleFilled as K,CloseCircleFilled as J,ReloadOutlined as $,SwapOutlined as Z,UpOutlined as ee,InfoCircleOutlined as ne,DownloadOutlined as te,FileJpgOutlined as oe,RedoOutlined as ae,LikeOutlined as ie,DislikeOutlined as le,LoadingOutlined as re,CloseOutlined as ce,SearchOutlined as de,DeleteOutlined as se,PlusCircleOutlined as ue,CaretRightOutlined as me}from"@ant-design/icons";import _e from"axios";import pe from"dayjs";import fe from"dayjs/plugin/quarterOfYear";import he from"rehype-highlight";import ve from"remark-gfm";import ge from"react-markdown";import"github-markdown-css/github-markdown.css";import"highlight.js/styles/github.css";import"dayjs/locale/zh-cn";import*as ye from"echarts";import{Prism as xe}from"react-syntax-highlighter";import{solarizedlight as be}from"react-syntax-highlighter/dist/esm/styles/prism";import{format as we}from"sql-formatter";import{CopyToClipboard as Ie}from"react-copy-to-clipboard";import{useThrottleFn as Ne}from"ahooks";import Se from"antd/locale/zh_CN";var Ce=[],Te=[];function Ee(e,n){if(e&&"undefined"!=typeof document){var t,o=!0===n.prepend?"prepend":"append",a=!0===n.singleTag,i="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(a){var l=Ce.indexOf(i);-1===l&&(l=Ce.push(i)-1,Te[l]={}),t=Te[l]&&Te[l][o]?Te[l][o]:Te[l][o]=r()}else t=r();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function r(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),a=0;a<t.length;a++)e.setAttribute(t[a],n.attributes[t[a]]);var l="prepend"===o?"afterbegin":"beforeend";return i.insertAdjacentElement(l,e),e}}var Le,Me,Ae,ke,ze,De;Ee("body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 14px;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;\n}\n:root:root {\n --primary: 180deg 4%;\n --primary-color: #f87653;\n --blue: #296df3;\n --green: #00d59c;\n --deep-blue: #446dff;\n --chat-blue: #1b4aef;\n --wy-color: #c20c0c;\n --detail-width: 1300px;\n --primary-1: #fff0f0;\n --primary-2: #ffc7c7;\n --primary-3: #ff9ea1;\n --primary-4: #ff757e;\n --primary-5: #ff4d5e;\n --primary-6: #ff2441;\n --primary-7: #d91434;\n --primary-8: rgba(255, 36, 66, 0.1);\n --body-background: #f7fafa;\n --deep-background: #f0f0f0;\n --light-background: #f5f5f5;\n --component-background: #fff;\n --header-color: #edf2f2;\n --text-color: #181a1a;\n --text-color-secondary: #3d4242;\n --text-color-third: #626a6a;\n --text-color-fourth: #889191;\n --text-color-fifth: #afb6b6;\n --text-color-six: #a3a4a6;\n --text-color-fifth-4: hsla(180, 5%, 70%, 0.4);\n --tooltip-max-width: 350px;\n --info-color: #ff2442;\n --success-color: #52c41a;\n --processing-color: #ff2442;\n --error-color: #ff4d4f;\n --highlight-color: #ff4d4f;\n --newrank-color: #ff7800;\n --warning-color: #faad14;\n --normal-color: #d9d9d9;\n --white: #fff;\n --white-30: hsla(0, 0%, 100%, 0.3);\n --black: #000;\n --disabled-color: #afb6b6;\n --disabled-bg: #eceeee;\n --border-color-base: #e1e6e6;\n --chat-border-color-base: #d5d7db;\n --light-blue-background: rgba(58, 100, 255, 0.1);\n --link-color: #3a64ff;\n --link-hover-color: #638aff;\n --link-active-color: #2748d9;\n --link-bg-color: rgba(58, 100, 255, 0.1);\n --text-accent-color: #3a64ff;\n --primary-green: #31c462;\n --link-hover-bg-color: rgba(58, 100, 255, 0.06);\n --success-2: rgba(82, 196, 26, 0.2);\n --success-pink: #ff8193;\n --disabled-bg-3: hsla(180, 6%, 93%, 0.3);\n --tooltip-bg: #fff;\n --record-btn: #00b354;\n --record-btn-bg: rgba(0, 179, 84, 0.1);\n --record-btn-bg-3: rgba(0, 179, 84, 0.3);\n --border-color-base-bg-5: hsla(180, 9%, 89%, 0.5);\n --user-gao-color: #fcad36;\n --user-hao-color: #ec6f6f;\n --user-all-color: #252526;\n --nr-menu-highlight-color: #ff2442;\n --nr-menu-icon-hover-color: #ff2442;\n --nr-sider-background: #fff;\n --nr-menu-bg: #fff;\n --nr-sider-fixed-zindex: 12;\n --nr-header-fixed-zindex: 11;\n --newrank-color-bg: rgba(255, 120, 0, 0.1);\n --newrank-color-bg-3: rgba(255, 120, 0, 0.3);\n --warning-05: rgba(250, 173, 20, 0.05);\n --bridge-account-color: #ff2442;\n --bridge-agency-color: #3a64ff;\n --bridge-free-color: #ff7800;\n --bridge-medium-color: #00b354;\n}\n.ss-chat-dimension,\n.ss-chat-metric {\n position: relative;\n}\n.ss-chat-dimension::after,\n.ss-chat-metric::after {\n position: absolute;\n right: 0.5px;\n bottom: -2px;\n left: 0.5px;\n height: 2px;\n margin: 0 1px;\n content: '';\n}\n.ss-chat-dimension::after {\n background: var(--chat-blue);\n}\n.ss-chat-metric::after {\n background: var(--primary-green);\n}\n.ss-chat-table-row {\n cursor: pointer;\n}\n.ss-chat-even-row {\n background-color: #fbfbfb;\n}\n.ss-chat-no-border-table .ant-table-cell {\n border: none !important;\n}\n.ss-chat-no-border-table .ant-table-tbody > tr.ant-table-row:hover > td {\n background-color: #efefef !important;\n}\n.ss-chat-chat-msg {\n padding: 6px 14px 8px;\n border: 1px solid var(--border-color-base);\n border-radius: 4px;\n background: #f5f8fb;\n max-width: calc(100vw - 410px);\n}\n.ss-chat-chat-msg-bottom-tools {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 14px;\n margin-top: 12px;\n margin-bottom: 2px;\n}\n.ss-chat-chat-msg-bottom-tools.mobile {\n flex-wrap: wrap;\n}\n.ss-chat-chat-msg-metric-card-tools {\n margin-top: 0;\n}\n.ss-chat-bar-chart {\n height: 260px;\n margin-top: 16px;\n}\n.ss-chat-bar-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n}\n.ss-chat-bar-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-bar-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-bar-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-bar-date-range {\n margin-top: 12px;\n font-size: 13px;\n color: var(--text-color-third);\n}\n.ss-chat-table {\n margin-top: 6px;\n}\n.ss-chat-table-photo {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ss-chat-table-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n margin-bottom: 12px;\n}\n.ss-chat-table-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-table-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n font-style: italic;\n margin-bottom: 15px;\n}\n.ss-chat-table-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-table-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-table-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-table-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-table-drill-down-dimensions {\n margin-top: 12px;\n}\n.ss-chat-table table {\n width: 100%;\n}\n.ss-chat-table-even-row {\n background-color: #fbfbfb;\n}\n.ss-chat-table .ant-table-container table > thead > tr:first-child th:first-child {\n border-top-left-radius: 12px !important;\n border-bottom-left-radius: 12px !important;\n}\n.ss-chat-table .ant-table-container table > thead > tr:first-child th:last-child {\n border-top-right-radius: 12px !important;\n border-bottom-right-radius: 12px !important;\n}\n.ss-chat-table .ant-table-tbody > tr.ant-table-row:hover > td {\n background-color: #fafafa !important;\n}\n.ss-chat-table .ant-table-cell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 250px;\n text-align: center !important;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell {\n padding-top: 10px;\n padding-bottom: 10px;\n color: #666;\n font-size: 13px;\n background: #f0f2f5;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell::before {\n display: none;\n}\n.ss-chat-table .ss-chat-table-formatted-value {\n font-weight: 500;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell {\n padding-top: 8.5px;\n padding-bottom: 8.5px;\n color: #737b7b;\n font-weight: 500;\n font-size: 14px;\n background-color: #edf2f2;\n}\n.ss-chat-table .ant-table-tbody .ant-table-cell {\n padding: 12px 2px;\n color: var(--text-color);\n font-size: 14px;\n}\n.ss-chat-table .ant-table-pagination.ant-pagination {\n margin-bottom: 0;\n}\n.ss-chat-message-title-bar {\n display: flex;\n align-items: baseline;\n column-gap: 10px;\n margin-bottom: 6px;\n}\n.ss-chat-message-model-name {\n color: var(--text-color);\n margin-left: 4px;\n font-weight: 500;\n font-size: 15px;\n}\n.ss-chat-message-top-bar {\n position: relative;\n max-width: 80%;\n color: var(--text-color-third);\n font-size: 13px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ss-chat-message-content {\n display: flex;\n align-items: flex-start;\n}\n.ss-chat-message-body {\n width: 100%;\n}\n.ss-chat-message-bubble {\n position: relative;\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 8px 16px 10px;\n background: rgba(255, 255, 255, 0.8);\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.ss-chat-message-filter-section {\n display: flex;\n align-items: center;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.ss-chat-message-filter-values {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.ss-chat-message-filter-item {\n padding: 2px 12px;\n color: var(--text-color-secondary);\n background-color: #edf2f2;\n border-radius: 13px;\n max-width: 200px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ss-chat-message-tip {\n margin-left: 6px;\n color: var(--text-color-third);\n}\n.ss-chat-message-info-bar {\n display: flex;\n align-items: center;\n row-gap: 12px;\n flex-wrap: wrap;\n margin-top: 2px;\n margin-bottom: 12px;\n column-gap: 20px;\n color: var(--text-color-secondary);\n background: rgba(133, 156, 241, 0.1);\n padding: 4px 12px;\n width: fit-content;\n border-radius: 8px;\n}\n.ss-chat-message-main-entity-info {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 20px;\n row-gap: 10px;\n}\n.ss-chat-message-info-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-message-info-name {\n color: var(--text-color-secondary);\n}\n.ss-chat-message-info-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-card {\n width: 100%;\n row-gap: 4px;\n}\n.ss-chat-metric-card-dsl {\n height: 90px;\n}\n.ss-chat-metric-card-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n}\n.ss-chat-metric-card-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-item {\n margin-right: 4px;\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-card-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-card-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-metric-card-query-tootip {\n margin-left: 5px;\n}\n.ss-chat-metric-card-indicator {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n margin: 12px 0;\n}\n.ss-chat-metric-card-date-range {\n color: var(--text-color-fourth);\n font-size: 12px;\n margin-top: 8px;\n}\n.ss-chat-metric-card-indicator-value {\n color: var(--text-color);\n font-weight: 700;\n font-size: 40px;\n color: var(--chat-blue);\n}\n.ss-chat-metric-card-indicator-switch {\n color: var(--text-color-fourth);\n font-size: 18px;\n margin-left: 6px;\n margin-bottom: 3px;\n}\n.ss-chat-metric-card-period-compare {\n width: 100%;\n display: flex;\n align-items: center;\n column-gap: 40px;\n font-size: 13px;\n overflow-x: auto;\n margin-bottom: 12px;\n}\n.ss-chat-metric-card-period-compare-item {\n display: flex;\n align-items: center;\n column-gap: 10px;\n}\n.ss-chat-metric-card-period-compare-item-title {\n color: var(--text-color-fourth);\n}\n.ss-chat-metric-card-period-compare-item-value {\n display: flex;\n align-items: center;\n column-gap: 4px;\n font-weight: 500;\n}\n.ss-chat-metric-card-period-compare-item-value-up {\n color: #fc6772;\n}\n.ss-chat-metric-card-period-compare-item-value-down {\n color: #2dca93;\n}\n.ss-chat-metric-card-drill-down-dimensions {\n margin-top: 2px;\n}\n.ss-chat-metric-trend {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n margin-top: 4px;\n width: 100%;\n row-gap: 4px;\n}\n.ss-chat-metric-trend-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n row-gap: 12px;\n}\n.ss-chat-metric-trend-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n margin-left: 4px;\n}\n.ss-chat-metric-trend-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-metric-trend-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-trend-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-metric-trend-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-trend-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 12px;\n}\n.ss-chat-metric-trend-select-options {\n display: flex;\n justify-content: space-between;\n}\n.ss-chat-metric-trend-indicator {\n display: flex;\n flex-direction: column;\n align-items: baseline;\n justify-content: center;\n}\n.ss-chat-metric-trend-date-range {\n color: var(--text-color-fourth);\n font-size: 14px;\n}\n.ss-chat-metric-trend-indicator-value {\n color: var(--text-color);\n font-weight: 600;\n font-size: 30px;\n}\n.ss-chat-metric-trend-indicator-name {\n color: var(--text-color-fourth);\n font-size: 14px;\n}\n.ss-chat-metric-trend-flow-trend-chart {\n margin-top: 4px;\n height: 230px;\n}\n.ss-chat-metric-trend-flow-trend-chart-single {\n height: 180px;\n}\n.ss-chat-metric-trend-charts {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 8px;\n}\n.ss-chat-metric-trend-metric-fields {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n row-gap: 12px;\n color: var(--text-color);\n font-size: 15px;\n}\n.ss-chat-metric-trend-metric-field {\n display: inline-block;\n box-sizing: border-box;\n height: auto;\n margin: 0;\n margin-right: 8px;\n padding: 1px 8px;\n color: var(--text-color-third);\n font-variant: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n list-style: none;\n border-color: transparent;\n border-radius: 2px;\n cursor: pointer;\n opacity: 1;\n transition: all 0.3s;\n font-feature-settings: 'tnum', 'tnum';\n}\n.ss-chat-metric-trend-metric-field:hover {\n color: var(--chat-blue);\n}\n.ss-chat-metric-trend-metric-field-single {\n padding-left: 0;\n font-weight: 500;\n cursor: default;\n font-size: 15px;\n color: var(--text-color);\n}\n.ss-chat-metric-trend-metric-field-single:hover {\n color: var(--text-color);\n}\n.ss-chat-metric-info-indicator {\n display: flex;\n align-items: baseline;\n column-gap: 12px;\n}\n.ss-chat-metric-info-indicator-value {\n color: var(--text-color);\n font-weight: 500;\n font-size: 28px;\n line-height: 40px;\n margin-top: 2px;\n color: var(--text-color-secondary);\n}\n.ss-chat-metric-info-bottom-section {\n display: flex;\n align-items: center;\n column-gap: 20px;\n margin-top: 4px;\n}\n.ss-chat-metric-info-date {\n color: var(--text-color-fourth);\n font-size: 13px;\n}\n.ss-chat-metric-info-date-value {\n color: var(--chat-blue);\n}\n.ss-chat-metric-info-indicator-switch {\n color: var(--text-color-fourth);\n font-size: 18px;\n margin-left: 6px;\n margin-bottom: 3px;\n}\n.ss-chat-metric-info-period-compare {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 13px;\n overflow-x: auto;\n}\n.ss-chat-pie-select-options {\n display: flex;\n justify-content: flex-end;\n}\n.ss-chat-pie-chart {\n width: 100%;\n height: 400px;\n min-height: 400px;\n}\n.ss-chat-pie-metric-fields {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n}\n.ss-chat-pie-metric-field-single {\n padding-left: 0;\n font-weight: 500;\n cursor: default;\n font-size: 15px;\n color: var(--text-color);\n}\n.ss-chat-pie-metric-field-single:hover {\n color: var(--text-color);\n}\n.ss-chat-pie-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-apply-auth {\n font-size: 14px;\n color: var(--text-color);\n}\n.ss-chat-apply-auth-apply {\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-no-permission-chart {\n position: relative;\n width: 100%;\n height: 300px;\n}\n.ss-chat-no-permission-chart-holder {\n width: 100%;\n height: 280px;\n}\n.ss-chat-no-permission-chart-bar-chart-holder {\n margin-top: 20px;\n}\n.ss-chat-no-permission-chart-no-permission {\n position: absolute;\n top: 50%;\n left: 50%;\n padding: 4px 12px;\n transform: translate(-50%, -50%);\n}\n.ss-chat-filter-section {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 12px;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.ss-chat-filter-section-field-label {\n color: var(--text-color-fourth);\n}\n.ss-chat-filter-section-filter-values {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 12px;\n}\n.ss-chat-filter-section-filter-item {\n color: var(--text-color-third);\n max-width: 200px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ss-chat-filter-section-filter-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-date-options {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 14px;\n}\n.ss-chat-date-options-item {\n position: relative;\n color: var(--text-color-secondary);\n cursor: pointer;\n}\n.ss-chat-date-options-item:hover {\n color: var(--chat-blue);\n}\n.ss-chat-date-options-date-active {\n color: var(--chat-blue);\n}\n.ss-chat-date-options-date-mobile {\n font-size: 12px;\n}\n.ss-chat-date-options-active-identifier {\n position: absolute;\n bottom: -6px;\n width: 100%;\n height: 4px;\n background-color: var(--chat-blue);\n border-radius: 4px 4px 0 0;\n}\n.ss-chat-date-options-item-divider {\n width: 1px;\n height: 16px;\n background-color: var(--text-color-fifth);\n}\n.ss-chat-text-check-more {\n margin-left: 12px;\n font-size: 13px;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-text-arrow-icon {\n margin-left: 2px;\n font-size: 12px;\n}\n.ss-chat-text-reference-data {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n margin-top: 10px;\n}\n.ss-chat-text-reference-item {\n font-size: 13px;\n}\n.ss-chat-text-reference-item-title {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-text-reference-item-value {\n color: var(--text-color-secondary);\n margin-top: 4px;\n}\n.ss-chat-item {\n position: relative;\n display: flex;\n width: 100%;\n}\n.ss-chat-item-breathing-text {\n --bg-size: 400%;\n --color-one: hsl(235, 87%, 34%);\n --color-two: hsl(203, 95%, 55%);\n font-size: 14px;\n background: linear-gradient(90deg, var(--color-one), var(--color-two), var(--color-one)) 0 0 / var(--bg-size) 100%;\n color: transparent;\n background-clip: text;\n -webkit-background-clip: text;\n animation: move-bg 8s infinite linear;\n}\n@keyframes move-bg {\n to {\n background-position: var(--bg-size) 0;\n }\n}\n.ss-chat-item-loading {\n display: inline-block;\n width: 60px;\n height: 20px;\n}\n.ss-chat-item-loading-dot {\n display: inline-block;\n width: 4px;\n height: 4px;\n background-color: var(--text-color);\n margin: 0 2px;\n opacity: 0;\n animation: dot 1s ease-in-out infinite;\n}\n.ss-chat-item-loading-dot:nth-child(1) {\n animation-delay: 0s;\n}\n.ss-chat-item-loading-dot:nth-child(2) {\n animation-delay: 0.2s;\n}\n.ss-chat-item-loading-dot:nth-child(3) {\n animation-delay: 0.4s;\n}\n@keyframes dot {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 50% {\n opacity: 1;\n transform: scale(1);\n }\n 100% {\n opacity: 0;\n transform: scale(0.5);\n }\n}\n.ss-chat-item-content-parser-container {\n margin: 20px 0 0 10px;\n}\n.ss-chat-item-content-parser-options-title {\n margin-right: 8px;\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-item-content-options {\n display: flex;\n align-items: center;\n column-gap: 13px;\n margin-left: -10px;\n}\n.ss-chat-item-content-options.mobile {\n flex-wrap: wrap;\n}\n.ss-chat-item-content-option {\n border-radius: 4px;\n padding: 0 4px;\n font-weight: normal;\n color: var(--text-color-third);\n cursor: pointer;\n}\n.ss-chat-item-content-option:hover {\n color: var(--chat-blue);\n}\n.ss-chat-item-content-option-active {\n color: #fff !important;\n background-color: var(--chat-blue) !important;\n}\n.ss-chat-item-content-option-disabled {\n cursor: unset;\n background-color: #eee;\n}\n.ss-chat-item-content-option-disabled:hover {\n color: #626a6a;\n}\n.ss-chat-item-avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 40px;\n width: 40px;\n height: 40px;\n margin-right: 6px;\n border-radius: 50%;\n color: var(--chat-blue);\n background-color: #fff;\n}\n.ss-chat-item-time {\n position: absolute;\n top: -22px;\n color: var(--text-color-fourth);\n}\n.ss-chat-item-mobile-msg-card {\n width: 100%;\n}\n.ss-chat-item-content {\n position: relative;\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 12px 20px 12px 16px;\n background: #fff;\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.ss-chat-item-content-mobile {\n width: 100%;\n}\n.ss-chat-item-content-text {\n margin-top: 12px;\n}\n.ss-chat-item .ant-picker {\n background-color: #f5f8fb !important;\n border-color: #ececec !important;\n}\n.ss-chat-item .ant-picker-input > input {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-title-bar {\n display: flex;\n align-items: center;\n column-gap: 10px;\n}\n.ss-chat-item-title-tip {\n margin-left: 2px;\n color: var(--text-color-third);\n font-weight: normal;\n}\n.ss-chat-item-step-title {\n font-weight: 500;\n color: var(--text-color);\n}\n.ss-chat-item-code {\n margin-top: 10px !important;\n padding: 6px 14px 8px !important;\n border: 1px solid var(--border-color-base) !important;\n border-radius: 4px !important;\n background: #f5f8fb !important;\n max-width: calc(100vw - 410px);\n}\n.ss-chat-item-execute-title-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.ss-chat-item-reload {\n margin-left: 2px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-item-step-icon {\n color: var(--green);\n font-size: 16px;\n}\n.ss-chat-item-step-error-icon {\n color: var(--error-color);\n font-size: 16px;\n}\n.ss-chat-item-content-container {\n margin: 2px 0 2px 7px;\n padding: 10px 0 4px 18px;\n border-left: 1px solid var(--green);\n padding-bottom: 10px;\n}\n.ss-chat-item-content-container-simple {\n border-left: none;\n padding: 0;\n}\n.ss-chat-item-empty-content-container {\n padding-bottom: 0;\n}\n.ss-chat-item-content-container-failed {\n border-left: 1px solid transparent;\n}\n.ss-chat-item-auth-tip {\n font-size: 13px;\n color: var(--text-color-secondary);\n margin-bottom: 12px;\n line-height: 20px;\n}\n.ss-chat-item-switch-entity {\n cursor: pointer;\n}\n.ss-chat-item-down-icon {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.ss-chat-item-last-node {\n border-left: none;\n margin-left: 0;\n padding-left: 0;\n}\n.ss-chat-item-chart-content {\n padding: 6px 14px 12px;\n border: 1px solid var(--border-color-base);\n border-radius: 4px;\n background: #f5f8fb;\n}\n.ss-chat-item-multi-options {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 4px 0 12px;\n}\n.ss-chat-item-options {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n margin-top: 4px;\n}\n.ss-chat-item-tip {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n flex-wrap: wrap;\n color: var(--text-color-third);\n}\n.ss-chat-item-tip-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 10px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-item-tip-content-option {\n padding: 6px 14px;\n border-radius: 16px;\n border: 1px solid var(--border-color-base);\n cursor: pointer;\n}\n.ss-chat-item-tip-content-option:hover {\n border-color: var(--chat-blue);\n color: var(--chat-blue);\n}\n.ss-chat-item-tip-content-option-disabled {\n cursor: auto;\n}\n.ss-chat-item-tip-content-option-disabled:hover {\n color: var(--text-color-secondary);\n border-color: var(--border-color-base);\n}\n.ss-chat-item-tip-content-option-active {\n border-color: var(--chat-blue);\n color: var(--chat-blue);\n cursor: auto;\n}\n.ss-chat-item-tip-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 4px;\n}\n.ss-chat-item-tip-item-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-item-tip-item-filter-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 12px;\n row-gap: 6px;\n}\n.ss-chat-item-tip-item-option {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n}\n.ss-chat-item-mobile-tip-item-option .ant-picker-panel-container .ant-picker-panels {\n flex-wrap: wrap !important;\n width: 280px !important;\n}\n.ss-chat-item-tip-item-filter-name {\n color: var(--text-color-secondary);\n font-weight: 500;\n}\n.ss-chat-item-mode-name {\n margin-right: -10px;\n font-weight: 500;\n}\n.ss-chat-item-tip-item-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-entity-info {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n column-gap: 12px;\n color: var(--text-color-third);\n font-size: 14px;\n}\n.ss-chat-item-dimension-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n}\n.ss-chat-item-dimension-name {\n color: var(--text-color-third);\n}\n.ss-chat-item-dimension-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-metric-info-list {\n margin-top: 30px;\n display: flex;\n flex-direction: column;\n row-gap: 30px;\n}\n.ss-chat-item-typing {\n width: 100%;\n padding: 0 5px;\n}\n.ss-chat-item-typing .ant-spin-dot {\n width: 100% !important;\n height: 100% !important;\n}\n.ss-chat-item-typing-bubble {\n width: fit-content;\n}\n.ss-chat-item-text-bubble {\n width: fit-content;\n}\n.ss-chat-item-text {\n line-height: 1.5;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n user-select: text;\n}\n.ss-chat-item-toggle-expand-btn {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n cursor: pointer;\n}\n.ss-chat-item-step-item {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n border-left: 1px solid var(--green);\n overflow: auto;\n}\n.ss-chat-item-export-data {\n margin-left: 12px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-filter-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n font-weight: 500;\n}\n.ss-chat-filter-item-filter-name {\n color: var(--text-color-secondary);\n}\n.ss-chat-filter-item-select-control {\n min-width: 120px;\n border-radius: 6px;\n}\n.ss-chat-filter-item-operator-control {\n min-width: 80px;\n border-radius: 6px;\n margin-right: 8px;\n}\n.ss-chat-filter-item-input-number-control {\n min-width: 100px;\n}\n.ss-chat-filter-item-switch-entity-tip {\n display: flex;\n align-items: center;\n column-gap: 6px;\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 13px;\n font-weight: normal;\n}\n.ss-chat-filter-item .ant-select-selector,\n.ss-chat-filter-item .ant-input-number-input {\n background-color: #f5f8fb !important;\n border-color: #ececec !important;\n}\n.ss-chat-filter-item .ant-select-selection-item,\n.ss-chat-filter-item .ant-input-number-input {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-filter-item .ant-select-multiple .ant-select-selection-item {\n background-color: var(--light-blue-background);\n}\n.ss-chat-filter-item-filter-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-sql-item {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n border-left: 1px solid var(--green);\n overflow: auto;\n}\n.ss-chat-sql-item-toggle-expand-btn {\n color: var(--text-color-fourth);\n font-size: 12px;\n margin-right: 10px;\n cursor: pointer;\n}\n.ss-chat-sql-item-code {\n margin-top: 10px !important;\n padding: 6px 14px 8px !important;\n border: 1px solid var(--border-color-base) !important;\n border-radius: 4px !important;\n background: #f5f8fb !important;\n}\n.ss-chat-sql-item-copy-btn {\n position: absolute;\n top: 24px;\n right: 20px;\n background: transparent !important;\n border: 0 !important;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-sql-item-schema-row {\n display: flex;\n margin-top: 10px;\n}\n.ss-chat-sql-item-schema-row:first-child {\n margin-top: 0;\n}\n.ss-chat-sql-item-schema-title {\n width: 50px;\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-sql-item-schema-content {\n flex: 1;\n color: var(--text-color);\n}\n.ss-chat-sql-item-few-shot-item {\n margin-top: 10px;\n}\n.ss-chat-sql-item-few-shot-item:first-child {\n margin-top: 4px;\n}\n.ss-chat-sql-item-few-shot-title {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-sql-item-few-shot-content {\n margin-top: 8px;\n display: flex;\n flex-direction: column;\n row-gap: 2px;\n}\n.ss-chat-sql-item-few-shot-content-item {\n display: flex;\n align-items: baseline;\n}\n.ss-chat-sql-item-few-shot-content-title {\n width: 50px;\n color: var(--text-color);\n}\n.ss-chat-sql-item-few-shot-content-text {\n line-height: 24px;\n color: var(--text-color-secondary);\n}\n.ss-chat-sql-item-few-shot-code {\n padding: 0 !important;\n background-color: transparent !important;\n}\n.ss-chat-sql-item-export-log {\n margin-left: 20px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-sql-item-copilot {\n width: 700px;\n}\n.ss-chat-similar-questions {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n overflow: auto;\n}\n.ss-chat-similar-questions-toggle-expand-btn {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n cursor: pointer;\n}\n.ss-chat-similar-questions-content {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n margin-top: 6px;\n margin-bottom: 2px;\n}\n.ss-chat-similar-questions-question {\n width: fit-content;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-tools {\n display: flex;\n align-items: center;\n margin-top: 12px;\n column-gap: 6px;\n}\n.ss-chat-tools-feedback {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 0 10px 0 10px;\n color: var(--text-color-third);\n column-gap: 20px;\n}\n.ss-chat-tools-like {\n margin-right: 4px;\n}\n.ss-chat-tools-feedback-active {\n color: #eac54f;\n}\n.ss-chat-tools-mobile-tools {\n display: flex;\n flex-direction: column;\n margin-top: 12px;\n row-gap: 10px;\n}\n.ss-chat-tools-tools {\n margin-top: 0;\n}\n.ss-chat-tools-feedback {\n margin-left: 2px;\n}\n.ss-chat-tools-feedback-item {\n display: flex;\n align-items: flex-start;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n.ss-chat-tools-feedback-item-title {\n width: 40px;\n margin-right: 20px;\n text-align: right;\n font-size: 14px;\n font-weight: 500;\n color: var(--text-color);\n}\n.ss-chat-tools-font-style {\n font-size: 12px;\n color: grey;\n font-style: italic;\n text-align: center;\n}\n.ss-chat-recommend-options {\n padding: 8px 0 12px;\n}\n.ss-chat-recommend-options-item-name-column {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.ss-chat-recommend-options-entity-name:hover {\n color: var(--primary-color);\n}\n.ss-chat-recommend-options-table-row {\n cursor: pointer;\n}\n.ss-chat-drill-down-dimensions {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n.ss-chat-drill-down-dimensions-section {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 6px;\n}\n.ss-chat-drill-down-dimensions-title {\n color: var(--text-color-third);\n}\n.ss-chat-drill-down-dimensions-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-drill-down-dimensions-content-item-name {\n color: var(--chat-blue);\n font-weight: 500;\n border-bottom: 1px solid var(--chat-blue);\n padding: 1px;\n cursor: pointer;\n}\n.ss-chat-drill-down-dimensions-content-item-active {\n color: #fff;\n border-bottom: none;\n background-color: var(--chat-blue);\n border-radius: 2px;\n}\n.ss-chat-drill-down-dimensions-menu-item-active {\n color: var(--chat-blue);\n}\n.ss-chat-drill-down-dimensions-down-arrow {\n color: var(--chat-blue);\n}\n.ss-chat-drill-down-dimensions-cancel-drill-down {\n margin-left: 20px;\n color: var(--text-color-third);\n cursor: pointer;\n padding: 0 4px;\n border: 1px solid var(--text-color-third);\n border-radius: 4px;\n font-size: 12px;\n}\n.ss-chat-drill-down-dimensions-cancel-drill-down:hover {\n color: var(--chat-blue);\n border-color: var(--chat-blue);\n}\n.ss-chat-metric-options {\n display: flex;\n flex-direction: column;\n}\n.ss-chat-metric-options-section {\n width: 100%;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 6px;\n row-gap: 4px;\n}\n.ss-chat-metric-options-metric-card {\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n border-radius: 8px;\n background-color: #fff;\n width: fit-content;\n padding: 2px 4px;\n font-size: 12px;\n}\n.ss-chat-metric-options-title {\n color: var(--text-color-third);\n}\n.ss-chat-metric-options-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-options-content-item-name {\n color: var(--chat-blue);\n font-weight: 500;\n border-bottom: 1px solid var(--chat-blue);\n padding: 1px;\n cursor: pointer;\n}\n.ss-chat-metric-options-content-item-active {\n color: #fff;\n border-bottom: none;\n background-color: var(--chat-blue);\n border-radius: 2px;\n}\n.ss-chat-metric-options-menu-item-active {\n color: var(--chat-blue);\n}\n.ss-chat-metric-options-cancel-select {\n margin-left: 12px;\n color: var(--text-color-third);\n cursor: pointer;\n padding: 0 4px;\n border: 1px solid var(--text-color-third);\n border-radius: 4px;\n font-size: 12px;\n}\n.ss-chat-metric-options-cancel-select:hover {\n color: var(--chat-blue);\n border-color: var(--chat-blue);\n}\n",{}),function(e){e[e.NORMAL=0]="NORMAL",e[e.SEARCH_EXCEPTION=1]="SEARCH_EXCEPTION",e[e.EMPTY=2]="EMPTY",e[e.INVALID=3]="INVALID"}(Me||(Me={})),function(e){e.COMPLETED="COMPLETED",e.PENDING="PENDING",e.FAILED="FAILED"}(Ae||(Ae={})),function(e){e.DOMAIN="DOMAIN",e.DIMENSION="DIMENSION",e.METRIC="METRIC",e.VALUE="VALUE"}(ke||(ke={})),(Le={})[ke.DOMAIN]="数据模型",Le[ke.DIMENSION]="维度",Le[ke.METRIC]="指标",Le[ke.VALUE]="维度值",function(e){e.None="无",e.TenThousand="万",e.EnTenThousand="w",e.OneHundredMillion="亿",e.Thousand="k",e.Million="M",e.Giga="G"}(De||(De={}));var qe="#446dff",Re="rgba(153, 153, 153, 0.3)",Oe="ss-chat",Fe={DAY:[{label:"近7天",value:7},{label:"近30天",value:30},{label:"近60天",value:60},{label:"近90天",value:90}],WEEK:[{label:"近4周",value:4},{label:"近12周",value:12},{label:"近24周",value:24},{label:"近52周",value:52}],MONTH:[{label:"近3个月",value:3},{label:"近6个月",value:6},{label:"近12个月",value:12},{label:"近24个月",value:24}]},Be=["#3369FF","#36D2B8","#DB8D76","#47B359","#8545E6","#E0B18B","#7258F3","#0095FF","#52CC8F","#6675FF","#CC516E","#5CA9E6"],Pe="查询出错啦,数据库可能出现异常或者负载繁忙,请联系管理员或者稍后重试";(ze={})[Me.SEARCH_EXCEPTION]="数据查询异常",ze[Me.INVALID]="智能助理不太懂您说什么呐,回去一定补充知识";var Qe,je,Ye="ss-chat",We={SUM:"总计",AVG:"平均值",MAX:"最大值",MIN:"最小值"};function Ve(e,n,t){return void 0===t&&(t={}),"".concat(Ue((null==t?void 0:t.needMultiply100)?100*+e:e,(null==t?void 0:t.decimalPlaces)||2)).concat("percent"===n?"%":"")}function Ue(e,n){if(null==e||""===e)return 0;if(isNaN(+e)||n<0||n>100)return e;var t=(+e).toFixed(n);if(!/^-?[0-9.]+$/g.test(t))return"0";for(;t.includes(".")&&(t.endsWith(".")||t.endsWith("0"));)t=t.slice(0,-1);return t}function Ge(e){if(null==e||""===e)return 0;if(isNaN(+e))return e;var n=e.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}function He(e){return Ge(Ue(e,4))}!function(e){e.TEXT="TEXT",e.METRIC_CARD="METRIC_CARD",e.TABLE="TABLE",e.METRIC_TREND="METRIC_TREND",e.METRIC_BAR="METRIC_BAR",e.MARKDOWN="MARKDOWN",e.METRIC_PIE="METRIC_PIE"}(Qe||(Qe={})),function(e){e.AGGREGATE="AGGREGATE",e.METRIC_TAG="METRIC_TAG",e.ID="ID",e.DETAIL="DETAIL",e.OTHER="OTHER"}(je||(je={}));var Xe=function(e,n){if(n&&(void 0===e||0==+e))return 0;if(void 0===e)return"-";if(!isFinite(+e))return e;var t=Math.abs(+e),o=t>=1e8?De.OneHundredMillion:t>=1e4?De.TenThousand:De.None,a=function(e,n){var t=+e;if(isNaN(t)||n===De.None)return e;var o=0;switch(n){case De.TenThousand:case De.EnTenThousand:o=4;break;case De.OneHundredMillion:o=8;break;case De.Thousand:o=3;break;case De.Million:o=6;break;case De.Giga:o=9}return t/Math.pow(10,o)}(e,o);return"number"==typeof(a=Ge(a=Ue(a,o===De.OneHundredMillion?2:t<1?3:1)))&&isNaN(a)||0==+a?"-":"".concat(a).concat(o===De.None?"":o)},Ke=function(e){return isNaN(e)?"-":Math.abs(+e)>=1e4?(e/1e4).toFixed(1)+"万":Ue(e,2)},Je=function(n,t){return n.reduce((function(n,o){var a=e({},n),i=o[t];return a[i]||(a[i]=[]),a[i].push(o),a}),{})};function $e(e,n){var t;if(null==e?void 0:e.includes("rgb")){var o=e.match(/\d+/g).map(Number);t={r:o[0],g:o[1],b:o[2],a:o[3]}}else t=function(e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(e)||{};return"rgba(".concat(t.r+n,",").concat(t.g+n,",").concat(t.b+n).concat(t.a?",".concat(t.a):"",")")}var Ze=window.navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i);function en(e){localStorage.setItem("SUPERSONIC_TOKEN",e)}function nn(){return localStorage.getItem("SUPERSONIC_TOKEN")}window.navigator.userAgent.match(/(iPhone|iPod|ios)/i),window.navigator.userAgent.match(/(Android)/i);var tn=function(e){setTimeout((function(){var n=document.getElementById("messageContainer");if(n&&n.scrollHeight>n.clientHeight)if(e){var t=document.getElementById(e);t&&(n.scrollTop=n.scrollHeight-t.clientHeight-130)}else n.scrollTop=n.scrollHeight}),100)},on=function(e,n){void 0===e&&(e=8),void 0===n&&(n=62);var t,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];if(e)for(t=0;t<e;t++)a[t]=o[Math.floor(Math.random()*n)];else{var i=void 0;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",t=0;t<36;t++)a[t]||(i=Math.floor(16*Math.random()),a[t]=o[19===t?i%4%8+8:i])}return a.join("")},an=null;function ln(e,n){return null===n?"":n}var rn=H({scriptUrl:"//at.alicdn.com/t/c/font_4120566_7rwv3aw6wep.js"}),cn="style_module_leftAvatar__4b5996c0";Ee(".style_module_leftAvatar__4b5996c0 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n margin-right: 6px;\n color: var(--chat-blue);\n font-size: 40px;\n background-color: #fff;\n border-radius: 50%;\n}\n",{});var dn=function(){return a(rn,{type:"icon-zhinengsuanfa",className:cn})},sn={message:"style_module_message__2d45d9fd",messageTitleBar:"style_module_messageTitleBar__2d45d9fd",modelName:"style_module_modelName__2d45d9fd",messageTopBar:"style_module_messageTopBar__2d45d9fd",messageContent:"style_module_messageContent__2d45d9fd",messageBody:"style_module_messageBody__2d45d9fd",avatar:"style_module_avatar__2d45d9fd",bubble:"style_module_bubble__2d45d9fd",text:"style_module_text__2d45d9fd",textMsg:"style_module_textMsg__2d45d9fd",topBar:"style_module_topBar__2d45d9fd",messageTitleWrapper:"style_module_messageTitleWrapper__2d45d9fd",messageTitle:"style_module_messageTitle__2d45d9fd",right:"style_module_right__2d45d9fd",textBubble:"style_module_textBubble__2d45d9fd",listenerSex:"style_module_listenerSex__2d45d9fd",listenerArea:"style_module_listenerArea__2d45d9fd",typing:"style_module_typing__2d45d9fd",messageEntityName:"style_module_messageEntityName__2d45d9fd",messageAvatar:"style_module_messageAvatar__2d45d9fd",dataHolder:"style_module_dataHolder__2d45d9fd",subTitle:"style_module_subTitle__2d45d9fd",subTitleValue:"style_module_subTitleValue__2d45d9fd",avatarPopover:"style_module_avatarPopover__2d45d9fd",moreOption:"style_module_moreOption__2d45d9fd",selectOthers:"style_module_selectOthers__2d45d9fd",indicators:"style_module_indicators__2d45d9fd",indicator:"style_module_indicator__2d45d9fd",contentName:"style_module_contentName__2d45d9fd",aggregatorIndicator:"style_module_aggregatorIndicator__2d45d9fd",entityId:"style_module_entityId__2d45d9fd",idTitle:"style_module_idTitle__2d45d9fd",idValue:"style_module_idValue__2d45d9fd",typingBubble:"style_module_typingBubble__2d45d9fd",quote:"style_module_quote__2d45d9fd",filterSection:"style_module_filterSection__2d45d9fd",filterItem:"style_module_filterItem__2d45d9fd",noPermissionTip:"style_module_noPermissionTip__2d45d9fd",tip:"style_module_tip__2d45d9fd",infoBar:"style_module_infoBar__2d45d9fd",mainEntityInfo:"style_module_mainEntityInfo__2d45d9fd",infoItem:"style_module_infoItem__2d45d9fd",infoName:"style_module_infoName__2d45d9fd",infoValue:"style_module_infoValue__2d45d9fd",textWrapper:"style_module_textWrapper__2d45d9fd",rightTextWrapper:"style_module_rightTextWrapper__2d45d9fd",rightAvatar:"style_module_rightAvatar__2d45d9fd"};Ee(".style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd {\n display: flex;\n align-items: baseline;\n margin-bottom: 6px;\n column-gap: 10px;\n}\n.style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd .style_module_modelName__2d45d9fd {\n margin-left: 4px;\n color: var(--text-color);\n font-weight: 500;\n}\n.style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd .style_module_messageTopBar__2d45d9fd {\n position: relative;\n max-width: 80%;\n overflow: hidden;\n color: var(--text-color-third);\n font-size: 13px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd {\n display: flex;\n align-items: flex-start;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_messageBody__2d45d9fd {\n width: 100%;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_avatar__2d45d9fd {\n margin-right: 4px;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd {\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 8px 16px 10px;\n background: rgba(255, 255, 255, 0.8);\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_text__2d45d9fd {\n line-height: 1.5;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n user-select: text;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_textMsg__2d45d9fd {\n padding: 12px 0 5px;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd {\n display: flex;\n align-items: center;\n max-width: 100%;\n padding: 4px 0 8px;\n overflow-x: auto;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n border-bottom: 1px solid rgba(0, 0, 0, 0.03);\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd .style_module_messageTitleWrapper__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd .style_module_messageTitle__2d45d9fd {\n display: flex;\n align-items: center;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd {\n flex-direction: row-reverse;\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd {\n float: right;\n box-sizing: border-box;\n padding: 8px 16px;\n color: #fff;\n font-size: 14px;\n background: linear-gradient(81.62deg, #2870ea 8.72%, var(--chat-blue) 85.01%);\n border: 1px solid transparent;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_text__2d45d9fd::selection {\n background: #1ba1f7;\n}\n.style_module_textBubble__2d45d9fd {\n width: fit-content;\n}\n.style_module_listenerSex__2d45d9fd {\n padding-bottom: 24px;\n}\n.style_module_listenerArea__2d45d9fd {\n padding-top: 24px;\n padding-bottom: 12px;\n}\n.style_module_typing__2d45d9fd {\n width: 100%;\n padding: 0 5px;\n}\n.style_module_typing__2d45d9fd .ant-spin-dot {\n width: 100%;\n}\n.style_module_messageEntityName__2d45d9fd {\n cursor: pointer;\n}\n.style_module_messageEntityName__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_messageAvatar__2d45d9fd {\n margin-right: 8px;\n}\n.style_module_dataHolder__2d45d9fd {\n position: relative;\n}\n.style_module_subTitle__2d45d9fd {\n margin-left: 20px;\n color: var(--text-color-third);\n font-weight: normal;\n font-size: 12px;\n}\n.style_module_subTitle__2d45d9fd .style_module_subTitleValue__2d45d9fd {\n margin-left: 6px;\n color: var(--text-color);\n font-size: 13px;\n}\n.style_module_avatarPopover__2d45d9fd .ant-popover-inner-content {\n padding: 3px 4px !important;\n}\n.style_module_moreOption__2d45d9fd {\n display: flex;\n align-items: center;\n margin-top: 10px;\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.style_module_moreOption__2d45d9fd .style_module_selectOthers__2d45d9fd {\n color: var(--text-color);\n cursor: pointer;\n}\n.style_module_moreOption__2d45d9fd .style_module_selectOthers__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd {\n display: flex;\n align-items: center;\n margin-left: 12px;\n column-gap: 12px;\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd .style_module_indicator__2d45d9fd {\n cursor: pointer;\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd .style_module_indicator__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_contentName__2d45d9fd {\n max-width: 350px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_aggregatorIndicator__2d45d9fd {\n color: var(--text-color);\n font-weight: 500;\n font-size: 20px;\n}\n.style_module_entityId__2d45d9fd {\n display: flex;\n align-items: center;\n margin-left: 12px;\n column-gap: 4px;\n}\n.style_module_entityId__2d45d9fd .style_module_idTitle__2d45d9fd {\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.style_module_entityId__2d45d9fd .style_module_idValue__2d45d9fd {\n color: var(--text-color-fourth);\n font-size: 13px;\n cursor: pointer;\n}\n.style_module_entityId__2d45d9fd .style_module_idValue__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_typingBubble__2d45d9fd {\n width: fit-content;\n}\n.style_module_quote__2d45d9fd {\n margin-bottom: 4px;\n padding: 0 4px 0 6px;\n color: var(--border-color-base);\n font-size: 13px;\n border-left: 4px solid var(--border-color-base);\n border-top-left-radius: 2px;\n border-bottom-left-radius: 2px;\n}\n.style_module_filterSection__2d45d9fd {\n display: flex;\n align-items: center;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.style_module_filterSection__2d45d9fd .style_module_filterItem__2d45d9fd {\n padding: 2px 12px;\n color: var(--text-color-secondary);\n background-color: #edf2f2;\n border-radius: 13px;\n}\n.style_module_noPermissionTip__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_tip__2d45d9fd {\n margin-left: 6px;\n color: var(--text-color-third);\n}\n.style_module_infoBar__2d45d9fd {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-top: 20px;\n column-gap: 20px;\n}\n.style_module_mainEntityInfo__2d45d9fd {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n font-size: 13px;\n column-gap: 20px;\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd .style_module_infoName__2d45d9fd {\n color: var(--text-color-fourth);\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd .style_module_infoValue__2d45d9fd {\n color: var(--text-color-secondary);\n}\n.style_module_textWrapper__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_textWrapper__2d45d9fd.style_module_rightTextWrapper__2d45d9fd {\n justify-content: flex-end;\n}\n.style_module_textWrapper__2d45d9fd .style_module_rightAvatar__2d45d9fd {\n margin-left: 6px;\n}\n",{});var un,mn,_n,pn=function(n){var t,o=n.position,i=n.width,l=n.height,r=n.children,c=n.bubbleClassName,d=G(sn.message,((t={})[sn.left]="left"===o,t[sn.right]="right"===o,t));return a("div",e({className:d,style:{width:i}},{children:a("div",e({className:sn.messageContent},{children:a("div",e({className:sn.messageBody},{children:a("div",e({className:"".concat(sn.bubble).concat(c?" ".concat(c):""),style:{height:l},onClick:function(e){e.stopPropagation()}},{children:r}))}))}))}))},fn=function(n){var t,o=n.position,l=n.data,r=n.quote,c=(n.anonymousUser,G(sn.textWrapper,((t={})[sn.rightTextWrapper]="right"===o,t)));return i("div",e({className:c},{children:[!Ze&&"left"===o&&a(dn,{}),i(pn,e({position:o,bubbleClassName:sn.textBubble},{children:["right"===o&&r&&a("div",e({className:sn.quote},{children:r})),a("div",e({className:sn.text},{children:l}))]})),!Ze&&"right"===o&&""]}))};!function(e){e.TEXT="text",e.QUESTION="question",e.TAG="tag",e.SUGGESTION="suggestion",e.NO_PERMISSION="no_permission",e.SEMANTIC_DETAIL="semantic_detail",e.PLUGIN="PLUGIN",e.WEB_PAGE="WEB_PAGE",e.RECOMMEND_QUESTIONS="recommend_questions",e.AGENT_LIST="agent_list"}(un||(un={})),function(e){e.INTERPRET="interpret"}(mn||(mn={})),function(e){e.DASHBOARD="DASHBOARD",e.WIDGET="WIDGET",e.URL="URL",e.TAG="TAG"}(_n||(_n={}));var hn="style_module_messageContainer__2eea6c23",vn="style_module_messageList__2eea6c23",gn="style_module_messageItem__2eea6c23",yn="style_module_mobile__2eea6c23";Ee(".style_module_messageContainer__2eea6c23 {\n position: relative;\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 {\n display: flex;\n flex-direction: column;\n padding: 70px 20px 60px 14px;\n row-gap: 16px;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 {\n display: flex;\n flex-direction: column;\n row-gap: 20px;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-small .ant-table-tbody .ant-table-cell {\n padding: 6px 0 !important;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-small .ss-chat-table-formatted-value {\n font-size: 15px !important;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-row {\n background-color: #fff;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-tbody > tr > td {\n border-bottom: 1px solid #f0f0f0;\n transition: background 0.2s, border-color 0.2s;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ss-chat-table-even-row {\n background-color: #fbfbfb;\n}\n.style_module_messageContainer__2eea6c23.style_module_mobile__2eea6c23 .style_module_messageList__2eea6c23 {\n padding: 20px 10px 30px;\n}\n",{});var xn="style_module_agentTip__c53e79c4",bn="style_module_agentTipMsg__c53e79c4",wn="style_module_title__c53e79c4",In="style_module_content__c53e79c4",Nn="style_module_examples__c53e79c4",Sn="style_module_example__c53e79c4";Ee(".style_module_agentTip__c53e79c4 {\n display: flex;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 {\n padding: 12px 20px 20px !important;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_title__c53e79c4 {\n margin-bottom: 12px;\n font-size: 14px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 {\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n margin-top: 10px;\n column-gap: 14px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_topBar__c53e79c4 .style_module_tip__c53e79c4 {\n margin-top: 2px;\n font-size: 13px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_examples__c53e79c4 {\n display: flex;\n flex-direction: column;\n font-size: 13px;\n row-gap: 8px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_examples__c53e79c4 .style_module_example__c53e79c4 {\n color: var(--chat-blue);\n cursor: pointer;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4.style_module_fullscreen__c53e79c4 {\n flex: none;\n width: 280px;\n}\n",{});var Cn=function(n){var t,o=n.currentAgent,l=n.onSendMsg;return o?i("div",e({className:xn},{children:[!Ze&&a(dn,{}),i(pn,e({position:"left",bubbleClassName:bn},{children:[i("div",e({className:wn},{children:["您好,智能助理【",o.name,"】将与您对话,试着问:"]})),a("div",e({className:In},{children:a("div",e({className:Nn},{children:(null===(t=o.examples)||void 0===t?void 0:t.length)>0?o.examples.map((function(n){return i("div",e({className:Sn,onClick:function(){l(n)}},{children:["“",n,"”"]}),n)})):a("div",e({className:Sn},{children:o.description}))}))}))]}))]})):null},Tn=_e.create({baseURL:"https://www.trialuse.xin:9082",timeout:12e4,headers:{"Content-Type":"application/json"}});Tn.interceptors.request.use((function(e){var n=nn();return n&&(null==e?void 0:e.headers)&&(e.headers.Authorization="Bearer ".concat(n)),e}),(function(e){return Promise.reject(e)})),Tn.interceptors.response.use((function(e){if("REDIRECT"===e.headers.redirect){for(var n=window;n!==n.top;)n=n.top;var t=e.headers.contextpath;n.location.href=(null==t?void 0:t.substring(0,null==t?void 0:t.indexOf("&")))+"&redirect_uri=".concat(encodeURIComponent("http://".concat(n.location.host)))}return e.data}),(function(e){return e.response&&401===e.response.status&&console.log("Unauthorized, please log in again."),Promise.reject(e)}));var En=Ze?"/openapi":"/api";function Ln(e,n,t,o){return Tn.post("".concat(En,"/chat/query/search"),{queryText:e,chatId:n||0,modelId:t,agentId:o})}function Mn(e){var n=e.queryText,t=e.chatId,o=e.modelId,a=e.agentId,i=e.parseId,l=e.queryId,r=e.filters,c=e.parseInfo,d=e.dataSetIds;return Tn.post("".concat(En,"/chat/query/parse"),{queryText:n,chatId:t||0,dataSetId:d&&d.length>0?d[0]:o,agentId:a,parseId:i,queryId:l,selectedParse:c,dataSetIds:d,queryFilters:r?{filters:r}:void 0})}function An(e,n,t,o){return Tn.post("".concat(En,"/chat/query/execute"),{queryText:e,agentId:o,chatId:n||0,queryId:t.queryId,parseId:t.id,dataSetIds:t.dataSetIds})}function kn(e,n,t){return Tn.post("".concat(En,"/chat/query/switchQuery"),{queryText:e,modelId:n,chatId:t||0})}function zn(e){return Tn.post("".concat(En,"/chat/query/queryData"),e)}function Dn(e){return Tn.get("".concat(En,"/chat/manage/getChatQuery/").concat(e))}function qn(e){return Tn.delete("".concat(En,"/chat/manage/").concat(e))}function Rn(e,n){return Tn.post("".concat(En,"/chat/query/choice"),{entityId:e,modelId:n})}function On(e,n){return Tn.post("".concat(En,"/chat/manage/updateQAFeedback?id=").concat(e,"&score=").concat(n,"&feedback="))}function Fn(e,n,t,o,a){return Tn.post("".concat(En,"/chat/query/queryDimensionValue"),{modelId:e,bizName:n,agentId:t,elementID:o,value:a})}function Bn(e){return Tn.get("".concat(En,"/semantic/dataSet/").concat(e))}var Pn=function(){var n="".concat(Ye,"-item");return i("span",e({className:"".concat(n,"-loading")},{children:[a("span",{className:"".concat(n,"-loading-dot")}),a("span",{className:"".concat(n,"-loading-dot")}),a("span",{className:"".concat(n,"-loading-dot")})]}))},Qn=function(o){var l,c=o.entityId,d=o.modelId,s=o.modelName,u=o.onSelect,m=p([]),_=m[0],h=m[1],v=p(!1),g=v[0],y=v[1],x="".concat(Oe,"-recommend-options");f((function(){c&&n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return y(!0),[4,Rn(c,d)];case 1:return e=n.sent(),y(!1),h(e.data),[2]}}))}))}),[c]);var b,w,I,C=G(x,((l={})["".concat(x,"-mobile-mode")]=Ze,l));return a("div",e({className:C},{children:(b={dataIndex:"name",key:"name",title:"基本信息",render:function(n,t){return i("div",e({className:"".concat(x,"-item-name-column")},{children:[a(N,{shape:"square",icon:a(rn,{type:"艺人库"===s?"icon-geshou":"icon-zhuanji"}),src:t.url}),i("div",e({className:"".concat(x,"-entity-name")},{children:[n,t.ver&&"完整版"!==t.ver&&"-"!==t.ver&&"(".concat(t.ver,")"),t.singerName&&" - ".concat(t.singerName)]}))]}))}},w=s.includes("歌曲")?"tme3platAvgLogYyPlayCnt":"tme3platJsPlayCnt",I=Ze?[b]:[b,s.includes("艺人")?{dataIndex:"onlineSongCnt",key:"onlineSongCnt",title:"在架歌曲数",align:"center",render:function(e){return e?Xe(+e):"-"}}:{dataIndex:"publishTime",key:"publishTime",title:"发布时间",align:"center",render:function(e){return e?r(e).format("YYYY-MM-DD"):"-"}},{dataIndex:w,key:w,align:"center",title:s.includes("歌曲")?"近7天日均运营播放量":"昨日结算播放量",render:function(e){return e?Xe(+e):"-"}}],a(S,{rowKey:"id",columns:I,dataSource:_,showHeader:!Ze,size:"small",pagination:!1,loading:g,className:"".concat(x,"-table"),rowClassName:"".concat(x,"-table-row"),onRow:function(e){return{onClick:function(){u(e.id)}}}}))}))},jn=function(n){var t,o=n.entityName,l=n.chatContext,r=n.onSwitchEntity,c=p(!1),d=c[0],s=c[1],u=l||{},m=u.modelId,_=u.modelName,f=u.dimensionFilters,h="".concat(Ye,"-item"),v=null===(t=null==f?void 0:f.find((function(e){return"zyqk_song_id"===(null==e?void 0:e.bizName)||"singer_id"===(null==e?void 0:e.bizName)})))||void 0===t?void 0:t.value;return a(C,e({content:a(Qn,{entityId:v,modelId:m,modelName:_,onSelect:function(e){s(!1),r(e)}}),placement:"bottomLeft",trigger:"click",open:d,onOpenChange:function(e){return s(e)}},{children:i("div",e({className:"".concat(h,"-tip-item-value ").concat(h,"-switch-entity")},{children:[o,a(X,{className:"".concat(h,"-down-icon")})]}))}))},Yn=function(o){var r,c,u,m,_=o.disabled,g=void 0!==_&&_,y=o.modelId,x=o.filters,b=o.filter,w=o.index,I=o.chatContext,N=o.agentId,S=o.entityAlias,C=o.integrateSystem,A=o.onFiltersChange,k=o.onSwitchEntity,z=p([]),D=z[0],q=z[1],R=p(!1),O=R[0],F=R[1],B=h(0),P="".concat(Ye,"-filter-item");f((function(){"string"!=typeof b.value&&!d(b.value)||0!==D.length||"showcase"===C||n(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,Fn(y,b.bizName,N,b.elementID,"")];case 1:return e=t.sent().data,q((null===(n=null==e?void 0:e.resultList)||void 0===n?void 0:n.map((function(e){return{label:e[b.bizName],value:e[b.bizName]}})))||[]),[2]}}))}))}),[]);var Q=v((function(){return s((function(e){B.current+=1;var n=B.current;q([]),F(!0),Fn(y,b.bizName,N,b.elementID,e).then((function(e){var t;n===B.current&&(q((null===(t=e.data)||void 0===t?void 0:t.resultList.map((function(e){return{label:e[b.bizName],value:e[b.bizName]}})))||[]),F(!1))}))}),500)}),[Fn]),j=function(e){var n=x.map((function(n,t){return n.bizName===b.bizName&&w===t&&(n.value="number"==typeof b.value||null===b.value||d(e)?e:"".concat(e),d(e)?1===e.length?(n.operator="=",n.value=e[0]):(n.operator="IN",n.value=e):n.value="number"==typeof b.value||null===b.value?e:"".concat(e)),n}));A(n)};return i("span",e({className:P},{children:[i("span",e({className:"".concat(P,"-filter-name")},{children:[b.name,":"]})),("number"==typeof b.value||null===b.value||b.operator&&!["IN","=","LIKE"].includes(b.operator))&&!(null===(r=b.bizName)||void 0===r?void 0:r.includes("_id"))&&a(T,{options:[{label:"大于等于",value:">="},{label:"大于",value:">"},{label:"等于",value:"="},{label:"小于等于",value:"<="},{label:"小于",value:"<"}],disabled:g,className:"".concat(P,"-operator-control"),value:b.operator,onChange:function(e){var n=x.map((function(n,t){return n.bizName===b.bizName&&w===t&&(n.operator=e),n}));A(n)}}),"number"!=typeof b.value&&null!==b.value||(null===(c=b.bizName)||void 0===c?void 0:c.includes("_id"))?"string"==typeof b.value&&pe(b.value,"YYYY-MM-DD").isValid()?a(L,{value:pe(b.value),onChange:function(e,n){var t=x.map((function(e,t){return e.bizName===b.bizName&&w===t&&(e.value=n),e}));A(t)},allowClear:!1}):"string"!=typeof b.value&&!d(b.value)||(null===(u=b.bizName)||void 0===u?void 0:u.includes("_id"))?S&&["歌曲","艺人"].includes(S)&&(null===(m=b.bizName)||void 0===m?void 0:m.includes("_id"))?i(l,{children:[a(jn,{entityName:b.value,chatContext:I,onSwitchEntity:k}),i("span",e({className:"".concat(P,"-switch-entity-tip")},{children:["(如未匹配到相关",S,",可点击","艺人"===S?"歌手":S,"ID切换)"]}))]}):a("span",e({className:"".concat(P,"-filter-value")},{children:"object"!=typeof b.value?b.value:""})):a(T,{disabled:g,value:b.value,options:D.filter((function(e){return""!==e.value&&null!==e.value})),className:"".concat(P,"-select-control"),onSearch:Q,notFoundContent:O?a(M,{size:"small"}):null,onChange:j,mode:"multiple",showSearch:!0,allowClear:!0}):a(E,{disabled:g,className:"".concat(P,"-input-number-control"),value:b.value,onChange:j})]}))},Wn="".concat(Ye,"-item"),Vn=function(n){var t,o,r,c,d,s=n.parseInfo,u=n.dimensionFilters,m=n.entityInfo,_=n.onSwitchDataSet,p=n.availableDataSets,f=n.loadingDataSets,h=s||{},v=h.dataSet,g=h.dimensions,y=h.metrics,x=h.aggType,b=h.queryMode,w=h.queryType,I=h.properties,N=h.entity,S=h.elementMatches,C=null==g?void 0:g.filter((function(e){return"DIMENSION"===e.type})),T="".concat(Wn,"-tip-item-value"),E=(null==u?void 0:u.length)>0?u[0].value:void 0,L=null===(r=null===(o=null===(t=null==N?void 0:N.alias)||void 0===t?void 0:t[0])||void 0===o?void 0:o.split("."))||void 0===r?void 0:r[0],M=null===(c=null==S?void 0:S.find((function(e){var n;return"ID"===(null===(n=e.element)||void 0===n?void 0:n.type)})))||void 0===c?void 0:c.element.name,z=I||{},D=z.type,q=z.name,R="TAG_DETAIL"===b?null==C?void 0:C.concat(y||[]):C;return a("div",e({className:"".concat(Wn,"-tip-content")},{children:D&&"LLM_S2SQL"!==b?i("div",e({className:"".concat(Wn,"-tip-item")},{children:["将由","plugin"===D?"插件":"内置","工具",a("span",e({className:T},{children:q})),"来解答"]})):i(l,{children:[((null==b?void 0:b.includes("ENTITY"))||"LLM_S2SQL"===b)&&"string"==typeof E&&L&&M?i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:[L,":"]})),a("div",e({className:T},{children:M}))]})):i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"数据集:"})),a("div",e({className:T},{children:a(A,e({overlay:function(){if(f)return a(k,{children:a(k.Item,e({disabled:!0},{children:a("div",e({style:{padding:"8px 12px",color:"#999"}},{children:"加载中..."}))}),"loading")});if(!p||p.length<=1)return null;var n=p.map((function(n){return{key:n.id,label:i("div",e({onClick:function(){return e=n,void(_&&e.id!==(null==v?void 0:v.id)&&_(e));var e},style:{padding:"8px 12px",cursor:"pointer",backgroundColor:n.id===(null==v?void 0:v.id)?"#f0f8ff":"transparent",fontWeight:n.id===(null==v?void 0:v.id)?"bold":"normal",color:n.id===(null==v?void 0:v.id)?"#1890ff":"#333"}},{children:[n.name,n.id===(null==v?void 0:v.id)&&a("span",e({style:{marginLeft:"8px",color:"#52c41a",fontSize:"12px"}},{children:"✓ 当前使用"}))]}))}}));return 0===n.length?null:a(k,{children:n.map((function(e){return a(k.Item,{children:e.label},e.key)}))})}()||a(k,{}),placement:"bottomLeft",trigger:["click"],disabled:f||!p||p.length<=1},{children:i("span",e({style:{cursor:f||!p||p.length<=1?"default":"pointer",textDecoration:f||!p||p.length<=1?"none":"underline"}},{children:[f?"加载中...":null==v?void 0:v.name,!f&&p&&p.length>1&&a("span",e({style:{marginLeft:"4px",fontSize:"12px"}},{children:"▼"}))]}))}))}))]})),(w===je.AGGREGATE||"METRIC_TAG"===w||"DETAIL"===w)&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:",可点击切换,查询模式:"})),a("div",e({className:T},{children:w===je.AGGREGATE||"METRIC_TAG"===w?"聚合模式":"明细模式"}))]})),"DETAIL"!==w&&y&&y.length>0&&!(null==g?void 0:g.some((function(e){var n;return null===(n=e.bizName)||void 0===n?void 0:n.includes("_id")})))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"指标:"})),a("div",e({className:T},{children:y.map((function(e){return e.name})).join("、")}))]})),["METRIC_GROUPBY","METRIC_ORDERBY","TAG_DETAIL","LLM_S2SQL","METRIC_FILTER"].includes(b)&&R&&R.length>0&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:["DETAIL"===w?"查询字段":"下钻维度",":"]})),i("div",e({className:T},{children:[R.slice(0,2).map((function(e){return e.name})).join("、"),R.length>2&&"..."]}))]})),"TAG_ID"!==b&&!(null==g?void 0:g.some((function(e){var n;return null===(n=e.bizName)||void 0===n?void 0:n.includes("_id")})))&&(null===(d=null==m?void 0:m.dimensions)||void 0===d?void 0:d.filter((function(e){return null!=e.value})).map((function(n){return i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:[n.name,":"]})),a("div",e({className:T},{children:n.value}))]}),n.itemId)}))),("METRIC_ORDERBY"===b||"METRIC_MODEL"===b)&&x&&"NONE"!==x&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"聚合方式:"})),a("div",e({className:T},{children:We[x]}))]}))]})}))},Un=function(n){var t=n.markdown;n.loading,n.onApplyAuth;var o="".concat(Oe,"-markdown");return a("div",e({className:"".concat(o," markdown-body"),style:{fontSize:14}},{children:a(ge,e({rehypePlugins:[he],remarkPlugins:[ve]},{children:t}))}))};pe.extend(fe),pe.locale("zh-cn");var Gn=L.RangePicker,Hn=function(o){var r,c,d,s=o.isSimpleMode,u=void 0!==s&&s,m=o.parseInfoOptions,_=o.agentId,h=o.integrateSystem,v=o.parseTimeCost,g=o.isDeveloper,y=o.onSelectParseInfo,x=o.onSwitchEntity,b=o.onFiltersChange,w=o.onDateInfoChange,I=o.onRefresh,N=o.handlePresetClick,S=o.setSelectedDataSetIds,C=p(),T=C[0],E=C[1],L=p([]),M=L[0],A=L[1],k=p(!1),R=k[0],O=k[1];f((function(){n(void 0,void 0,void 0,(function(){var e,o,a,i,l;return t(this,(function(r){switch(r.label){case 0:if(e=m.map((function(e){return e.dataSet})).filter(Boolean),!((o=null==T?void 0:T.dataSetIds)&&o.length>1))return[3,6];O(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,Promise.all(o.map((function(e){return n(void 0,void 0,void 0,(function(){var n,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Bn(e)];case 1:return n=t.sent(),[2,(null===(a=n.data)||void 0===a?void 0:a.data)||n.data];case 2:return o=t.sent(),console.error("Failed to fetch dataset ".concat(e,":"),o),[2,null];case 3:return[2]}}))}))})))];case 2:return a=r.sent(),(i=a.filter(Boolean)).length>0?A(i):A(e),[3,5];case 3:return l=r.sent(),console.error("Failed to fetch datasets:",l),A(e),[3,5];case 4:return O(!1),[7];case 5:return[3,7];case 6:A(e),r.label=7;case 7:return[2]}}))}))}),[null==T?void 0:T.dataSetIds,m]);var F={"近7日":[pe().subtract(7,"day"),pe()],"近14日":[pe().subtract(14,"day"),pe()],"近30日":[pe().subtract(30,"day"),pe()],"本周":[pe().startOf("week"),pe().endOf("week")],"本月":[pe().startOf("month"),pe().endOf("month")],"上月":[pe().subtract(1,"month").startOf("month"),pe().subtract(1,"month").endOf("month")],"本季度":[pe().startOf("quarter"),pe().endOf("quarter")],"本年":[pe().startOf("year"),pe().endOf("year")]},B=T||{},P=B.modelId;B.queryMode;var Q,j,Y,W=B.entity,V=B.nativeQuery,U=null===(d=null===(c=null===(r=null==W?void 0:W.alias)||void 0===r?void 0:r[0])||void 0===c?void 0:c.split("."))||void 0===d?void 0:d[0],H=function(n,t){var o,l="".concat(Wn,"-tip-item-value"),r=t||{},c=r.startDate,d=r.endDate,s=G("".concat(Wn,"-tip-item-option"),((o={})["".concat(Wn,"-mobile-tip-item-option")]=Ze,o)),u=!0;return i("div",e({className:"".concat(Wn,"-tip-item-filter-content")},{children:[!!t&&i("div",e({className:s},{children:[a("span",e({className:"".concat(Wn,"-tip-item-filter-name")},{children:"数据时间:"})),V?a("span",e({className:l},{children:c===d?c:"".concat(c," ~ ").concat(d)})):a(Gn,{value:[pe(c),pe(d)],onChange:w,format:"YYYY-MM-DD",disabled:u,renderExtraFooter:function(){return a(z,e({gutter:[28,28]},{children:Object.keys(F).map((function(n){return a(D,{children:a(q,e({size:"small",onClick:function(){return N(F[n])}},{children:n}))},n)}))}))}})]})),null==n?void 0:n.map((function(e,t){return a(Yn,{disabled:u,modelId:P,filters:n,filter:e,index:t,chatContext:T,entityAlias:U,agentId:_,integrateSystem:h,onFiltersChange:b,onSwitchEntity:x},"".concat(e.name,"_").concat(t))}))]}))},X=function(n){var t=n.dateInfo,o=n.dimensionFilters;return a(l,{children:(!!t||!!(null==o?void 0:o.length))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"筛选条件:"})),a("div",e({className:"".concat(Wn,"-tip-item-content")},{children:H(o,t)}))]}))})};return Q=a("div",e({className:"".concat(Wn,"-title-bar")},{children:i("div",{children:["意图确认",!!v&&g&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",v,"ms)"]}))]})})),j=a(l,{children:i("div",{children:[m.map((function(n,t){var o=n||{},r=o.queryMode,c=o.properties,d=o.textInfo,s=o.id,m=o.dimensionFilters,_=o.entityInfo,p=(c||{}).type;return u?a(l,{children:a("div",e({style:{marginBottom:10}},{children:i("span",e({className:"".concat(Wn,"-content-parser-options-title"),style:{display:"flex"}},{children:[i("span",e({style:{paddingTop:3,marginRight:10}},{children:["解析",t+1,": "]}))," ",a(Un,{markdown:d})]}))}))}):i("div",e({style:{marginBottom:10,paddingBottom:10,borderBottom:"1px solid #eee"}},{children:[a("div",e({style:{marginBottom:10,height:"30px",lineHeight:"30px"}},{children:i("span",e({className:"".concat(Wn,"-content-parser-options-title")},{children:["解析",t+1,":"]}))})),a("div",e({className:"".concat(Wn,"-tip")},{children:i(l,{children:[Vn({parseInfo:n,dimensionFilters:m,entityInfo:_,onSwitchDataSet:function(t){S([t.id]),setTimeout((function(){I(e(e({},n),{dataSet:t,dataSetIds:[t.id],id:(null==n?void 0:n.id)||0}))}),0)},availableDataSets:M,loadingDataSets:R}),!(p&&"LLM_S2SQL"!==r)&&X(n)]})}))]}),"".concat(s,"-").concat(d))})),(null==m?void 0:m.length)>1&&a("div",e({className:"".concat(Wn,"-content-parser-container")},{children:i("div",e({className:"".concat(Wn,"-content-options")},{children:[!T&&a("span",e({className:"".concat(Wn,"-breathing-text")},{children:"请选择适合的解析意图,并进行下一步:"})),m.map((function(n,t){return i("div",e({className:"".concat(Wn,"-content-option ").concat(n.id===(null==T?void 0:T.id)?"".concat(Wn,"-content-option-active"):""," ").concat(T?"".concat(Wn,"-content-option-disabled"):""),onClick:function(){T||(E(n),y(n))}},{children:["解析",t+1]}),n.id)}))]}))}))]})}),i("div",e({className:"".concat(Wn,"-parse-tip")},{children:[u?a(l,{}):i("div",e({className:"".concat(Wn,"-title-bar")},{children:[Y?a(J,{className:"".concat(Wn,"-step-error-icon")}):a(K,{className:"".concat(Wn,"-step-icon")}),i("div",e({className:"".concat(Wn,"-step-title")},{children:[Q,void 0===j&&a(Pn,{})]}))]})),(j||null===j)&&a("div",e({className:G(!u&&"".concat(Wn,"-content-container"),null===j&&"".concat(Wn,"-empty-content-container"),Y&&"".concat(Wn,"-content-container-failed"))},{children:j}))]}))};pe.extend(fe),pe.locale("zh-cn");var Xn=L.RangePicker,Kn=function(o){var r,c,d,s,u=o.isSimpleMode,m=void 0!==u&&u,_=o.parseLoading,h=o.parseInfoOptions,v=o.parseTip,g=o.currentParseInfo,y=o.agentId,x=o.dimensionFilters,b=o.dateInfo,w=o.entityInfo,I=o.integrateSystem,N=o.parseTimeCost,S=o.isDeveloper;o.onSelectParseInfo;var C=o.onSwitchEntity,T=o.onFiltersChange,E=o.onDateInfoChange,L=o.onRefresh,M=o.handlePresetClick,A=o.setSelectedDataSetIds,k=p([]),R=k[0],O=k[1],F=p(!1),B=F[0],P=F[1];f((function(){n(void 0,void 0,void 0,(function(){var e,n,o,a,i,l,r;return t(this,(function(t){switch(t.label){case 0:if(e=h.map((function(e){return e.dataSet})).filter(Boolean),n=new Set,h.forEach((function(e){var t;(null===(t=e.dataSet)||void 0===t?void 0:t.id)&&n.add(e.dataSet.id),e.dataSetIds&&e.dataSetIds.forEach((function(e){return n.add(e)}))})),(null==g?void 0:g.dataSetIds)&&g.dataSetIds.forEach((function(e){return n.add(e)})),(null===(r=null==g?void 0:g.dataSet)||void 0===r?void 0:r.id)&&n.add(g.dataSet.id),!((o=Array.from(n)).length>0))return[3,6];P(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),a=o.map((function(e){return Bn(e).then((function(e){var n;return(null===(n=e.data)||void 0===n?void 0:n.data)||e.data}))})),[4,Promise.all(a)];case 2:return i=t.sent(),O(i),[3,5];case 3:return l=t.sent(),console.error("获取候选数据集信息失败:",l),O(e),[3,5];case 4:return P(!1),[7];case 5:return[3,7];case 6:O(e),t.label=7;case 7:return[2]}}))}))}),[null==g?void 0:g.dataSetIds,null===(r=null==g?void 0:g.dataSet)||void 0===r?void 0:r.id,h]);var Q={"近7日":[pe().subtract(7,"day"),pe()],"近14日":[pe().subtract(14,"day"),pe()],"近30日":[pe().subtract(30,"day"),pe()],"本周":[pe().startOf("week"),pe().endOf("week")],"本月":[pe().startOf("month"),pe().endOf("month")],"上月":[pe().subtract(1,"month").startOf("month"),pe().subtract(1,"month").endOf("month")],"本季度":[pe().startOf("quarter"),pe().endOf("quarter")],"本年":[pe().startOf("year"),pe().endOf("year")]},j=function(n,t,o){return i("div",e({className:"".concat(Wn,"-parse-tip")},{children:[i("div",e({className:"".concat(Wn,"-title-bar")},{children:[o?a(J,{className:"".concat(Wn,"-step-error-icon")}):a(K,{className:"".concat(Wn,"-step-icon")}),i("div",e({className:"".concat(Wn,"-step-title")},{children:[n,void 0===t&&a(Pn,{})]}))]})),(t||null===t)&&a("div",e({className:G("".concat(Wn,"-content-container"),null===t&&"".concat(Wn,"-empty-content-container"),o&&"".concat(Wn,"-content-container-failed"))},{children:t}))]}))};if(_)return j("意图解析中");if(v)return j(i(l,{children:["意图解析失败",!!N&&S&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",N,"ms)"]}))]}),v,!0);if(m||0===h.length)return null;var Y=g||{},W=Y.modelId,V=Y.queryMode,U=Y.properties,H=Y.entity,X=Y.nativeQuery;Y.textInfo;var Z=null===(s=null===(d=null===(c=null==H?void 0:H.alias)||void 0===c?void 0:c[0])||void 0===d?void 0:d.split("."))||void 0===s?void 0:s[0],ee=function(n){var t,o="".concat(Wn,"-tip-item-value"),l=b||{},r=l.startDate,c=l.endDate,d=G("".concat(Wn,"-tip-item-option"),((t={})["".concat(Wn,"-mobile-tip-item-option")]=Ze,t));return i("div",e({className:"".concat(Wn,"-tip-item-filter-content")},{children:[!!b&&i("div",e({className:d},{children:[a("span",e({className:"".concat(Wn,"-tip-item-filter-name")},{children:"数据时间:"})),X?a("span",e({className:o},{children:r===c?r:"".concat(r," ~ ").concat(c)})):a(Xn,{value:[pe(r),pe(c)],onChange:E,format:"YYYY-MM-DD",renderExtraFooter:function(){return a(z,e({gutter:[28,28]},{children:Object.keys(Q).map((function(n){return a(D,{children:a(q,e({size:"small",onClick:function(){return M(Q[n])}},{children:n}))},n)}))}))}})]})),null==n?void 0:n.map((function(e,t){return a(Yn,{modelId:W,filters:n,filter:e,index:t,chatContext:g,entityAlias:Z,agentId:y,integrateSystem:I,onFiltersChange:T,onSwitchEntity:C},"".concat(e.name,"_").concat(t))}))]}))},ne=(U||{}).type,te=i("div",e({className:"".concat(Wn,"-tip")},{children:[Vn({parseInfo:g,dimensionFilters:x,entityInfo:w,onSwitchDataSet:function(n){var t;n.id!==(null===(t=null==g?void 0:g.dataSet)||void 0===t?void 0:t.id)&&(A([n.id]),setTimeout((function(){L(e(e({},g),{dataSet:n,dataSetIds:[n.id],id:(null==g?void 0:g.id)||0}))}),0))},availableDataSets:R,loadingDataSets:B}),!(ne&&"LLM_S2SQL"!==V)&&i(l,{children:[(!!b||!!(null==x?void 0:x.length))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"筛选条件:"})),a("div",e({className:"".concat(Wn,"-tip-item-content")},{children:ee(x)}))]})),i(q,e({className:"".concat(Wn,"-reload"),size:"small",onClick:function(){return L(g)}},{children:[a($,{}),"重新查询"]}))]})]}));return j(a("div",e({className:"".concat(Wn,"-title-bar")},{children:i("div",{children:["意图解析",!!N&&S&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",N,"ms)"]}))]})})),"PLAIN_TEXT"===V?null:te)},Jn=function(n){var t=n.model,o=n.onApplyAuth,l="".concat(Ye,"-apply-auth");return i("div",e({className:l},{children:["暂无权限,",o?a("span",e({className:"".concat(l,"-apply"),onClick:function(){o(t)}},{children:"点击申请"})):"请联系管理员申请权限"]}))},$n=function(n){var t,o=n.model,l=n.chartType,r=n.onApplyAuth,c="".concat(Oe,"-no-permission-chart"),d=G("".concat(c,"-holder"),((t={})["".concat(c,"-bar-chart-holder")]="barChart"===l,t));return i("div",e({className:c},{children:[a("div",{className:d}),a("div",e({className:"".concat(c,"-no-permission")},{children:a(Jn,{model:o,onApplyAuth:r})}))]}))},Zn=function(n){var t=n.instanceRef,o=n.question,a=n.options;return{downloadChartAsImage:function(){var n=function(){if(t.current)return t.current.getConnectedDataURL(e({type:"png",pixelRatio:2,backgroundColor:"#fff",excludeComponents:["toolbox"]},a))}();n?(!function(e){var n=document.createElement("a");n.href=e,n.download="".concat(o,".png"),n.click()}(n),R.success("导出图片成功")):R.error("该条消息暂不支持导出图片")}}},et=function(n){var t,l=n.data,c=n.question,d=void 0===c?"":c,s=n.triggerResize,u=n.loading,m=n.metricField,_=n.onApplyAuth,p=h(),v=h(),g=l.queryColumns,x=l.queryResults,b=l.entityInfo,w=(null===(t=null==g?void 0:g.find((function(e){return"CATEGORY"===e.showType})))||void 0===t?void 0:t.bizName)||"",I=null==g?void 0:g.find((function(e){return"NUMBER"===e.showType}));null==I||I.bizName;if(f((function(){x&&x.length>0&&(null==I?void 0:I.authorized)&&function(){var e;v.current?e=v.current:(e=ye.init(p.current),v.current=e);var n=x||[],t=x[0]?Object.keys(x[0]).find((function(e){return e.toLowerCase().includes("date")||e.toLowerCase().includes("time")})):null,a=n;t&&(a=o([],n,!0).sort((function(e,n){return r(e[t]).diff(r(n[t]))})));var i,l=a.map((function(e){return void 0!==e[w]?e[w]:"未知"}));e.setOption({xAxis:{type:"category",axisTick:{show:!1},axisLine:{lineStyle:{color:Re}},axisLabel:{width:200,overflow:"truncate",showMaxLabel:!0,hideOverlap:!1,interval:0,color:"#333",rotate:30},data:l},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:"percent"===m.dataFormatType?Ve(e,m.dataFormatType,m.dataFormat):Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":"percent"===m.dataFormatType||"decimal"===m.dataFormatType?Ve(e.value,m.dataFormatType,m.dataFormat):Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"2%",right:"1%",bottom:"3%",top:20,containLabel:!0},series:{type:"bar",name:null==I?void 0:I.name,barWidth:20,itemStyle:{borderRadius:[10,10,0,0],color:new ye.graphic.LinearGradient(0,0,0,1,[{offset:0,color:qe},{offset:1,color:(i=qe,$e(i,80))}])},label:{show:!0,position:"top",formatter:function(e){var n=e.value;return 0===n?0:"percent"===m.dataFormatType?Ve(n,m.dataFormatType,m.dataFormat):Xe(n)}},data:a.map((function(e){return e[(null==I?void 0:I.bizName)||""]}))}}),e.resize()}()}),[x]),f((function(){s&&v.current&&v.current.resize()}),[s]),I&&!(null==I?void 0:I.authorized))return a($n,{model:(null==b?void 0:b.dataSetInfo.name)||"",chartType:"barChart",onApplyAuth:_});var N="".concat(Ye,"-bar"),S=Zn({instanceRef:v,question:d}).downloadChartAsImage;return(0,y(Nt).register)("downloadChartAsImage",S),i("div",{children:[a("div",e({className:"".concat(N,"-top-bar")},{children:a("div",e({className:"".concat(N,"-indicator-name")},{children:d}))})),a(M,e({spinning:u},{children:a("div",{className:"".concat(N,"-chart"),ref:p})}))]})},nt=function(n){var t,o=n.title,l=n.value,r="".concat(Ye,"-metric-card"),c=G("".concat(r,"-period-compare-item-value"),((t={})["".concat(r,"-period-compare-item-value-up")]=!l.includes("-"),t["".concat(r,"-period-compare-item-value-down")]=l.includes("-"),t));return i("div",e({className:"".concat(r,"-period-compare-item")},{children:[a("div",e({className:"".concat(r,"-period-compare-item-title")},{children:o})),i("div",e({className:c},{children:[a(rn,{type:l.includes("-")?"icon-xiajiang":"icon-shangsheng"}),a("div",{children:l})]}))]}))},tt=function(n){var t,o,l=n.data,r=n.question,c=n.loading,d=n.onApplyAuth,s=l.queryMode,u=l.queryColumns,m=l.queryResults,_=l.entityInfo,f=(l.aggregateInfo||{}).metricInfos,h=null==u?void 0:u.find((function(e){return"NUMBER"===e.showType})),v=(null==h?void 0:h.bizName)||"",g=h||{},y=g.dataFormatType,x=g.dataFormat,b=(null===(o=null==m?void 0:m[0])||void 0===o?void 0:o[v])||0,w="".concat(Ye,"-metric-card"),I=G(w,((t={})["".concat(Ye,"-metric-card-dsl")]="LLM_S2SQL"===s,t)),N=p(!1),S=N[0],C=N[1];return i("div",e({className:I},{children:[a("div",e({className:"".concat(w,"-top-bar")},{children:a("div",e({className:"".concat(w,"-indicator-name")},{children:r}))})),a(M,e({spinning:c},{children:i("div",e({className:"".concat(w,"-indicator")},{children:[h&&!(null==h?void 0:h.authorized)?a(Jn,{model:(null==_?void 0:_.dataSetInfo.name)||"",onApplyAuth:d}):i("div",e({style:{display:"flex",alignItems:"flex-end"}},{children:[a("div",e({className:"".concat(w,"-indicator-value")},{children:"string"==typeof b&&isNaN(+b)?b:"percent"===y||"decimal"===y?Ve(b,y,x):S?He(b)||"-":Ke(+b)})),!isNaN(+b)&&+b>=1e4&&a("div",e({className:"".concat(w,"-indicator-switch")},{children:a(Z,{onClick:function(){C(!S)}})}))]})),(null==f?void 0:f.length)>0&&a("div",e({className:"".concat(w,"-period-compare")},{children:Object.keys(f[0].statistics).map((function(e){return a(nt,{title:e,value:f[0].statistics[e]})}))}))]}))}))]}))},ot=function(n){var t,o=n.model,i=n.dateColumnName,l=n.categoryColumnName,c=n.metricField,s=n.resultList,u=n.triggerResize,m=n.onApplyAuth,_=n.chartType,p=h(),v=h(),g=function(){var n,t;v.current?(t=v.current).clear():(t=ye.init(p.current),v.current=t);var o=c.bizName,a=s.map((function(n){var t;return e(e({},n),((t={})[i]=Array.isArray(n[i])?r(n[i].join("")).format("MM-DD"):n[i],t))})),u=Je(a,l),m=function(e,n){var t=e.map((function(e){return r(e[n])}));return[r.min(t).format("YYYY-MM-DD"),r.max(t).format("YYYY-MM-DD")]}(a,i),f=m[0],h=m[1],g=Object.keys(u).reduce((function(n,t){return n[t]=f&&h&&(i.includes("date")||i.includes("month"))?function(n,t,o,a,i,l){var c=function(e,n,t){var o=[],a=n.diff(e,t||"days"),i="months"===t?"YYYY-MM":"YYYY-MM-DD";o.push(e.format(i));for(var l=1;l<=a;l++)o.push(e.add(1,t||"days").format(i));return o}(r(a),r(i),l),d=c.map((function(a){var i,c=n.find((function(e){return r(e[t]).format("months"===l?"YYYY-MM":"YYYY-MM-DD")===a}));return e(e({},c||{}),((i={})[t]=a,i[o]=c?c[o]:0,i))}));return d}(u[t],i,o,f,h,i.includes("month")?"months":"days"):u[t],n}),{}),y=Object.keys(g).sort((function(e,n){return g[n][g[n].length-1][o]-g[e][g[e].length-1][o]})),x=null===(n=g[y[0]])||void 0===n?void 0:n.map((function(e){var n=d(e[i])?e[i].join("-"):"".concat(e[i]);return 10===n.length?r(n).format("MM-DD"):n}));t.setOption({legend:l&&{left:0,top:0,icon:"rect",itemWidth:15,itemHeight:5,type:"scroll"},xAxis:{type:"category",axisTick:{alignWithLabel:!0,lineStyle:{color:Re}},axisLine:{lineStyle:{color:Re}},axisLabel:{showMaxLabel:!0,color:"#999"},data:x},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:"percent"===c.dataFormatType?Ve(e,c.dataFormatType,c.dataFormat):Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.sort((function(e,n){return n.value-e.value})).map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":"percent"===c.dataFormatType||"decimal"===c.dataFormatType?Ve(e.value,c.dataFormatType,c.dataFormat):Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"1%",right:"4%",bottom:"3%",top:l?45:20,containLabel:!0},series:y.slice(0,20).map((function(e,n){var t=g[e];return{type:_,name:l?e:c.name,symbol:"circle",showSymbol:1===t.length,smooth:!0,data:t.map((function(e){var n,t=e[o];return"percent"!==c.dataFormatType&&"decimal"!==c.dataFormatType||!(null===(n=c.dataFormat)||void 0===n?void 0:n.needMultiply100)?t:100*t})),color:Be[n]}}))}),t.resize()},x=Zn({instanceRef:v,question:c.name}).downloadChartAsImage;(0,y(Nt).register)("downloadChartAsImage",x),f((function(){c.authorized&&g()}),[s,c,_]),f((function(){u&&v.current&&v.current.resize()}),[u]);var b="".concat(Oe,"-metric-trend"),w=G("".concat(b,"-flow-trend-chart"),((t={})["".concat(b,"-flow-trend-chart-single")]=!l,t));return a("div",{children:c.authorized?a("div",{className:w,ref:p}):a($n,{model:o||"",onApplyAuth:m})})},at=function(n){var t=n.data,o=n.size,l=n.loading,c=n.question,d=n.onApplyAuth,s=t.entityInfo,u=t.queryColumns,m=t.queryResults,_="".concat(Oe,"-table"),p=u.map((function(n){var t=n.name,o=n.bizName,i=n.showType,l=n.dataFormatType,r=n.dataFormat,c=n.authorized;return{dataIndex:o,key:o,title:t||o,sorter:"NUMBER"===i?function(e,n){return e[o]-n[o]}:void 0,render:function(n){return c?"percent"===l?a("div",e({className:"".concat(_,"-formatted-value")},{children:"".concat(n?Ve(n,l,r):"0%")})):"NUMBER"===i?a("div",e({className:"".concat(_,"-formatted-value")},{children:Ge(n)})):o.includes("photo")?a("div",e({className:"".concat(_,"-photo")},{children:a("img",{width:40,height:40,src:n,alt:""})})):n:a(Jn,{model:(null==s?void 0:s.dataSetInfo.name)||"",onApplyAuth:d})}}})),f=u.find((function(e){return"DATE"===e.type||"DATE"===e.showType})),h=f?m.sort((function(e,n){return r(e[f.bizName]).diff(r(n[f.bizName]))})):m;return i("div",e({className:_},{children:[c&&a("div",e({className:"".concat(_,"-top-bar")},{children:a("div",e({className:"".concat(_,"-indicator-name")},{children:c}))})),a(S,{pagination:!(m.length<=10)&&{defaultPageSize:10,position:["bottomCenter"]},columns:p,dataSource:h,style:{width:"100%",overflowX:"auto",overflowY:"hidden"},rowClassName:function(e,n){return n%2!=0?"".concat(_,"-even-row"):""},size:o,loading:l})]}))},it=function(n){var t=n.aggregateInfo,o=n.currentMetricField,l=(t||{}).metricInfos,r=(null==l?void 0:l[0])||{}||{},c=r.date,d=r.value,s=r.statistics,u=o.dataFormatType,m=o.dataFormat,_="".concat(Ye,"-metric-info"),f=p(!1),h=f[0],v=f[1];return a("div",e({className:_},{children:i("div",e({className:"".concat(_,"-indicator")},{children:[i("div",e({style:{display:"flex",alignItems:"flex-end"}},{children:[a("div",e({className:"".concat(_,"-indicator-value")},{children:"percent"===u||"decimal"===u?Ve(d,u,m):h?He(d):Ke(+d)})),!isNaN(+d)&&+d>=1e4&&a("div",e({className:"".concat(_,"-indicator-switch")},{children:a(Z,{onClick:function(){v(!h)}})}))]})),i("div",e({className:"".concat(_,"-bottom-section")},{children:[i("div",e({className:"".concat(_,"-date")},{children:["最新数据日期:",a("span",e({className:"".concat(_,"-date-value")},{children:c}))]})),(null==l?void 0:l.length)>0&&a("div",e({className:"".concat(_,"-period-compare")},{children:Object.keys(s).map((function(e){return a(nt,{title:e,value:l[0].statistics[e]})}))}))]}))]}))}))},lt=function(n){var t,o=n.chatContext,r=n.currentDateOption,c=n.onSelectDateOption,d="".concat(Oe,"-date-options"),s=Fe[null===(t=null==o?void 0:o.dateInfo)||void 0===t?void 0:t.period]||Fe.DAY;return a("div",e({className:d},{children:s.map((function(n,t){var o,u=G("".concat(d,"-item"),((o={})["".concat(d,"-date-active")]=n.value===r,o["".concat(d,"-date-mobile")]=Ze,o));return i(l,{children:[i("div",e({className:u,onClick:function(){c(n.value)}},{children:[n.label,n.value===r&&a("div",{className:"".concat(d,"-active-identifier")})]}),n.value),t!==s.length-1&&a("div",{className:"".concat(d,"-item-divider")})]})}))}))},rt=function(e){var n=e.dateColumnName,t=e.metricFields,o=e.resultList,i=e.triggerResize,l=e.chartType,c=e.question,s=h(),u=h(),m=Zn({instanceRef:u,question:c}).downloadChartAsImage;(0,y(Nt).register)("downloadChartAsImage",m),f((function(){!function(){var e;u.current?(e=u.current).clear():(e=ye.init(s.current),u.current=e);var a=null==o?void 0:o.map((function(e){var t=d(e[n])?e[n].join("-"):"".concat(e[n]);return 10===t.length?r(t).format("MM-DD"):t}));e.setOption({legend:{left:0,top:0,icon:"rect",itemWidth:15,itemHeight:5,type:"scroll"},xAxis:{type:"category",axisTick:{alignWithLabel:!0,lineStyle:{color:Re}},axisLine:{lineStyle:{color:Re}},axisLabel:{showMaxLabel:!0,color:"#999"},data:a},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.sort((function(e,n){return n.value-e.value})).map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"1%",right:"4%",bottom:"3%",top:45,containLabel:!0},series:t.map((function(e,n){return{type:l,name:e.name,symbol:"circle",showSymbol:1===o.length,smooth:!0,data:o.map((function(n){var t,o=n[e.bizName];return"percent"!==e.dataFormatType&&"decimal"!==e.dataFormatType||!(null===(t=e.dataFormat)||void 0===t?void 0:t.needMultiply100)?o:100*o})),color:Be[n]}}))}),e.resize()}()}),[o,l]),f((function(){i&&u.current&&u.current.resize()}),[i]);var _="".concat(Oe,"-metric-trend");return a("div",{className:"".concat(_,"-flow-trend-chart"),ref:s})},ct=[{value:"line",label:"折线图"},{value:"bar",label:"柱状图"}],dt=function(n){var t,o,l=n.data,r=n.question,c=n.chartIndex,d=n.triggerResize,s=n.loading;n.activeMetricField;var u=n.drillDownDimension,m=n.currentDateOption,_=n.onApplyAuth,f=n.onSelectDateOption,h=l.queryColumns,v=l.queryResults,g=l.aggregateInfo,y=l.entityInfo,x=l.chatContext,b=p("line"),w=b[0],I=b[1],N=null==h?void 0:h.find((function(e){return"DATE"===e.showType||"DATE"===e.type})),S=(null==N?void 0:N.bizName)||"",C=(null===(t=null==h?void 0:h.find((function(e){return"CATEGORY"===e.showType})))||void 0===t?void 0:t.bizName)||"",E=null==h?void 0:h.filter((function(e){return"NUMBER"===e.showType})),L=null==h?void 0:h.find((function(e){return"NUMBER"===e.showType}));if(!L)return null;var A="".concat(Oe,"-metric-trend");return a("div",e({className:A},{children:i("div",e({className:"".concat(A,"-charts")},{children:[a("div",e({className:"".concat(A,"-top-bar")},{children:a("div",e({className:"".concat(A,"-metric-fields ").concat(A,"-metric-field-single")},{children:r}))})),a(M,e({spinning:s},{children:i("div",e({className:"".concat(A,"-content")},{children:[!Ze&&(null===(o=null==g?void 0:g.metricInfos)||void 0===o?void 0:o.length)>0&&void 0===u&&a(it,{aggregateInfo:g,currentMetricField:L}),i("div",e({className:"".concat(A,"-select-options")},{children:[a(lt,{chatContext:x,currentDateOption:m,onSelectDateOption:f}),a("div",{children:a(T,{defaultValue:"line",bordered:!1,options:ct,onChange:function(e){return I(e)}})})]})),1===(null==v?void 0:v.length)||c%2==1?a(at,{data:e(e({},l),{queryResults:v}),onApplyAuth:_}):E.length>1?a(rt,{dateColumnName:S,metricFields:E,question:r,resultList:v,triggerResize:d,chartType:w}):a(ot,{model:null==y?void 0:y.dataSetInfo.name,dateColumnName:S,categoryColumnName:C,metricField:L,resultList:v,triggerResize:d,onApplyAuth:_,chartType:w})]}))}))]}))}))},st=function(n){var t=n.columns,o=n.referenceColumn,l=n.dataSource,r=p(),c=r[0],d=r[1],s=p(!1),u=s[0],m=s[1],_=p([]),h=_[0],v=_[1],g="".concat(Oe,"-text");f((function(){!function(){var e=l[0][t[0].bizName];if(d(void 0===e?"暂无数据":e),o){var n=l[0][o.bizName];v(n||[])}}()}),[]);return i("div",e({style:{lineHeight:"24px",width:"fit-content",maxWidth:"100%",overflowX:"hidden"}},{children:[c,h.length>0&&i("span",e({className:"".concat(g,"-check-more"),onClick:function(){m(!u)}},{children:[u?"收起":"查看","更多",a(u?ee:X,{className:"".concat(g,"-arrow-icon")})]})),h.length>0&&u&&a("div",e({className:"".concat(g,"-reference-data")},{children:h.map((function(n){return i("div",e({className:"".concat(g,"-reference-item")},{children:[a("div",e({className:"".concat(g,"-reference-item-title")},{children:n.doc_title})),a("div",e({className:"".concat(g,"-reference-item-value")},{children:n.doc_chunk}))]}),n.doc_title)}))}))]}))},ut=function(n){var t=n.drillDownDimension,o=n.dimensions,l=n.isSecondDrillDown,r=n.onSelectDimension,c=n.onCancelDrillDown,d="".concat(Oe,"-drill-down-dimensions"),s=o.slice(0,5);return 0===s.length?null:i("div",e({className:"".concat(d,"-section")},{children:[i("div",e({className:"".concat(d,"-title")},{children:[l?"二级":"推荐","下钻维度:"]})),i("div",e({className:"".concat(d,"-content")},{children:[s.map((function(n,o){var l,c=G("".concat(d,"-content-item-name"),((l={})["".concat(d,"-content-item-active")]=(null==t?void 0:t.id)===n.id,l));return i("div",{children:[a("span",e({className:c,onClick:function(){r((null==t?void 0:t.id)===n.id?void 0:n)}},{children:n.name})),o!==s.length-1&&a("span",{children:"、"})]})})),o.length>5&&i("div",{children:[a("span",{children:"、"}),a(A,e({overlay:a(k,{children:o.slice(5).map((function(n){var o,i=G(((o={})["".concat(d,"-menu-item-active")]=(null==t?void 0:t.id)===n.id,o));return a(k.Item,{children:a("span",e({className:i,onClick:function(){r(n)}},{children:n.name}))},n.id)}))})},{children:i("span",{children:[a("span",e({className:"".concat(d,"-content-item-name")},{children:"更多"})),a(X,{className:"".concat(d,"-down-arrow")})]})}))]}),t&&i("div",e({className:"".concat(d,"-cancel-drill-down"),onClick:c},{children:["取消",l?"二级":"","下钻"]}))]}))]}))},mt=function(o){var l=o.drillDownDimensions,r=o.drillDownDimension,c=o.secondDrillDownDimension,d=o.originDimensions,s=o.dimensionFilters,u=o.onSelectDimension,m=o.onSelectSecondDimension,_=p([]),h=_[0],v=_[1],g="".concat(Oe,"-drill-down-dimensions");f((function(){n(void 0,void 0,void 0,(function(){return t(this,(function(e){return v(l.filter((function(e){return!((null==s?void 0:s.some((function(n){return n.name===e.name})))||d&&d.some((function(n){return n.id===e.id})))})).slice(0,20)),[2]}))}))}),[]);return i("div",e({className:g},{children:[a(ut,{drillDownDimension:r,dimensions:h,onSelectDimension:u,onCancelDrillDown:function(){u(void 0)}}),r&&h.length>1&&a(ut,{drillDownDimension:c,dimensions:h.filter((function(e){return e.id!==(null==r?void 0:r.id)})),isSecondDrillDown:!0,onSelectDimension:m,onCancelDrillDown:function(){m(void 0)}})]}))},_t=function(n){var t,o=n.metrics,l=n.defaultMetric,r=n.currentMetric,c=n.isMetricCard,d=n.onSelectMetric,s=Ze?2:5,u="".concat(Oe,"-metric-options"),m=o.filter((function(e){return e.id!==(null==l?void 0:l.id)})).slice(0,s),_=G("".concat(u,"-section"),((t={})["".concat(u,"-metric-card")]=c,t));return m.length?a("div",e({className:u},{children:i("div",e({className:_},{children:[a("div",e({className:"".concat(u,"-title")},{children:"推荐相关指标:"})),a("div",e({className:"".concat(u,"-content")},{children:m.map((function(n,t){var o,c=G("".concat(u,"-content-item-name"),((o={})["".concat(u,"-content-item-active")]=(null==r?void 0:r.id)===n.id,o));return i("div",{children:[a("span",e({className:c,onClick:function(){d((null==r?void 0:r.id)===n.id?l:n)}},{children:n.name})),t!==m.length-1&&a("span",{children:"、"})]})}))})),(null==r?void 0:r.id)!==(null==l?void 0:l.id)&&a("div",e({className:"".concat(u,"-cancel-select"),onClick:function(){d(l)}},{children:"取消"}))]}))})):null},pt=function(e){var n=e.data,t=e.metricField,i=e.categoryField,l=e.triggerResize,c=h(),d=h(),s=n.queryResults,u=(null==i?void 0:i.bizName)||"",m=(null==t?void 0:t.bizName)||"";return f((function(){s&&s.length>0&&function(){var e;d.current?e=d.current:(e=ye.init(c.current),d.current=e);var n=s||[],a=s[0]?Object.keys(s[0]).find((function(e){return e.toLowerCase().includes("date")||e.toLowerCase().includes("time")})):null,i=n;a&&(i=o([],n,!0).sort((function(e,n){return r(e[a]).diff(r(n[a]))})));var l=i.map((function(e,n){var t=e[m];return{name:void 0!==e[u]?e[u]:"未知",value:t,itemStyle:{color:Be[n%Be.length]}}}));e.setOption({tooltip:{trigger:"item",formatter:function(e){var n=e.value;return"".concat(e.name,": ").concat("percent"===t.dataFormatType?Ve(n,t.dataFormatType,t.dataFormat):Xe(n))}},legend:{orient:"vertical",left:"left",type:"scroll",data:l.map((function(e){return e.name})),selectedMode:!0,textStyle:{color:"#666"}},series:[{name:"占比",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:"14",fontWeight:"bold"}},labelLine:{show:!1},data:l}]}),e.resize()}()}),[s,t,i]),f((function(){l&&d.current&&d.current.resize()}),[l]),a("div",{className:"".concat(Ye,"-pie-chart"),ref:c})},ft=[{value:"pie",label:"饼图"},{value:"bar",label:"柱状图"}],ht=function(n){var t,o=n.data,l=n.question,r=n.triggerResize,c=n.loading,d=n.metricField,s=n.categoryField,u=n.onApplyAuth,m=p("pie"),_=m[0],f=m[1],h=o.entityInfo;if(d&&!(null==d?void 0:d.authorized))return a($n,{model:(null===(t=null==h?void 0:h.dataSetInfo)||void 0===t?void 0:t.name)||"",chartType:"pieChart",onApplyAuth:u});var v="".concat(Ye,"-pie");return i("div",e({className:v},{children:[a("div",e({className:"".concat(v,"-metric-fields ").concat(v,"-metric-field-single")},{children:l})),a("div",e({className:"".concat(v,"-select-options")},{children:a(T,{defaultValue:"pie",bordered:!1,options:ft,onChange:function(e){return f(e)}})})),"pie"===_?a(pt,{data:o,metricField:d,categoryField:s,triggerResize:r}):a(et,{data:o,triggerResize:r,loading:c,metricField:d,onApplyAuth:u})]}))},vt=function(l){var r,c,d,s,u=l.queryId,m=l.question,_=l.data,h=l.chartIndex,v=l.triggerResize,g=l.forceShowTable,y=void 0!==g&&g,x=l.isSimpleMode,b=l.onMsgContentTypeChange,w=_||{},I=w.queryColumns,N=w.queryResults,S=w.chatContext,C=w.queryMode,T=S||{},E=T.dimensionFilters,L=T.elementMatches,M=p([]),A=M[0],k=M[1],z=p(),D=z[0],q=z[1],R=p(N),O=R[0],F=R[1],B=p(),P=B[0],Q=B[1],j=p(),Y=j[0],W=j[1],V=p(!1),U=V[0],H=V[1],X=p(),K=X[0],J=X[1],$=p(),Z=$[0],ee=$[1],ne=p(),te=ne[0],oe=ne[1],ae=p(),ie=ae[0],le=ae[1],re="".concat(Ye,"-chat-msg"),ce=function(e){var n=e.find((function(e){return"more"===e.showType}));q(n),k(e.filter((function(e){return"more"!==e.showType})))};f((function(){var e,n,t,o;ce(I),F(N),J(null===(e=null==S?void 0:S.metrics)||void 0===e?void 0:e[0]),ee(null===(n=null==S?void 0:S.metrics)||void 0===n?void 0:n[0]),oe(null===(t=null==S?void 0:S.dateInfo)||void 0===t?void 0:t.dateMode),le(null===(o=null==S?void 0:S.dateInfo)||void 0===o?void 0:o.unit),Q(void 0),W(void 0)}),[_]);var de=A.filter((function(e){return"NUMBER"===e.showType})),se=function(){var e=1===O.length,n=A.find((function(e){return"DATE"===e.showType||"DATE"===e.type})),t=A.filter((function(e){return"CATEGORY"===e.showType})),o=A.filter((function(e){return"NUMBER"===e.showType}));if(A){if(x)return Qe.MARKDOWN;if(y)return Qe.TABLE;var a="LLM_S2SQL"===C&&e&&1===o.length&&1===A.length,i=(C.includes("METRIC")||a)&&e,l=!(null==I?void 0:I.length);return l?Qe.TEXT:i?Qe.METRIC_CARD:l||i||!(t.length>1||"TAG_DETAIL"===C||"ENTITY_DIMENSION"===C||1===(null==O?void 0:O.length)||1===t.length&&0===o.length)?n&&o.length>0&&t.length<=1&&!(o.length>1&&t.length>0)&&O.some((function(e){return e[n.bizName]!==O[0][n.bizName]}))?Qe.METRIC_TREND:t.length>0&&1===(null==o?void 0:o.length)&&(Ze?(null==O?void 0:O.length)<=5:(null==O?void 0:O.length)<=10)&&O.every((function(e){return e[o[0].bizName]>=0}))?Qe.METRIC_PIE:(null==t?void 0:t.length)>0&&1===(null==o?void 0:o.length)&&(Ze?(null==O?void 0:O.length)<=5:(null==O?void 0:O.length)<=50)&&O.every((function(e){return isFinite(Number(e[o[0].bizName]))}))?Qe.METRIC_BAR:Qe.TABLE:Qe.TABLE}};if(f((function(){var e=se();e&&(null==b||b(e))}),[_,A,x]),!I||!N||!A)return null;var ue=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i;return t(this,(function(t){switch(t.label){case 0:return H(!0),[4,zn(e(e(e({},S),o),{queryId:u,parseId:S.id}))];case 1:return n=t.sent(),H(!1),200===n.code&&(ce((null===(a=n.data)||void 0===a?void 0:a.queryColumns)||[]),F((null===(i=n.data)||void 0===i?void 0:i.queryResults)||[])),[2]}}))}))},me=function(n){le(n),oe("RECENT"),ue({metrics:[Z||K],dimensions:P?o(o([],S.dimensions||[],!0),[P],!1):S.dimensions,dateInfo:e(e({},null==S?void 0:S.dateInfo),{dateMode:"RECENT",unit:n})})},_e=G(((r={})[re]=![Qe.TABLE,Qe.MARKDOWN].includes(se()),r)),pe=(null==E?void 0:E.length)>0?E[0].value:void 0,fe=null===(d=null===(c=null==L?void 0:L.find((function(e){var n;return"ID"===(null===(n=e.element)||void 0===n?void 0:n.type)})))||void 0===c?void 0:c.element)||void 0===d?void 0:d.name,he=("TAG_LIST_FILTER"===C||"METRIC_TAG"===C)&&"string"==typeof pe&&void 0!==fe,ve=(C.includes("METRIC")||"LLM_S2SQL"===C)&&se()!==Qe.TEXT&&!he,ge=null===(s=null==S?void 0:S.metrics)||void 0===s?void 0:s.filter((function(e){return I.every((function(n){return n.bizName!==e.bizName}))})),ye=(C.includes("METRIC")||"LLM_S2SQL"===C)&&(null==ge?void 0:ge.length)>0&&1===(null==I?void 0:I.filter((function(e){return"NUMBER"===e.showType})).length),xe=se(),be=xe?function(e){var n,t;return Ze?{maxWidth:"calc(100vw - 20px)"}:(null==N?void 0:N.length)&&I.length?e===Qe.METRIC_BAR?((n={})[N.length>5?"width":"minWidth"]=150*N.length,n):e===Qe.TABLE?((t={})[I.length>5?"width":"minWidth"]=150*I.length,t):e===Qe.METRIC_TREND||e===Qe.METRIC_PIE?{width:"calc(100vw - 410px)"}:void 0:void 0}(xe):void 0;return a("div",e({className:_e,style:be},{children:0===(null==O?void 0:O.length)?a("div",{children:"暂无数据"}):i("div",{children:[function(){switch(se()){case Qe.TEXT:return a(st,{columns:A,referenceColumn:D,dataSource:O});case Qe.METRIC_CARD:return a(tt,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,loading:U});case Qe.TABLE:return a(at,{question:m,data:e(e({},_),{queryColumns:A,queryResults:O}),loading:U});case Qe.METRIC_TREND:return a(dt,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,loading:U,chartIndex:h,triggerResize:v,activeMetricField:Z,drillDownDimension:P,currentDateOption:ie,onSelectDateOption:me});case Qe.METRIC_BAR:return a(et,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,triggerResize:v,loading:U,metricField:de[0]});case Qe.METRIC_PIE:var n=A.find((function(e){return"CATEGORY"===e.showType}));return a(ht,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,triggerResize:v,loading:U,metricField:de[0],categoryField:n});case Qe.MARKDOWN:return a("div",e({style:{maxHeight:800}},{children:a(Un,{markdown:_.textResult,loading:U})}));default:return a(at,{question:m,data:e(e({},_),{queryColumns:A,queryResults:O}),loading:U})}}(),(ye||ve)&&!x&&i("div",e({className:"".concat(re,"-bottom-tools ").concat(se()===Qe.METRIC_CARD?"".concat(re,"-metric-card-tools"):""," ").concat(Ze?"mobile":"")},{children:[ye&&a(_t,{metrics:S.metrics,defaultMetric:K,currentMetric:Z,onSelectMetric:function(n){var t;ee(n),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(t=S.dateInfo)||void 0===t?void 0:t.unit)}),dimensions:P?o(o([],S.dimensions||[],!0),[P],!1):S.dimensions,metrics:[n||K]})}}),ve&&a(mt,{drillDownDimensions:(null==_?void 0:_.recommendedDimensions)||[],drillDownDimension:P,secondDrillDownDimension:Y,originDimensions:S.dimensions,dimensionFilters:S.dimensionFilters,onSelectDimension:function(a){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){return H(!0),Q(a),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(n=S.dateInfo)||void 0===n?void 0:n.unit)}),dimensions:a?o(o([],S.dimensions||[],!0),[a],!1):S.dimensions,metrics:[Z||K]}),[2]}))}))},onSelectSecondDimension:function(n){var t;W(n),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(t=S.dateInfo)||void 0===t?void 0:t.unit)}),dimensions:o(o(o([],S.dimensions||[],!0),P?[P]:[],!0),n?[n]:[],!0),metrics:[Z||K]})}})]}))]})}))},gt=800,yt=function(e){var n=e.id,t=e.data,o=p(""),i=o[0],l=o[1],r=p(gt),c=r[0],d=r[1],s=t.response||{},u=s.name,m=s.webPage,_=m.url,h=m.params,v=g((function(e){var t=e.data,o=t.type,a=t.payload;if("changeMiniProgramContainerSize"!==o)if("storyResize"!==t);else{var i=document.getElementById("reportIframe_".concat(n)),l=i.contentDocument||i.document||i.contentWindow;setTimeout((function(){d("production"===process.env.NODE_ENV?function(e){var n,t=e.getElementById("titleArea"),o=Math.max((null==t?void 0:t.clientHeight)||0,(null==t?void 0:t.scrollHeight)||0),a=null===(n=e.getElementsByClassName("dashboardGrid"))||void 0===n?void 0:n[0],i=Math.max((null==a?void 0:a.clientHeight)||0,(null==a?void 0:a.scrollHeight)||0);return Math.max(o+i+10,gt)}(l):gt)}),200)}else{var r=a.msgId,c=a.height;"".concat(r)==="".concat(n)&&d(c)}}),[]);f((function(){return window.addEventListener("message",v),function(){window.removeEventListener("message",v)}}),[v]);return f((function(){!function(){var e,n=(null===(e=null==h?void 0:h.find((function(e){return"FORWARD"===e.paramType&&"height"===e.key})))||void 0===e?void 0:e.value)||gt;d(n);var t=_,o=(h||[]).filter((function(e){return"FORWARD"!==e.paramType})).reduce((function(e,n){return e[n.key]=n.value,e}),{});if(t.includes("?type=dashboard")||t.includes("?type=widget")){var a=encodeURIComponent(JSON.stringify(t.includes("dashboard")?{global:o}:{local:o}));t=t.replace("?","?token=".concat(nn(),"&miniProgram=true&reportName=").concat(u,"&filterData=").concat(a,"&")),t="".concat("").concat(t)}else{var i=Object.keys(o||{}).map((function(e){return"".concat(e,"=").concat(o[e])}));i.length>0&&(t=_.includes("?")?t.replace("?","?".concat(i.join("&"),"&")):"".concat(t,"?").concat(i.join("&")))}l(t)}()}),[]),a("iframe",{id:"reportIframe_".concat(n),name:"reportIframe_".concat(n),src:i,style:{width:Ze?"calc(100vw - 20px)":"calc(100vw - 410px)",height:c,border:"none"},title:"reportIframe",allowFullScreen:!0})},xt=function(n){var t,o=n.queryId,r=n.parseId,c=n.question,d=n.queryMode,s=n.executeLoading,u=n.entitySwitchLoading,m=void 0!==u&&u,_=n.chartIndex,h=n.executeTip,v=n.executeErrorMsg,g=n.executeItemNode,y=n.renderCustomExecuteNode,x=n.data,b=n.triggerResize,w=n.isDeveloper,I=n.isSimpleMode,N=n.enableStreamingSummary;n.onStreamingSummaryUpdate;var S=n.agentId;n.dataSetIds;var C="".concat(Ye,"-item"),T=p(!1),E=T[0],L=T[1],A=p(),k=A[0],z=A[1],D=p(!1),q=D[0],R=D[1],B=p(!1);B[0],B[1];var P=p("");P[0],P[1];var Q="PLAIN_TEXT"===d||"WEB_SERVICE"===d?"问答":"数据",j=function(n,t){return i(l,{children:[i("div",e({className:"".concat(C,"-title-bar")},{children:[a(K,{className:"".concat(C,"-step-icon")}),i("div",e({className:"".concat(C,"-step-title")},{children:[n,!t&&a(Pn,{})]}))]})),t&&a("div",e({className:"".concat(C,"-content-container")},{children:t}))]})};if(f((function(){}),[N,o,r,S]),s)return j("".concat(Q,"查询中"));if(h)return j(i(l,{children:[i("span",{children:[Q,"查询失败"]}),v&&i(O,{children:[a(ne,{style:{marginLeft:5,color:"red"}}),a("a",e({onClick:function(){R(!q)}},{children:q?"收起":"查看"}))]}),!!(null==x?void 0:x.queryTimeCost)&&w&&i("span",e({className:"".concat(C,"-title-tip")},{children:["(耗时: ",x.queryTimeCost,"ms)"]}))]}),a(l,{children:q&&a(xe,e({className:"".concat(C,"-code"),language:"sql",style:be},{children:v}))}));if(!x)return null;return i(l,{children:[!I&&i("div",e({className:"".concat(C,"-title-bar")},{children:[a(K,{className:"".concat(C,"-step-icon")}),i("div",e({className:"".concat(C,"-step-title ").concat(C,"-execute-title-bar"),style:{width:"100%"}},{children:[i("div",{children:[Q,"查询",!!(null==x?void 0:x.queryTimeCost)&&w&&i("span",e({className:"".concat(C,"-title-tip")},{children:["(耗时: ",x.queryTimeCost,"ms)"]}))]}),a("div",{children:[Qe.METRIC_TREND,Qe.METRIC_BAR,Qe.METRIC_PIE].includes(k)&&a(F,{checkedChildren:"表格",unCheckedChildren:"表格",onChange:function(e){L(e)}})})]}))]})),a("div",e({className:"".concat(C,"-content-container ").concat(I?"".concat(C,"-content-container-simple"):""),style:{borderLeft:"PLAIN_TEXT"===d?"none":void 0}},{children:i(M,e({spinning:m},{children:[(null===(t=x.queryAuthorization)||void 0===t?void 0:t.message)&&i("div",e({className:"".concat(C,"-auth-tip")},{children:["提示:",x.queryAuthorization.message]})),x.textSummary?a("div",e({className:"".concat(C,"-summary")},{children:a(ge,{children:x.textSummary})})):null,y&&g?g:"PLAIN_TEXT"===(null==x?void 0:x.queryMode)||"WEB_SERVICE"===(null==x?void 0:x.queryMode)?null==x?void 0:x.textResult:"WEB_PAGE"===(null==x?void 0:x.queryMode)?a(yt,{id:o,data:x}):a(vt,{isSimpleMode:I,forceShowTable:E,queryId:o,question:c,data:x,chartIndex:_,triggerResize:b,onMsgContentTypeChange:z})]}))}))]})},bt=function(n){var t,o,r=n.queryId,c=n.scoreValue,d=n.isLastMessage,s=n.isParserError,u=void 0!==s&&s,m=n.isSimpleMode,_=void 0!==m&&m,f=n.onExportData,h=n.onReExecute,v=p(c||0),g=v[0],x=v[1],b=p(!1),w=b[0],I=b[1],N="".concat(Oe,"-tools"),S=G("".concat(N,"-like"),((t={})["".concat(N,"-feedback-active")]=5===g,t)),C=G("".concat(N,"-dislike"),((o={})["".concat(N,"-feedback-active")]=1===g,o)),T=y(Nt).call;return a("div",e({className:N},{children:!Ze&&i("div",e({className:"".concat(N,"-feedback")},{children:[a("div",e({className:"".concat(N,"-feedback-left")},{children:!u&&i(l,{children:[i(q,e({size:"small",onClick:function(){I(!0),null==f||f(),setTimeout((function(){I(!1)}),1e3)},type:"text",loading:w},{children:[a(te,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"导出数据"}))]})),!_&&i(q,e({size:"small",onClick:function(){T("downloadChartAsImage")},type:"text"},{children:[a(oe,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"导出图片"}))]})),d&&i(q,e({size:"small",onClick:function(){null==h||h(r)},type:"text"},{children:[a(ae,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"再试一次"}))]}))]})})),i("div",e({className:"".concat(N,"-feedback-left")},{children:[a(ie,{className:S,onClick:function(){x(5),On(r,5)},style:{marginRight:10}}),a(le,{className:C,onClick:function(e){e.stopPropagation(),x(1),On(r,1)}})]}))]}))}))},wt=function(n){var t,o,r,c=n.agentId,d=n.queryId,s=n.question,u=n.llmReq,m=n.llmResp,_=n.integrateSystem,h=n.queryMode,v=n.sqlInfo,g=n.sqlTimeCost,y=n.executeErrorMsg,x=n.dataSetIds,b=p(""),w=b[0],I=b[1];f((function(){I((function(e){return e&&!v[e]?v.querySQL?"querySQL":v.correctedQuerySQL?"correctedQuerySQL":v.correctedS2SQL?"correctedS2SQL":v.parsedS2SQL?"parsedS2SQL":"":!e&&v.querySQL?"querySQL":e}))}),[v]),f((function(){I(""),setTimeout((function(){v.querySQL?I("querySQL"):v.correctedQuerySQL?I("correctedQuerySQL"):v.correctedS2SQL?I("correctedS2SQL"):v.parsedS2SQL&&I("parsedS2SQL")}),100)}),[x]);var N="".concat(Ye,"-item"),S="".concat(Ye,"-sql-item");if(!(u||v.parsedS2SQL||v.correctedS2SQL||v.querySQL))return null;var C=u||{},T=C.schema,E=C.terms,L=C.priorExts,M=(null===(t=Object.values((null==m?void 0:m.sqlRespMap)||{})[0])||void 0===t?void 0:t.fewShots)||[];return i("div",e({className:"".concat(N,"-parse-tip")},{children:[i("div",e({className:"".concat(N,"-title-bar")},{children:[a(K,{className:"".concat(N,"-step-icon")}),i("div",e({className:"".concat(N,"-step-title")},{children:["SQL生成",!!g&&i("span",e({className:"".concat(N,"-title-tip")},{children:["(耗时: ",g,"ms)"]})),":",w&&a("span",e({className:"".concat(S,"-toggle-expand-btn"),onClick:function(){I("")}},{children:a(ee,{})}))]})),i("div",e({className:"".concat(N,"-content-options")},{children:[u&&a("div",e({className:"".concat(N,"-content-option ").concat("schemaMap"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("schemaMap"===w?"":"schemaMap")}},{children:"Schema映射"})),M.length>0&&a("div",e({className:"".concat(N,"-content-option ").concat("fewShots"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("fewShots"===w?"":"fewShots")}},{children:"Few-shot示例"})),v.parsedS2SQL&&i("div",e({className:"".concat(N,"-content-option ").concat("parsedS2SQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("parsedS2SQL"===w?"":"parsedS2SQL")}},{children:["LLM_S2SQL"===h||"PLAIN_TEXT"===h?"LLM":"Rule","解析S2SQL"]})),v.correctedS2SQL&&a("div",e({className:"".concat(N,"-content-option ").concat("correctedS2SQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("correctedS2SQL"===w?"":"correctedS2SQL")}},{children:"修正S2SQL"})),v.correctedQuerySQL&&a("div",e({className:"".concat(N,"-content-option ").concat("correctedQuerySQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("correctedQuerySQL"===w?"":"correctedQuerySQL")}},{children:"物理SQL修正"})),v.querySQL&&a("div",e({className:"".concat(N,"-content-option ").concat("querySQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("querySQL"===w?"":"querySQL")}},{children:(v.correctedQuerySQL,"最终执行SQL")})),i(q,e({className:"".concat(S,"-export-log"),size:"small",onClick:function(){var e="";s&&(e+="\n问题:".concat(s,"\n")),u&&(e+=function(){var e,n;return"\nSchema映射\n".concat((null===(e=null==T?void 0:T.fieldNameList)||void 0===e?void 0:e.length)>0?"名称:".concat(T.fieldNameList.join("、")):"").concat((null===(n=null==T?void 0:T.values)||void 0===n?void 0:n.length)>0?"\n取值:".concat(T.values.map((function(e){return"".concat(e.fieldName,": ").concat(e.fieldValue)})).join("、")):"").concat(L?"\n附加:".concat(L):"").concat((null==E?void 0:E.length)>0?"\n术语:".concat(E.map((function(e){var n;return"".concat(e.name).concat((null===(n=e.alias)||void 0===n?void 0:n.length)>0?"(".concat(e.alias.join(","),")"):"",": ").concat(e.description)})).join("、")):"","\n\n")}()),M.length>0&&(e+="\nFew-shot示例".concat(M.map((function(e,n){return"\n\n示例".concat(n+1,":\n问题:").concat(e.question,"\nSQL:\n").concat(we(e.sql),"\n")})).join(""),"\n")),v.parsedS2SQL&&(e+="\n".concat("LLM_S2SQL"===h||"PLAIN_TEXT"===h?"LLM":"Rule","解析S2SQL\n\n").concat(we(v.parsedS2SQL),"\n")),v.correctedS2SQL&&(e+="\n修正S2SQL\n\n".concat(we(v.correctedS2SQL),"\n")),v.correctedQuerySQL&&(e+="\n物理SQL修正\n\n".concat(we(v.correctedQuerySQL||""),"\n")),v.querySQL&&(e+="\n最终执行SQL\n\n".concat(we(v.querySQL),"\n")),y&&(e+="\n异常日志\n\n".concat(y,"\n")),function(e,n,t){void 0===t&&(t="text/plain");var o=new Blob([e],{type:t}),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}(e,"supersonic-debug-".concat(c,"-").concat(d,".log"))}},{children:[a(te,{}),"导出日志"]}))]}))]})),i("div",e({className:"".concat(S," ").concat(!window.location.pathname.includes("/chat")&&_&&"wiki"!==_?"".concat(S,"-copilot"):"")},{children:["schemaMap"===w&&i("div",e({className:"".concat(S,"-code")},{children:[(null===(o=null==T?void 0:T.fieldNameList)||void 0===o?void 0:o.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"名称:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:T.fieldNameList.join("、")}))]})),(null===(r=null==T?void 0:T.values)||void 0===r?void 0:r.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"取值:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:T.values.map((function(e){return"".concat(e.fieldName,": ").concat(e.fieldValue)})).join("、")}))]})),L&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"附加:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:L}))]})),(null==E?void 0:E.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"术语:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:E.map((function(e){var n;return"".concat(e.name).concat((null===(n=e.alias)||void 0===n?void 0:n.length)>0?"(".concat(e.alias.join(","),")"):"",": ").concat(e.description)})).join("、")}))]}))]})),"fewShots"===w&&a("div",e({className:"".concat(S,"-code")},{children:M.map((function(n,t){return i("div",e({className:"".concat(S,"-few-shot-item")},{children:[i("div",e({className:"".concat(S,"-few-shot-title")},{children:["示例",t+1,":"]})),i("div",e({className:"".concat(S,"-few-shot-content")},{children:[i("div",e({className:"".concat(S,"-few-shot-content-item")},{children:[a("div",e({className:"".concat(S,"-few-shot-content-title")},{children:"问题:"})),a("div",e({className:"".concat(S,"-few-shot-content-text")},{children:n.question}))]})),i("div",e({className:"".concat(S,"-few-shot-content-item")},{children:[a("div",e({className:"".concat(S,"-few-shot-content-title")},{children:"SQL:"})),a("div",e({className:"".concat(S,"-few-shot-content-text")},{children:a(xe,e({className:"".concat(S,"-few-shot-code"),language:"sql",style:be},{children:n.sql}))}))]}))]}))]}),t)}))})),w&&v[w]&&i(l,{children:[a(xe,e({className:"".concat(S,"-code"),language:"sql",style:be},{children:we(v[w])})),a(Ie,e({text:we(v[w]),onCopy:function(e,n){return function(e,n){n?R.success("复制SQL成功",1):R.error("复制SQL失败",1)}(0,n)}},{children:a("button",e({className:"".concat(S,"-copy-btn")},{children:"复制代码"}))}))]})]}))]}))},It=function(o){var r=o.queryId,c=o.similarQueries,d=o.defaultExpanded,s=o.onSelectQuestion,u=p(c||[]),m=u[0],_=u[1],h=p(d||!1),v=h[0],g=h[1],y=p(!1),x=y[0],b=y[1],w="".concat(Ye,"-item"),I="".concat(Ye,"-similar-questions");f((function(){v&&0===(null==m?void 0:m.length)&&r&&n(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return b(!0),[4,Dn(r)];case 1:return e=t.sent(),b(!1),_((null===(n=e.data)||void 0===n?void 0:n.similarQueries)||[]),[2]}}))}))}),[v,r]);return i("div",e({className:"".concat(w,"-parse-tip")},{children:[i("div",e({className:"".concat(w,"-title-bar")},{children:[a(K,{className:"".concat(w,"-step-icon")}),i("div",e({className:"".concat(w,"-step-title")},{children:["推荐相似问题",a("span",e({className:"".concat(I,"-toggle-expand-btn"),onClick:function(){g(!v)}},{children:a(x?re:v?ee:X,{})}))]}))]})),a("div",e({className:I},{children:v&&a("div",e({className:"".concat(I,"-content")},{children:Array.isArray(m)&&m.length>0?null==m?void 0:m.slice(0,5).map((function(n,t){return i("div",e({className:"".concat(I,"-question"),onClick:function(){s(n)}},{children:[t+1,". ",n.queryText]}),n.queryText)})):a(l,{children:"暂无推荐"})}))}))]}))},Nt=x({register:function(){},call:function(){}}),St=function(o){var r,c,d,s,u=o.msg,m=o.conversationId,_=o.questionId,v=o.modelId,y=o.agentId,x=o.score,b=o.filter,w=o.triggerResize,I=o.parseInfos,N=o.parseTimeCostValue,S=o.msgData,C=o.isDeveloper,T=o.integrateSystem,E=o.executeItemNode,L=o.renderCustomExecuteNode,A=o.isSimpleMode,k=o.currentAgent,z=o.isDebugMode,D=o.isLastMessage,q=o.onMsgDataLoaded,O=o.onUpdateMessageScroll,F=o.onSendMsg,B=p(!1),P=B[0],Q=B[1],j=p(),Y=j[0],W=j[1],V=p(),U=V[0],H=V[1],X=p([]),K=X[0],J=X[1],$=p([]),Z=$[0],ee=$[1],ne=p(""),te=ne[0],oe=ne[1],ae=p(!1),ie=ae[0],le=ae[1],re=p(!1),ce=re[0],de=re[1],se=p(!1),ue=se[0],me=se[1],_e=p(!1),fe=_e[0],he=_e[1],ve=p(""),ge=ve[0],ye=ve[1],xe=p(""),be=xe[0],we=xe[1],Ie=p(),Ne=Ie[0],Se=Ie[1],Ce=p(!1),Te=Ce[0],Ee=Ce[1],Le=p([]),Me=Le[0],ke=Le[1],ze=p({}),De=ze[0],qe=ze[1],Re=p({}),Oe=Re[0],Fe=Re[1],Be=p({}),Qe=Be[0],je=Be[1],We=p(!1),Ve=We[0],Ue=We[1],Ge=p([]),He=Ge[0],Xe=Ge[1],Ke=p("");Ke[0];var Je=Ke[1],$e="".concat(Ye,"-item"),en=function(e){var n;if(!e)return"";var t=e.id||"",o=e.dataSetIds||[],a=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||"";if(0===o.length&&!a)return"".concat(t,"_no_dataset");var i=o.sort().join("_"),l=a?"_".concat(a):"";return"".concat(t,"_").concat(i).concat(l)},nn=function(n){var t,o="",a=void 0,i=n.data||{},l=i.queryColumns,r=i.queryResults,c=i.queryState,d=i.queryMode,s=i.response,u=i.chatContext,m=i.errorMsg;if(we(m),400===n.code||401===n.code||412===n.code?o=n.msg:200!==n.code?o=Pe:"SUCCESS"!==c?o=s&&"string"==typeof s?s:Pe:(l&&l.length>0&&r||"WEB_PAGE"===d||"WEB_SERVICE"===d||"PLAIN_TEXT"===d)&&(a=n.data,o=""),u){var _=en(u);je(e(e({},Qe),((t={})[_]={tip:o,data:a},t)))}return a?(Se(a),ye(""),!0):(ye(o||Pe),!1)},tn=function(o,a,i,l){return void 0===l&&(l=!1),n(void 0,void 0,void 0,(function(){var n,r,c,d,s,_,p,f,h,v;return t(this,(function(t){switch(t.label){case 0:le(!0),i?Ee(!0):he(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),n=He.length>0?He:o.dataSetIds||((null===(v=o.dataSet)||void 0===v?void 0:v.id)?[o.dataSet.id]:void 0),r=(null==U?void 0:U.dataSetIds)||[],c=n||[],JSON.stringify(r.sort())!==JSON.stringify(c.sort())&&(Se(void 0),ye("")),d=e(e({},o),{dataSetIds:n}),[4,An(u,m,d,y)];case 2:return s=t.sent(),_=nn(s),H(d),null==q||q(e(e({},s.data),{parseInfos:a,queryId:o.queryId}),_,l),[3,4];case 3:return t.sent(),p=Pe,ye(Pe),f=en(o),je(e(e({},Qe),((h={})[f]={tip:p},h))),[3,4];case 4:return i?Ee(!1):he(!1),[2]}}))}))},on=function(e){ke(e.sort((function(e,n){return e.name<n.name?-1:e.name>n.name?1:0})))},an=function(){return n(void 0,void 0,void 0,(function(){var n,o,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I;return t(this,(function(t){switch(t.label){case 0:return Q(!0),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,dataSetIds:He.length>0?He:void 0})];case 1:return n=t.sent(),Q(!1),a=(o=n||{}).code,i=o.data,r=(l=i||{}).state,c=l.selectedParses,d=l.candidateParses,s=l.queryId,_=l.parseTimeCost,p=l.errorMsg,f=(null==c?void 0:c.concat(d||[]))||[],200===a&&r!==Ae.FAILED&&f.length&&((null===(w=null===(x=f[0])||void 0===x?void 0:x.properties)||void 0===w?void 0:w.type)||(null===(I=f[0])||void 0===I?void 0:I.queryMode))?(null==O||O(),(h=f.slice(0,5).map((function(n){return e(e({},n),{queryId:s})}))).length>1&&(ee(h),me(!0),de(!0)),J(h||[]),g=h[0],1===(null==k?void 0:k.enableFeedback)&&h.length>1||H(g),W(_),Fe(g.entityInfo||{}),on((null==g?void 0:g.dimensionFilters)||[]),qe(null==g?void 0:g.dateInfo),1===h.length&&tn(g,h),[2]):(oe(r===Ae.FAILED&&p?p:"智能助理不太懂您说什么呐,回去一定补充知识"),H({queryId:s}),[2])}}))}))},cn=function(n,t){if(t){var o=I&&I.length>0?I.map((function(n){return e(e({},n),{queryId:t.queryId})})):[e(e({},t.chatContext),{queryId:t.queryId})],a=o[0];J(o),H(a),W(N),on(a.dimensionFilters||[]),qe(a.dateInfo),le(!0),nn({code:200,data:t,msg:"success"})}else n&&an()};f((function(){void 0!==Ne||""!==ge||P||cn(u,S)}),[u,S]);var dn=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return Ee(!0),[4,kn(o,null===(s=null==Ne?void 0:Ne.chatContext)||void 0===s?void 0:s.modelId,m||0)];case 1:return n=t.sent(),Ee(!1),Se(n.data),a=n.data||{},i=a.chatContext,l=a.entityInfo,r=e(e({},i||{}),{queryId:null==U?void 0:U.queryId}),H(r),Fe(l),on((null==r?void 0:r.dimensionFilters)||[]),qe(null==r?void 0:r.dateInfo),c=en(r),je(e(e({},Qe),((d={})[c]={tip:"",data:n.data},d))),[2]}}))}))},sn=function(e){ke(e)},un=function(n){if(n&&n[0]&&n[1]){var t=n[0],o=n[1];qe(e(e({},De||{}),{startDate:pe(t).format("YYYY-MM-DD"),endDate:pe(o).format("YYYY-MM-DD"),dateMode:"BETWEEN",unit:0}))}},mn=function(n){qe(e(e({},De||{}),{startDate:pe(n[0]).format("YYYY-MM-DD"),endDate:pe(n[1]).format("YYYY-MM-DD"),dateMode:"BETWEEN",unit:0}))},_n=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I,N,S,C,T,E,L,M,A,k,z,D,R,O,F,B,P;return t(this,(function(t){switch(t.label){case 0:return Ee(!0),a=(n=o||U||{}).dimensions,i=n.metrics,l=n.id,r=n.queryId,c=n.dataSetIds,n.dataSet,d=c||(null==o?void 0:o.dataSetIds)||(null==U?void 0:U.dataSetIds)||(He.length>0?He:void 0),d&&(null==U?void 0:U.dataSetIds)&&JSON.stringify(d.sort())!==JSON.stringify((U.dataSetIds||[]).sort())||void 0!==o&&o!==U?(s=e({},Qe),Object.keys(s).forEach((function(e){s[e]={tip:"",data:void 0}})),je(s),Se(void 0),ye(""),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,parseId:l,queryId:r,parseInfo:o||U,dataSetIds:d})]):[3,2];case 1:return _=t.sent(),p=_.code,f=_.data,Ee(!1),200===p&&(W(f.parseTimeCost),(h=f.selectedParses[0]).queryId=f.queryId,h.dataSetIds=d,!h.dataSet&&d&&d.length>0&&(g=(null===(z=null==U?void 0:U.dataSet)||void 0===z?void 0:z.name)||(null===(R=null===(D=K.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&d.includes(t)})))||void 0===D?void 0:D.dataSet)||void 0===R?void 0:R.name)||"数据集".concat(d[0]),h.dataSet={id:d[0],name:g}),x=K.map((function(e){var n,t,o=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0],a=(null===(t=h.dataSet)||void 0===t?void 0:t.id)||h.dataSetIds&&h.dataSetIds[0];return o&&a&&o===a?h:e})),w=(null===(O=h.dataSet)||void 0===O?void 0:O.id)||h.dataSetIds&&h.dataSetIds[0],I=x.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&w&&t===w})),I||x.push(h),J(x),H(h),on(h.dimensionFilters||[]),qe(h.dateInfo),h.entityInfo&&Fe(h.entityInfo),M=en(h),je(e(e({},Qe),((A={})[M]={tip:"",data:void 0},A))),N=e(e({},h),{dataSetIds:d}),tn(N,x,!0,!0)),[3,4];case 2:return[4,zn(S={dimensions:a,metrics:i,dateInfo:De,dimensionFilters:Me,parseId:l,queryId:r,dataSetIds:d,dataSet:(null==o?void 0:o.dataSet)||(null==U?void 0:U.dataSet)})];case 3:C=t.sent(),Ee(!1),200===C.code&&(T=null===(F=C.data)||void 0===F?void 0:F.chatContext,E=e(e({},T||S),{queryId:r,properties:e(e({},(null==o?void 0:o.properties)||(null==U?void 0:U.properties)||{}),{CONTEXT:(null===(B=null==o?void 0:o.properties)||void 0===B?void 0:B.CONTEXT)||(null===(P=null==U?void 0:U.properties)||void 0===P?void 0:P.CONTEXT)})}),L=e(e({},C.data),{chatContext:E,parseInfos:K,queryId:r}),null==q||q(L,!0,!0),Se(L),H(E),M=en(E),je(e(e({},Qe),((k={})[M]={tip:"",data:L},k)))),t.label=4;case 4:return[2]}}))}))},pn=function(e){return n(void 0,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,qn(e)];case 1:return 200===n.sent().code&&(Q(!1),W(void 0),H(void 0),J([]),de(!1),me(!1),ee([]),oe(""),le(!1),ke([]),Se(void 0),we(""),qe({}),Fe({}),je({}),Ue(!1),Xe([]),Je(""),cn(u,void 0)),[2]}}))}))},fn=function(){var e=Ne||{},n=e.queryColumns,t=e.queryResults;t&&n&&function(e){var n=[],t=Object.keys(e[0]);n.push(t.join(","));for(var o=function(e){n.push(t.map((function(n){return JSON.stringify(e[n],ln)})).join(","))},a=0,i=e;a<i.length;a++)o(i[a]);var l="\ufeff"+n.join("\n"),r=new Blob([l],{type:"text/csv;charset=utf-8;"}),c=window.URL.createObjectURL(r),d=document.createElement("a");d.href=c,d.download="data.csv",document.body.appendChild(d),d.click(),d.remove(),window.URL.revokeObjectURL(c)}(t.map((function(e){return n.reduce((function(n,t){return n[t.name||t.nameEn]=e[t.nameEn],n}),{})})))},hn=G("".concat($e,"-content"),((r={})["".concat($e,"-content-mobile")]=Ze,r)),vn=(null===(c=null==U?void 0:U.properties)||void 0===c?void 0:c.CONTEXT)||{},gn=vn.llmReq,yn=vn.llmResp,xn=function(e){var n=h(new Map),t=g((function(e,t){n.current.set(e,t)}),[n]),o=g((function(t){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var i=n.current.get(t);return i?i.apply(void 0,o):null==e?void 0:e.apply(void 0,o)}),[n]);return{register:t,call:o}}((function(){return R.error("该条消息暂不支持该操作")})),bn=xn.register,wn=xn.call,In=null===(s=null===(d=null==U?void 0:U.properties)||void 0===d?void 0:d.CONTEXT)||void 0===s?void 0:s.queryText;return In=null==In?u:In,a(Nt.Provider,e({value:{register:bn,call:wn}},{children:i("div",e({className:$e},{children:[!Ze&&a(rn,{type:"icon-zhinengsuanfa",className:"".concat($e,"-avatar")}),i("div",e({className:Ze?"".concat($e,"-mobile-msg-card"):""},{children:[a("div",e({className:"".concat($e,"-time")},{children:(null==Y?void 0:Y.parseStartTime)?pe(Y.parseStartTime).format("M月D日 HH:mm"):""})),i("div",e({className:hn},{children:[i(l,{children:[1===(null==k?void 0:k.enableFeedback)&&!_&&ue&&a("div",e({style:{marginBottom:10}},{children:a(Hn,{isSimpleMode:A,parseInfoOptions:Z,agentId:y,integrateSystem:T,parseTimeCost:null==Y?void 0:Y.parseTime,isDeveloper:C,onSelectParseInfo:function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I,N;return t(this,(function(t){switch(t.label){case 0:return H(o),de(!1),(n=(null===(g=o.dataSet)||void 0===g?void 0:g.id)?[o.dataSet.id]:o.dataSetIds||He)&&n.length>0&&Xe(n),a=o.id,i=o.queryId,Q(!0),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,parseId:a,queryId:i,parseInfo:o,dataSetIds:n})];case 1:return l=t.sent(),r=l.code,c=l.data,Q(!1),200===r&&(W(c.parseTimeCost),(d=c.selectedParses[0]).queryId=c.queryId,d.dataSetIds=n,!d.dataSet&&n&&n.length>0&&(s=(null===(x=null==d?void 0:d.dataSet)||void 0===x?void 0:x.name)||(null===(I=null===(w=K.find((function(e){var t,o=(null===(t=e.dataSet)||void 0===t?void 0:t.id)||e.dataSetIds&&e.dataSetIds[0];return o&&n.includes(o)})))||void 0===w?void 0:w.dataSet)||void 0===I?void 0:I.name)||"数据集".concat(n[0]),d.dataSet={id:n[0],name:s}),_=K.map((function(e){var n,t,o=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0],a=(null===(t=d.dataSet)||void 0===t?void 0:t.id)||d.dataSetIds&&d.dataSetIds[0];return o&&a&&o===a?d:e})),p=(null===(N=d.dataSet)||void 0===N?void 0:N.id)||d.dataSetIds&&d.dataSetIds[0],f=_.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&p&&t===p})),f||_.push(d),J(_),H(d),on(d.dimensionFilters||[]),qe(d.dateInfo),d.entityInfo&&Fe(d.entityInfo),h=e(e({},d),{dataSetIds:n}),tn(h,_,!0,!0)),[2]}}))}))},onSwitchEntity:dn,onFiltersChange:sn,onDateInfoChange:un,onRefresh:_n,handlePresetClick:mn,setSelectedDataSetIds:Xe})})),!ce&&a(Kn,{isSimpleMode:A,parseLoading:P,parseInfoOptions:K,parseTip:te,currentParseInfo:U,agentId:y,dimensionFilters:Me,dateInfo:De,entityInfo:Oe,integrateSystem:T,parseTimeCost:null==Y?void 0:Y.parseTime,isDeveloper:C,onSelectParseInfo:function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,u,m,_;return t(this,(function(t){return H(o),on(o.dimensionFilters||[]),qe(o.dateInfo),o.entityInfo&&Fe(o.entityInfo),(n=(null===(_=o.dataSet)||void 0===_?void 0:_.id)?[o.dataSet.id]:o.dataSetIds||He)&&n.length>0&&Xe(n),a=(null==U?void 0:U.dataSetIds)||[],i=n||[],(l=JSON.stringify(a.sort())!==JSON.stringify(i.sort()))&&(r=e({},Qe),Object.keys(r).forEach((function(e){r[e]={tip:"",data:void 0}})),je(r),Se(void 0),ye("")),c=en(o),Qe[c]&&!l?(d=Qe[c],s=d.tip,u=d.data,ye(s),Se(u)):(m=e(e({},o),{dataSetIds:n}),tn(m,K,!0)),[2]}))}))},onSwitchEntity:dn,onFiltersChange:sn,onDateInfoChange:un,onRefresh:function(e){_n(e)},handlePresetClick:mn,setSelectedDataSetIds:Xe})]}),ie&&a(M,e({spinning:Te},{children:i("div",e({style:{minHeight:50}},{children:[!Ze&&(null==U?void 0:U.sqlInfo)&&C&&z&&!A&&a(wt,{agentId:y,queryId:U.queryId,question:In,llmReq:gn,llmResp:yn,integrateSystem:T,queryMode:U.queryMode,sqlInfo:U.sqlInfo,sqlTimeCost:null==Y?void 0:Y.sqlTime,executeErrorMsg:be,dataSetIds:U.dataSetIds}),a(xt,{isSimpleMode:A,queryId:null==U?void 0:U.queryId,parseId:null==U?void 0:U.id,question:In,queryMode:null==U?void 0:U.queryMode,executeLoading:fe,executeTip:ge,executeErrorMsg:be,chartIndex:0,data:Ne,triggerResize:w,executeItemNode:E,isDeveloper:C,renderCustomExecuteNode:L,enableStreamingSummary:!(null==Ne?void 0:Ne.textSummary),onStreamingSummaryUpdate:Je,agentId:y,dataSetIds:null==U?void 0:U.dataSetIds})]}))})),ie&&!fe&&!A&&"PLAIN_TEXT"!==(null==U?void 0:U.queryMode)&&a(It,{queryId:null==U?void 0:U.queryId,defaultExpanded:""!==te||""!==ge,similarQueries:null==Ne?void 0:Ne.similarQueries,onSelectQuestion:function(e){null==F||F(e.queryText)}})]})),(""!==te||ie&&!fe)&&"PLAIN_TEXT"!==(null==U?void 0:U.queryMode)&&a(bt,{isLastMessage:D,queryId:(null==U?void 0:U.queryId)||0,scoreValue:x,isParserError:Ve,onExportData:function(){fn()},isSimpleMode:A,onReExecute:function(e){pn(e)}})]}))]}))}))};var Ct=b((function(n){var t,o=n.id,r=n.chatId,c=n.messageList,d=n.historyVisible,s=n.currentAgent,u=n.chatVisible,m=n.isDeveloper,_=n.integrateSystem,h=n.isSimpleMode,v=n.isDebugMode,y=n.onMsgDataLoaded,x=n.onSendMsg,b=p(!1),w=b[0],I=b[1],N=g((function(){I(!0),setTimeout((function(){I(!1)}),0)}),[]);f((function(){return window.addEventListener("resize",N),function(){window.removeEventListener("resize",N)}}),[]),f((function(){N()}),[d,u]);var S=G(hn,((t={})[yn]=Ze,t));return a("div",e({id:o,className:S},{children:a("div",e({className:vn},{children:c.map((function(n,t){var o=n.id,d=n.questionId,u=n.modelId,p=n.agentId,f=n.type,g=n.msg,b=n.msgValue,I=n.score,N=n.identityMsg,S=n.parseInfos,C=n.parseTimeCost,T=n.msgData,E=n.filters;return i("div",e({id:"".concat(o),className:gn},{children:[f===un.TEXT&&a(fn,{position:"left",data:g}),f===un.AGENT_LIST&&a(Cn,{currentAgent:s,onSendMsg:x}),f===un.QUESTION&&i(l,{children:[a(fn,{position:"right",data:g}),N&&a(fn,{position:"left",data:N}),a(St,{questionId:d,currentAgent:s,isSimpleMode:h,isDebugMode:v,msg:b||g||"",parseInfos:S,parseTimeCostValue:C,msgData:T,conversationId:r,modelId:u,agentId:p,score:I,filter:E,triggerResize:w,isDeveloper:m,integrateSystem:_,onMsgDataLoaded:function(e,n,t){y(e,o,b||g||"",n,t)},onUpdateMessageScroll:tn,onSendMsg:x,isLastMessage:t===c.length-1})]})]}),o)}))}))}))}),(function(e,n){return!(e.id!==n.id||!u(e.messageList,n.messageList)||e.historyVisible!==n.historyVisible||e.currentAgent!==n.currentAgent||e.chatVisible!==n.chatVisible||e.isSimpleMode!==n.isSimpleMode)})),Tt="style_module_chat__9f758d37",Et="style_module_chatSection__9f758d37",Lt="style_module_chatApp__9f758d37",Mt="style_module_chatBody__9f758d37",At="style_module_chatContent__9f758d37",kt="style_module_chatHeader__9f758d37",zt="style_module_chatHeaderTitle__9f758d37",Dt="style_module_chatHeaderTip__9f758d37",qt="style_module_historyVisible__9f758d37",Rt="style_module_mobile__9f758d37",Ot="style_module_showCaseModal__9f758d37",Ft="style_module_showCaseDrawer__9f758d37";Ee(".style_module_chat__9f758d37 {\n height: 100%;\n overflow: hidden;\n background: linear-gradient(180deg, rgba(23, 74, 228, 0) 29.44%, rgba(23, 74, 228, 0.06) 100%), linear-gradient(90deg, #f3f3f7 0%, #f3f3f7 20%, #ebf0f9 60%, #f3f3f7 80%, #f3f3f7 100%);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 {\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n color: rgba(0, 0, 0, 0.87);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 {\n display: flex;\n flex: 1;\n height: 100%;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 {\n position: absolute;\n top: 0;\n z-index: 9;\n display: flex;\n align-items: baseline;\n width: 100%;\n padding: 14px 16px;\n background: rgba(243, 243, 247, 0.85);\n backdrop-filter: blur(2px);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 .style_module_chatHeaderTitle__9f758d37 {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 .style_module_chatHeaderTip__9f758d37 {\n max-width: 600px;\n margin-left: 5px;\n overflow: hidden;\n color: var(--text-color-third);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_chat__9f758d37.style_module_historyVisible__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n width: calc(100% - 707px);\n}\n.style_module_chat__9f758d37.style_module_mobile__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n width: 100%;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content {\n border-radius: 8px;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content .ant-modal-header {\n border-radius: 8px 8px 0 0;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content .ant-modal-body {\n padding: 20px 0 !important;\n}\n.style_module_showCaseDrawer__9f758d37 .ant-drawer-content {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.style_module_showCaseDrawer__9f758d37 .ant-drawer-content .ant-drawer-body {\n padding: 4px 0 !important;\n}\n.ss-chat-recommend-options .ant-table-thead .ant-table-cell {\n padding: 8px !important;\n}\n.ss-chat-recommend-options .ant-table-tbody .ant-table-cell {\n padding: 8px !important;\n border-bottom: 1px solid #f0f0f0;\n}\n",{});var Bt=Ze?"/openapi":"/api";function Pt(e,n){return Tn.post("".concat(Bt,"/chat/manage/save?chatName=").concat(e,"&agentId=").concat(n))}function Qt(e){return Tn.get("".concat(Bt,"/chat/manage/getAll"),{params:{agentId:e}})}var jt,Yt,Wt=B.Item,Vt={labelCol:{span:6},wrapperCol:{span:18}},Ut=function(o){var i=o.visible,l=o.editConversation,r=o.onClose,c=o.onFinish,d=B.useForm()[0],s=p(!1),u=s[0],m=s[1],_=h();f((function(){i&&(d.setFieldsValue({conversationName:l.chatName}),setTimeout((function(){_.current.focus({cursor:"all"})}),0))}),[i]);var v=function(){return n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return[4,d.validateFields()];case 1:return e=n.sent(),m(!0),[4,(t=e.conversationName,o=l.chatId,void 0===o&&(o=0),Tn.post("".concat(Bt,"/chat/manage/updateChatName?chatName=").concat(t,"&chatId=").concat(o)))];case 2:return n.sent(),m(!1),c(e.conversationName),[2]}var t,o}))}))};return a(P,e({title:"修改问答名称",open:i,onCancel:r,onOk:v,confirmLoading:u},{children:a(B,e({},Vt,{form:d},{children:a(Wt,e({name:"conversationName",label:"名称",rules:[{required:!0}]},{children:a(Q,{placeholder:"请输入问答名称",ref:_,onPressEnter:v})}))}))}))},Gt="style_module_conversation__e5d9ab2c",Ht="style_module_rightSection__e5d9ab2c",Xt="style_module_titleBar__e5d9ab2c",Kt="style_module_title__e5d9ab2c",Jt="style_module_rightOperation__e5d9ab2c",$t="style_module_newConversation__e5d9ab2c",Zt="style_module_closeIcon__e5d9ab2c",eo="style_module_searchConversation__e5d9ab2c",no="style_module_searchIcon__e5d9ab2c",to="style_module_searchTask__e5d9ab2c",oo="style_module_conversationList__e5d9ab2c",ao="style_module_conversationItem__e5d9ab2c",io="style_module_conversationContent__e5d9ab2c",lo="style_module_topTitleBar__e5d9ab2c",ro="style_module_conversationTitleBar__e5d9ab2c",co="style_module_conversationName__e5d9ab2c",so="style_module_currentConversation__e5d9ab2c",uo="style_module_conversationTime__e5d9ab2c",mo="style_module_bottomSection__e5d9ab2c",_o="style_module_subTitle__e5d9ab2c",po="style_module_deleteIcon__e5d9ab2c",fo="style_module_activeConversationItem__e5d9ab2c",ho="style_module_historyVisible__e5d9ab2c";Ee(".style_module_conversation__e5d9ab2c {\n position: relative;\n width: 0;\n height: 100%;\n background: #fff;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c {\n width: 100%;\n height: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_title__e5d9ab2c {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_newConversation__e5d9ab2c {\n color: var(--text-color);\n font-size: 14px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_newConversation__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_closeIcon__e5d9ab2c {\n color: var(--text-color);\n font-size: 16px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_closeIcon__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c {\n display: flex;\n align-items: center;\n padding: 12px 0 10px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchIcon__e5d9ab2c {\n color: #999 !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchTask__e5d9ab2c {\n font-size: 13px;\n background-color: #f5f5f5;\n border: 0;\n border-radius: 4px;\n box-shadow: none !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchTask__e5d9ab2c .ant-input {\n font-size: 13px !important;\n background-color: transparent !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c {\n display: flex;\n flex-direction: column;\n height: calc(100% - 70px);\n padding: 2px 0 0;\n overflow-y: auto;\n row-gap: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n border: 1px solid #efefef;\n border-radius: 8px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c {\n width: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c .style_module_conversationName__e5d9ab2c {\n max-width: 300px;\n margin-right: 2px;\n overflow: hidden;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c .style_module_currentConversation__e5d9ab2c {\n padding: 0 4px;\n color: var(--chat-blue);\n font-size: 12px;\n background-color: var(--light-blue-background);\n border-radius: 4px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTime__e5d9ab2c {\n color: var(--text-color-six);\n font-size: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 4px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_subTitle__e5d9ab2c {\n width: 350px;\n overflow: hidden;\n color: var(--text-color-six);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_deleteIcon__e5d9ab2c {\n color: var(--text-color-six);\n font-size: 14px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_deleteIcon__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c:hover,\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c.style_module_activeConversationItem__e5d9ab2c {\n background-color: #f0f0f0;\n}\n.style_module_conversation__e5d9ab2c.style_module_historyVisible__e5d9ab2c {\n width: 400px;\n padding: 10px 16px;\n border-left: 1px solid #f1f1f1;\n z-index: 99;\n}\n",{}),function(e){e.MODEL="MODEL",e.DIMENSION="DIMENSION",e.METRIC="METRIC",e.VALUE="VALUE",e.TERM="TERM"}(Yt||(Yt={}));var vo=((jt={})[Yt.MODEL]="数据模型",jt[Yt.DIMENSION]="维度",jt[Yt.METRIC]="指标",jt[Yt.VALUE]="维度值",jt[Yt.TERM]="术语",jt),go=["icon-fukuanbaobiaochaxun","icon-hangweifenxi1","icon-xiaofeifenxi","icon-renwuchaxun","icon-baobiao","icon-liushuichaxun","icon-cangkuchaxun","icon-xiaoshoushuju","icon-tongji","icon-shujutongji","icon-mendiankanban"],yo="@_supersonic_@";var xo=b(w((function(o,l){var c,d=o.currentAgent,s=o.currentConversation,u=o.historyVisible,m=o.onSelectConversation,_=o.onCloseConversation,h=p([]),v=h[0],g=h[1],y=p(!1),x=y[0],b=y[1],w=p(),N=w[0],S=w[1],C=p(""),T=C[0],E=C[1];I(l,(function(){return{updateData:L,onAddConversation:q}}));var L=function(e){return n(void 0,void 0,void 0,(function(){var n,o;return t(this,(function(t){switch(t.label){case 0:return[4,Qt(e||d.id)];case 1:return n=t.sent().data,g((o=n||[]).slice(0,200)),[2,o]}}))}))},M=function(){return n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return[4,L()];case 1:return(e=n.sent()).length>0?m(e[0]):q(),[2]}}))}))};f((function(){d&&(d.initialSendMsgParams?q(d.initialSendMsgParams):M())}),[d]);var z=function(e){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Pt("新问答对话",n=(null==e?void 0:e.agentId)||d.id)];case 1:return t.sent(),[2,L(n)]}}))}))},D=function(e){return n(void 0,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,(t=e,Tn.post("".concat(Bt,"/chat/manage/delete?chatId=").concat(t)))];case 1:return n.sent(),M(),[2]}var t}))}))},q=function(e){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,z(e)];case 1:return(n=t.sent()).length>0&&m(n[0],e,!0),[2]}}))}))},R=G(Gt,((c={})[ho]=u,c)),O=function(e){r.locale("zh-cn");var n=r(),t=r(e);return n.diff(t,"minutes")<1?"刚刚":t.isSame(n,"day")?t.format("HH:mm"):t.isSame(n.subtract(1,"day"),"day")?"昨天":t.format("MM/DD")};return i("div",e({className:R},{children:[i("div",e({className:Ht},{children:[i("div",e({className:Xt},{children:[a("div",e({className:Kt},{children:"历史对话"})),i("div",e({className:Jt},{children:[a("div",e({className:$t,onClick:function(){z()}},{children:"新对话"})),a(ce,{className:Zt,onClick:_})]}))]})),a("div",e({className:eo},{children:a(Q,{placeholder:"搜索",prefix:a(de,{className:no}),className:to,value:T,onChange:function(e){E(e.target.value)},allowClear:!0})})),a("div",e({className:oo},{children:v.filter((function(e){return""===T||e.chatName.toLowerCase().includes(T.toLowerCase())})).map((function(n){var t,o=G(ao,((t={})[fo]=(null==s?void 0:s.chatId)===n.chatId,t));return a(A,e({overlay:a(k,{items:[{label:"修改对话名称",key:"editName"},{label:"删除",key:"delete"}],onClick:function(e){!function(e,n){"editName"===e?(S(n),b(!0)):"delete"===e&&D(n.chatId)}(e.key,n)}}),trigger:["contextMenu"]},{children:a("div",e({className:o,onClick:function(){m(n)}},{children:i("div",e({className:io},{children:[i("div",e({className:lo},{children:[i("div",e({className:ro},{children:[a("div",e({className:co},{children:n.chatName})),(null==s?void 0:s.chatId)===n.chatId&&a("div",e({className:so},{children:"当前对话"}))]})),a("div",e({className:uo},{children:O(n.lastTime||"")}))]})),i("div",e({className:mo},{children:[a("div",e({className:_o},{children:n.lastQuestion})),a(se,{className:po,onClick:function(e){e.stopPropagation(),D(n.chatId)}})]}))]}))}))}),n.chatId)}))}))]})),a(Ut,{visible:x,editConversation:N,onClose:function(){b(!1)},onFinish:function(){b(!1),L()}})]}))})),(function(e,n){var t,o,a,i;return(null===(t=e.currentAgent)||void 0===t?void 0:t.id)===(null===(o=n.currentAgent)||void 0===o?void 0:o.id)&&(null===(a=e.currentConversation)||void 0===a?void 0:a.chatId)===(null===(i=n.currentConversation)||void 0===i?void 0:i.chatId)&&e.historyVisible===n.historyVisible})),bo={chatFooter:"style_module_chatFooter__fe028c7a",tools:"style_module_tools__fe028c7a",toolItem:"style_module_toolItem__fe028c7a",composer:"style_module_composer__fe028c7a",collapseBtn:"style_module_collapseBtn__fe028c7a",addConversation:"style_module_addConversation__fe028c7a",composerInputWrapper:"style_module_composerInputWrapper__fe028c7a",composerInput:"style_module_composerInput__fe028c7a",sendBtn:"style_module_sendBtn__fe028c7a",sendBtnActive:"style_module_sendBtnActive__fe028c7a",mobile:"style_module_mobile__fe028c7a",searchOption:"style_module_searchOption__fe028c7a",model:"style_module_model__fe028c7a",autoCompleteDropdown:"style_module_autoCompleteDropdown__fe028c7a",modelOptions:"style_module_modelOptions__fe028c7a",semanticType:"style_module_semanticType__fe028c7a",quoteText:"style_module_quoteText__fe028c7a"};Ee(".style_module_chatFooter__fe028c7a {\n position: relative;\n z-index: 10;\n display: flex;\n flex-direction: column;\n margin: 6px 20px 20px;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a {\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n column-gap: 8px;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a .style_module_toolItem__fe028c7a {\n display: flex;\n align-items: center;\n padding: 2px 6px;\n color: var(--text-color-secondary);\n font-size: 12px;\n column-gap: 6px;\n background-color: #f6f6f6;\n border-radius: 6px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a .style_module_toolItem__fe028c7a:hover {\n background-color: #f1f1f1;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a {\n display: flex;\n height: 70px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_collapseBtn__fe028c7a {\n height: 46px;\n margin: 0 10px;\n color: var(--text-color-third);\n font-size: 20px;\n line-height: 46px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_collapseBtn__fe028c7a:hover {\n color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_addConversation__fe028c7a {\n height: 46px;\n margin: 0 20px 0 10px;\n color: var(--text-color-fourth);\n font-size: 26px;\n line-height: 54px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_addConversation__fe028c7a:hover {\n color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a {\n position: relative;\n flex: 1;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a {\n width: 100%;\n height: 100%;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector {\n box-sizing: border-box;\n height: 100%;\n overflow: hidden;\n color: rgba(0, 0, 0, 0.87);\n font-size: 14px;\n word-break: break-all;\n background: #f9f9f9;\n border: 0;\n border-radius: 8px;\n transition: border-color 0.15s ease-in-out;\n resize: none;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-search-input {\n height: 40px !important;\n padding: 0 12px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-search {\n right: 0 !important;\n left: 0 !important;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-placeholder {\n line-height: 40px;\n margin-bottom: 30px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-clear {\n right: auto;\n left: 500px;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n font-size: 16px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .ant-select-focused .ant-select-selector {\n box-shadow: #4a72f5 0px 0px 3px !important;\n}\n.style_module_chatFooter__fe028c7a .style_module_sendBtn__fe028c7a {\n position: absolute;\n right: 10px;\n bottom: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n color: #fff;\n font-size: 20px;\n background-color: #b8b8bf;\n border: unset;\n border-radius: 50%;\n transition: background-color 0.3s ease 0s;\n}\n.style_module_chatFooter__fe028c7a .style_module_sendBtn__fe028c7a.style_module_sendBtnActive__fe028c7a {\n background-color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a {\n margin: 6px 10px 10px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_addConversation__fe028c7a {\n height: 40px;\n margin: 0 12px 0 4px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a {\n height: 40px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selector {\n font-size: 14px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selection-search-input {\n padding: 0 10px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selection-placeholder {\n margin-bottom: 0 !important;\n padding-left: 0 !important;\n line-height: 38px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_sendBtn__fe028c7a {\n right: 4px;\n bottom: 6px;\n}\n.style_module_searchOption__fe028c7a {\n padding: 6px 20px;\n color: #212121;\n font-size: 16px;\n}\n.style_module_mobile__fe028c7a .style_module_searchOption__fe028c7a {\n min-height: 26px;\n padding: 2px 12px;\n font-size: 14px;\n}\n.style_module_model__fe028c7a {\n margin-top: 2px;\n color: var(--text-color-fourth);\n font-size: 13px;\n line-height: 12px;\n}\n.style_module_autoCompleteDropdown__fe028c7a {\n left: 20px !important;\n width: fit-content !important;\n min-width: 100px !important;\n border-radius: 6px;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a {\n width: 150px !important;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a .style_module_searchOption__fe028c7a {\n padding: 0 10px;\n color: var(--text-color-secondary);\n font-size: 14px;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a .ant-select-item {\n height: 30px !important;\n line-height: 30px !important;\n}\n.style_module_semanticType__fe028c7a {\n margin-right: 10px;\n}\n.style_module_quoteText__fe028c7a {\n color: var(--chat-blue);\n}\n",{});var wo=T.OptGroup,Io=T.Option,No=!1,So=!1,Co=function(){No=!0},To=function(){No=!1},Eo=w((function(o,l){var r,c,d,u=o.inputMsg,m=o.chatId,_=o.currentAgent,v=o.agentList,y=o.onToggleHistoryVisible,x=o.onOpenAgents,b=o.onInputMsgChange,w=o.onSendMsg,N=o.onAddConversation,S=o.onSelectAgent,C=o.onOpenShowcase,T=p([]),E=T[0],L=T[1],M=p({}),A=M[0],k=M[1],z=p(!1),D=z[0],q=z[1],R=p(!1),O=R[0],F=R[1],B=h(),P=h(0),Q=function(){var e;null===(e=B.current)||void 0===e||e.focus()},W=function(){var e;null===(e=B.current)||void 0===e||e.blur()};I(l,(function(){return{inputFocus:Q,inputBlur:W}}));f((function(){var e;return(e=document.getElementById("chatInput")).addEventListener("compositionstart",Co),e.addEventListener("compositionend",To),function(){!function(){var e=document.getElementById("chatInput");e&&(e.removeEventListener("compositionstart",Co),e.removeEventListener("compositionend",To))}()}}),[]);var V=g((function(){return s((function(e,o,a){return n(void 0,void 0,void 0,(function(){var n,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return No||(""===e||1===e.length&&"@"===e[0])?[2]:(P.current+=1,n=P.current,i=function(e){var n=e;if("/"===(null==e?void 0:e[0])){var t=v.find((function(n){return e.includes("/".concat(n.name))}));n=t?e.replace("/".concat(t.name),""):e}return{msgValue:n,dataSetId:void 0}}(e),l=i.msgValue,r=i.dataSetId,[4,Ln(l.trim(),o,r,null==a?void 0:a.id)]);case 1:return c=t.sent(),n!==P.current?[2]:(d=l&&c.data||[],(s=d.map((function(e){return e.subRecommend}))).length>0&&s.every((function(e){return null!==e}))?k(function(e){var n=Je(e,"dataSetName");return Ze&&e.length>6?Object.keys(n).slice(0,4).reduce((function(e,t){return e[t]=n[t].slice(0,Object.keys(n).length>2?2:Object.keys(n).length>1?3:6),e}),{}):n}(d)):k({}),q(d.length>0),[2])}}))}))}),200)}),[]),U=p(V)[0];f((function(){if(1===u.length&&"/"===u[0])return q(!0),L(v),void k({});E.length>0&&setTimeout((function(){L([])}),50),So?So=!1:U(u,m,_),u||(k({}),P.current=0)}),[u]),f((function(){O||q(!1)}),[O]),f((function(){var e=document.querySelector(".".concat(bo.autoCompleteDropdown));if(e){var n=function(e,n,t,o){void 0===n&&(n="16px"),void 0===t&&(t="normal"),void 0===o&&(o="DINPro Medium");var a=(an||(an=document.createElement("canvas"))).getContext("2d");a.font="".concat(t," ").concat(n," ").concat(o);var i=a.measureText(e);return Math.ceil(i.width)}(u);Object.keys(A).length>0?e.style.marginLeft="".concat(n,"px"):setTimeout((function(){e.style.marginLeft="0px"}),200)}}),[A]);var H=function(e){var n=Object.keys(A).reduce((function(e,n){return e=e.concat(A[n])}),[]).find((function(n){return 1===Object.keys(A).length?n.recommend===e:"".concat(n.dataSetName||"").concat(n.recommend)===e}));n&&So?w(n.recommend,n.dataSetIds):w(e.trim(),null==n?void 0:n.dataSetId)},X=G(bo.autoCompleteDropdown,((r={})[bo.mobile]=Ze,r[bo.modelOptions]=E.length>0,r)),K=G(bo.chatFooter,((c={})[bo.mobile]=Ze,c)),J=E.map((function(n){return a(Io,e({value:"/".concat(n.name," "),className:bo.searchOption},{children:n.name}),n.id)})),$=Object.keys(A).map((function(n){return a(wo,e({label:n},{children:A[n].map((function(n){var t=1===Object.keys(A).length?n.recommend:"".concat(n.dataSetName||"").concat(n.recommend);if("/"===u[0]){var o=v.find((function(e){return u.includes(e.name)}));t=o?"/".concat(o.name," ").concat(n.recommend):t}return a(Io,e({value:"".concat(t).concat(yo),className:bo.searchOption},{children:i("div",e({className:bo.optionContent},{children:[n.schemaElementType&&a(j,e({className:bo.semanticType,color:n.schemaElementType===Yt.DIMENSION||n.schemaElementType===Yt.MODEL?"blue":n.schemaElementType===Yt.VALUE?"geekblue":"cyan"},{children:vo[n.schemaElementType]||n.schemaElementType||"维度"})),n.subRecommend]}))}),"".concat(n.recommend).concat(n.dataSetName?"_".concat(n.dataSetName):""))}))}),n)})),Z=function(){setTimeout((function(){var e=document.querySelector("."+bo.autoCompleteDropdown+" .rc-virtual-list-holder-inner");if(e){var n=window.getComputedStyle(e);e.setAttribute("style","".concat(n.cssText,";width: fit-content"));var t=e.clientWidth;e.parentElement.style.width=t+20+"px"}else Z()}))};f((function(){(J.length||$.length)&&Z()}),[J.length,$.length]);var ee=function(e){var n=p(!1),t=n[0],o=n[1];return f((function(){var n,t=function(){o(!0)},a=function(){o(!1)},i=(null!==(n=e)&&"object"==typeof n&&"current"in n?e.current:e)||window;return i.addEventListener("compositionstart",t),i.addEventListener("compositionend",a),function(){i.removeEventListener("compositionstart",t),i.removeEventListener("compositionend",a)}}),[e]),{isComposing:t,setIsComposing:o}}(document.getElementById("chatInput")).isComposing;return i("div",e({className:K},{children:[i("div",e({className:bo.tools},{children:[i("div",e({className:bo.toolItem,onClick:function(){N()}},{children:[a(rn,{type:"icon-c003xiaoxiduihua",className:bo.toolIcon}),a("div",{children:"新对话"})]})),!Ze&&i("div",e({className:bo.toolItem,onClick:y},{children:[a(rn,{type:"icon-lishi",className:bo.toolIcon}),a("div",{children:"历史对话"})]})),(null==v?void 0:v.length)>1&&i("div",e({className:bo.toolItem,onClick:x},{children:[a(rn,{type:"icon-zhinengzhuli",className:bo.toolIcon}),a("div",{children:"智能助理"})]})),i("div",e({className:bo.toolItem,onClick:C},{children:[a(rn,{type:"icon-showcase",className:bo.toolIcon}),a("div",{children:"showcase"})]}))]})),a("div",e({className:bo.composer},{children:i("div",e({className:bo.composerInputWrapper},{children:[a(Y,e({className:bo.composerInput,placeholder:_?"【".concat(_.name,"】将与您对话,点击").concat(Ze?"":"左侧","【智能助理】").concat(Ze?"":"列表","可切换"):"请输入您的问题",value:u,onChange:function(e){b(e)},onSelect:function(e){if(So=!0,E.length>0){var n=v.find((function(n){return e.includes(n.name)}));n&&(n.id!==(null==_?void 0:_.id)&&S(n),b(""))}else b(e.replace(yo,""));q(!1),setTimeout((function(){So=!1}),200)},autoFocus:!Ze,ref:B,id:"chatInput",onKeyDown:function(e){if("Enter"===e.code||"NumpadEnter"===e.code){var n=document.getElementById("chatInput"),t=v.find((function(e){return"/"===n.value[0]&&n.value.includes(e.name)}));if(t)return t.id!==(null==_?void 0:_.id)&&S(t),void b("");So||ee||(H(n.value),q(!1))}},onFocus:function(){F(!0)},onBlur:function(){F(!1)},dropdownClassName:X,listHeight:500,allowClear:!0,open:D,defaultActiveFirstOption:!1,getPopupContainer:function(e){return e.parentNode}},{children:E.length>0?J:$})),a("div",e({className:G(bo.sendBtn,(d={},d[bo.sendBtnActive]=(null==u?void 0:u.length)>0,d)),onClick:function(){H(u)}},{children:a(rn,{type:"icon-ios-send"})}))]}))}))]}))})),Lo="style_module_agentList__d41a8a7b",Mo="style_module_header__d41a8a7b",Ao="style_module_headerTitle__d41a8a7b",ko="style_module_plusIcon__d41a8a7b",zo="style_module_agentListContent__d41a8a7b",Do="style_module_agentItem__d41a8a7b",qo="style_module_avatar__d41a8a7b",Ro="style_module_agentInfo__d41a8a7b",Oo="style_module_agentName__d41a8a7b",Fo="style_module_agentDesc__d41a8a7b",Bo="style_module_active__d41a8a7b";Ee(".style_module_agentList__d41a8a7b {\n position: relative;\n width: 248px;\n height: 100%;\n background: #f9f9f9;\n border-right: 1px solid #f1f1f1;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 50px;\n padding: 0 16px;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_headerTitle__d41a8a7b {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_plusIcon__d41a8a7b {\n color: var(--text-color);\n font-size: 15px;\n cursor: pointer;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_plusIcon__d41a8a7b:hover {\n color: var(--chat-blue);\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b {\n display: flex;\n flex-direction: column;\n padding: 4px 8px;\n row-gap: 2px;\n height: calc(100% - 50px);\n overflow-y: auto;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b {\n display: flex;\n align-items: center;\n padding: 8px 4px;\n column-gap: 8px;\n border-radius: 8px;\n cursor: pointer;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_avatar__d41a8a7b {\n font-size: 40px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b {\n display: flex;\n flex-direction: column;\n row-gap: 2px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b .style_module_agentName__d41a8a7b {\n color: #000;\n font-size: 14px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b .style_module_agentDesc__d41a8a7b {\n width: 160px;\n overflow: hidden;\n color: var(--text-color-fourth);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b {\n background: #22a5f7;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover .style_module_agentName__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b .style_module_agentName__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover .style_module_agentDesc__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b .style_module_agentDesc__d41a8a7b {\n color: #fff;\n}\n",{});var Po=function(n){var t=n.agentList,o=n.currentAgent,l=n.onSelectAgent;return i("div",e({className:Lo},{children:[i("div",e({className:Mo},{children:[a("div",e({className:Ao},{children:"智能助理"})),a(ue,{className:ko,onClick:function(){R.info("正在开发中,敬请期待")}})]})),a("div",e({className:zo},{children:t.map((function(n,t){var r,c=G(Do,((r={})[Bo]=(null==o?void 0:o.id)===n.id,r));return i("div",e({className:c,onClick:function(){l(n)}},{children:[a(rn,{type:go[t%go.length],className:qo}),i("div",e({className:Ro},{children:[a("div",e({className:Oo},{children:n.name})),a("div",e({className:Fo},{children:n.description}))]}))]}),n.id)}))}))]}))},Qo="style_module_mobileAgents__c9cbfa90",jo="style_module_agentListContent__c9cbfa90",Yo="style_module_agentItem__c9cbfa90",Wo="style_module_active__c9cbfa90",Vo="style_module_agentTitleBar__c9cbfa90",Uo="style_module_avatar__c9cbfa90",Go="style_module_agentName__c9cbfa90",Ho="style_module_agentDesc__c9cbfa90";Ee(".style_module_mobileAgents__c9cbfa90 .ant-drawer-content {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .ant-drawer-content .ant-drawer-header {\n padding: 16px 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .ant-drawer-content .ant-drawer-body {\n padding: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 {\n padding: 12px 16px;\n background-color: #f5f7f9;\n border: 1px solid transparent;\n border-radius: 10px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90.style_module_active__c9cbfa90 {\n border: 1px solid var(--chat-blue);\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 .style_module_avatar__c9cbfa90 {\n font-size: 24px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 .style_module_agentName__c9cbfa90 {\n color: var(--text-color);\n font-weight: 500;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentDesc__c9cbfa90 {\n margin-top: 8px;\n color: var(--text-color-third);\n font-size: 13px;\n line-height: 24px;\n}\n",{});var Xo=function(n){var t=n.open,o=n.agentList,l=n.currentAgent,r=n.onSelectAgent,c=n.onClose;return a(W,e({title:"智能助理",placement:"bottom",open:t,height:"85%",className:Qo,onClose:c},{children:a("div",e({className:jo},{children:o.map((function(n,t){var o,d=G(Yo,((o={})[Wo]=(null==l?void 0:l.id)===n.id,o));return i("div",e({className:d,onClick:function(){r(n),c()}},{children:[i("div",e({className:Vo},{children:[a(rn,{type:go[t%go.length],className:Uo}),a("div",e({className:Go},{children:n.name}))]})),a("div",e({className:Ho},{children:n.description}))]}),n.id)}))}))}))},Ko="style_module_showCase__4980a35e",Jo="style_module_showCaseContent__4980a35e",$o="style_module_showCaseItem__4980a35e",Zo="style_module_showCaseChatItem__4980a35e",ea="style_module_mobile__4980a35e";Ee(".style_module_showCase__4980a35e {\n position: relative;\n height: 100%;\n padding: 0 20px;\n overflow-y: auto;\n padding-bottom: 2px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e {\n column-count: 2;\n column-gap: 20px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showcaseLoading__4980a35e {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 400px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showCaseItem__4980a35e {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 12px;\n margin-bottom: 20px;\n overflow-y: auto;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n background: linear-gradient(180deg, rgba(23, 74, 228, 0) 29.44%, rgba(23, 74, 228, 0.06) 100%), linear-gradient(90deg, #f3f3f7 0%, #f3f3f7 20%, #ebf0f9 60%, #f3f3f7 80%, #f3f3f7 100%);\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showCaseItem__4980a35e .style_module_showCaseChatItem__4980a35e {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n.style_module_showCase__4980a35e.style_module_mobile__4980a35e {\n padding: 0 4px;\n}\n.style_module_showCase__4980a35e.style_module_mobile__4980a35e .style_module_showCaseContent__4980a35e {\n column-count: 1;\n}\n",{});var na=Ze?"/openapi":"/api";function ta(e,n,t){return Tn.post("".concat(na,"/chat/manage/queryShowCase?agentId=").concat(e),{current:n,pageSize:t})}var oa=function(l){var r,c=l.height,d=l.agentId,s=l.onSendMsg,u=p([]),m=u[0],_=u[1],v=p(!1),g=v[0],y=v[1],x=p(1),b=x[0],w=x[1],I=h(null),N=function(e){return n(void 0,void 0,void 0,(function(){var n,a,i;return t(this,(function(t){switch(t.label){case 0:return 1===e&&y(!0),[4,ta(d,e,Ze?10:20)];case 1:return n=t.sent(),1===e&&y(!1),a=n.data.showCaseMap||{},i=Object.keys(a).reduce((function(e,n){return e.push({msgList:a[n],caseId:n}),e}),[]).sort((function(e,n){var t,o,a,i;return((null===(o=null===(t=n.msgList)||void 0===t?void 0:t[0])||void 0===o?void 0:o.score)||3)-((null===(i=null===(a=e.msgList)||void 0===a?void 0:a[0])||void 0===i?void 0:i.score)||3)})),_(1===e?i:o(o([],m,!0),i,!0)),[2]}}))}))},S=Ne((function(e){(e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight||e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight+.5)&&(N(b+1),w(b+1))}),{leading:!0,trailing:!0,wait:200}).run;f((function(){if(!Ze){var e=I.current;return null==e||e.addEventListener("scroll",S),function(){e.removeEventListener("scroll",S)}}}),[]),f((function(){d&&(_([]),N(1),w(1))}),[d]);var C=G(Ko,((r={})[ea]=Ze,r));return a(M,e({spinning:g,size:"large"},{children:a("div",e({className:C,style:{height:c},ref:I},{children:a("div",e({className:Jo},{children:m.map((function(n){return a("div",e({className:$o},{children:n.msgList.filter((function(e){return!!e.queryResult})).slice(0,1).map((function(n){return i("div",e({className:Zo},{children:[a(fn,{position:"right",data:n.queryText,anonymousUser:!0}),a(St,{msg:n.queryText,parseInfos:n.parseInfos,msgData:n.queryResult,conversationId:n.chatId,agentId:d,integrateSystem:"showcase",score:n.score,onSendMsg:s})]}),n.questionId)}))}),n.caseId)}))}))}))}))};pe.locale("zh-cn");var aa=w((function(l,r){var d,s=l.token,u=l.agentIds,v=l.initialAgentId,g=l.chatVisible,y=l.noInput,x=l.isDeveloper,b=l.integrateSystem,w=l.isCopilot,N=l.onCurrentAgentChange,S=l.onReportMsgEvent,C=p([]),T=C[0],E=C[1],L=p(""),M=L[0],A=L[1],k=p(1),q=k[0],R=k[1],B=p(!1),Q=B[0],j=B[1],Y=p(!1),H=Y[0],X=Y[1],K=p(Ze?{chatId:0,chatName:"问答"}:void 0),J=K[0],$=K[1],Z=p(!1),ee=Z[0],ne=Z[1],te=p([]),oe=te[0],ae=te[1],ie=p(),le=ie[0],re=ie[1],ce=p(!1),de=ce[0],se=ce[1],ue=p(!0),me=ue[0],_e=ue[1],pe=p(!1),fe=pe[0],he=pe[1],ve=p(!1),ge=ve[0],ye=ve[1],xe=p(!0),be=xe[0],we=xe[1],Ie=h(),Ce=h();I(r,(function(){return{sendCopilotMsg:Te}}));var Te=function(n){_e(!1);var t=n.agentId,o=n.msg,a=n.modelId;if((null==le?void 0:le.id)!==t){E([]);var i=oe.find((function(e){return e.id===t}))||{};Le(e(e({},i),{initialSendMsgParams:n}))}else De(o,T,a,n)},Ee=function(e){var n=function(e,n){if(!c(e))return e;if(!e)return n;try{return JSON.parse(e)}catch(e){return console.log(e),n}}(null==e?void 0:e.toolConfig,{}),t=n.simpleMode,o=n.debugMode;m(t)?ye(t):ye(!1),m(o)?we(o):we(!0)},Le=function(e){re(e),null==N||N(e),localStorage.setItem("AGENT_ID","".concat(null==e?void 0:e.id)),e&&Ee(e),w||window.history.replaceState({},"","".concat(window.location.pathname,"?agentId=").concat(null==e?void 0:e.id))};f((function(){n(void 0,void 0,void 0,(function(){var e,n,o,a;return t(this,(function(t){switch(t.label){case 0:return[4,Tn.get("".concat(Bt,"/chat/agent/getAgentList"))];case 1:return e=t.sent(),n=(e.data||[]).filter((function(e){return 1===e.status&&(void 0===u||u.includes(e.id))})),ae(n),n.length>0&&((o=v||localStorage.getItem("AGENT_ID"))?(a=n.find((function(e){return e.id===+o})),Le(a||n[0])):Le(n[0])),[2]}}))}))}),[]),f((function(){s&&en(s)}),[s]),f((function(){g&&(ze(),tn())}),[g]),f((function(){if(J){var e=J.initialMsgParams;if(J.isAdd)return ze(),e?void De(e.msg,[],e.modelId,e):void Me();Ae(1),R(1)}}),[J]),f((function(){if(H){var e=document.getElementById("messageContainer");null==e||e.addEventListener("scroll",ke)}return function(){var e=document.getElementById("messageContainer");null==e||e.removeEventListener("scroll",ke)}}),[H]);var Me=function(e){var n;y||E([{id:on(),type:un.AGENT_LIST,msg:(null==e?void 0:e.name)||(null==le?void 0:le.name)||(null===(n=null==oe?void 0:oe[0])||void 0===n?void 0:n.name)}])},Ae=function(a){return n(void 0,void 0,void 0,(function(){var n,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return[4,(u=a,m=J.chatId,_=3,void 0===m&&(m=0),void 0===_&&(_=10),Tn.post("".concat(En,"/chat/manage/pageQueryInfo?chatId=").concat(m),{current:u,pageSize:_}))];case 1:return n=t.sent(),i=(null==n?void 0:n.data)||{hasNextPage:!1,list:[]},l=i.hasNextPage,r=i.list,c=o(o([],function(n){return n.map((function(n){return{id:n.questionId,questionId:n.questionId,type:un.QUESTION,msg:n.queryText,parseInfos:n.parseInfos,parseTimeCost:n.parseTimeCost,msgData:e(e({},n.queryResult||{}),{similarQueries:n.similarQueries}),score:n.score,agentId:null==le?void 0:le.id}}))}(r),!0),1===a?[]:T,!0),E(c),j(l),1===a?(0===r.length&&Me(),tn(),X(!0),ze()):null==(d=document.getElementById("".concat(null===(s=T[0])||void 0===s?void 0:s.id)))||d.scrollIntoView(),[2]}var u,m,_}))}))},ke=Ne((function(e){0===e.target.scrollTop&&Q&&(Ae(q+1),R(q+1))}),{leading:!0,trailing:!0,wait:200}).run,ze=function(){var e;Ze||null===(e=Ce.current)||void 0===e||e.inputFocus()},De=function(e,a,i,l){return n(void 0,void 0,void 0,(function(){var n,r,c,d,s,u;return t(this,(function(t){return""===(n=e||M).trim()?(A(""),[2]):(r=oe.find((function(e){return 1===n.indexOf(e.name)})),c="/"===n[0]&&r,d=c?r.id:void 0,((s=oe.find((function(e){return e.id===(null==l?void 0:l.agentId)})))||c)&&Le(s||r),u=o(o([],a||T,!0),[{id:on(),msg:n,msgValue:c?n.replace("/".concat(c.name),"").trim():n,modelId:-1===i?void 0:i,agentId:(null==s?void 0:s.id)||d||(null==le?void 0:le.id),type:un.QUESTION,filters:null==l?void 0:l.filters}],!1),E(u),tn(),A(""),[2])}))}))},qe=function(e){e.id!==(null==le?void 0:le.id)&&(1===T.length&&T[0].type===un.AGENT_LIST&&E([]),Le(e),tn())},Re=G(Tt,((d={})[Rt]=Ze,d[qt]=ee,d));return a(V,e({locale:Se},{children:i("div",e({className:Re},{children:[i("div",e({className:Et},{children:[!Ze&&oe.length>1&&me&&a(Po,{agentList:oe,currentAgent:le,onSelectAgent:qe}),a("div",e({className:Lt},{children:J&&a("div",e({className:Mt},{children:i("div",e({className:At},{children:[le&&!Ze&&!y&&a("div",e({className:kt},{children:i(z,e({style:{width:"100%"}},{children:[a(D,e({flex:"1 1 200px"},{children:i(O,{children:[a("div",e({className:zt},{children:le.name})),a("div",e({className:Dt},{children:le.description})),a(U,e({title:"精简模式下,问答结果将以文本形式输出"},{children:a(F,{style:{position:"relative",top:-1},size:"small",value:ge,checkedChildren:"精简模式",unCheckedChildren:"精简模式",onChange:function(e){ye(e)}},le.id)}))]})})),a(D,{flex:"0 1 118px"})]}))})),a(Ct,{id:"messageContainer",isSimpleMode:ge,isDebugMode:be,messageList:T,chatId:null==J?void 0:J.chatId,historyVisible:ee,currentAgent:le,chatVisible:g,isDeveloper:x,integrateSystem:b,onMsgDataLoaded:function(e,n,t,o,a){var i;if(null==S||S(t,o),Ze||null===(i=null==Ie?void 0:Ie.current)||void 0===i||i.updateData(null==le?void 0:le.id),e){var l=_(T),r=l.find((function(e){return e.id===n}));r&&(r.msgData=e,E(l)),a||tn("".concat(n))}},onSendMsg:De}),!y&&a(Eo,{inputMsg:M,chatId:null==J?void 0:J.chatId,agentList:oe,currentAgent:le,onToggleHistoryVisible:function(){ne(!ee)},onInputMsgChange:function(e){A(e||"")},onSendMsg:function(e,n){De(e,T,n),Ze&&function(){var e;null===(e=Ce.current)||void 0===e||e.inputBlur()}()},onAddConversation:function(){var e;null===(e=Ie.current)||void 0===e||e.onAddConversation(),ze()},onSelectAgent:qe,onOpenAgents:function(){Ze?se(!0):_e(!me)},onOpenShowcase:function(){he(!fe)},ref:Ce})]}))}))})),a(xo,{currentAgent:le,currentConversation:J,historyVisible:ee,onSelectConversation:function(n,t,o){$(e(e({},n),{initialMsgParams:t,isAdd:o})),function(e){e?-1!==e.chatId&&localStorage.setItem("CONVERSATION_ID","".concat(e.chatId)):localStorage.removeItem("CONVERSATION_ID")}(n)},onCloseConversation:function(){ne(!1)},ref:Ie}),le&&(Ze?a(W,e({title:"showcase",placement:"bottom",height:"95%",open:fe,className:Ft,destroyOnClose:!0,onClose:function(){he(!1)}},{children:a(oa,{agentId:le.id,onSendMsg:De})})):a(P,e({title:"showcase",width:"98%",open:fe,centered:!0,footer:null,wrapClassName:Ot,destroyOnClose:!0,onCancel:function(){he(!1)}},{children:a(oa,{height:"calc(100vh - 140px)",agentId:le.id,onSendMsg:De})})))]})),a(Xo,{open:de,agentList:oe,currentAgent:le,onSelectAgent:qe,onClose:function(){se(!1)}})]}))}))})),ia={copilot:"style_module_copilot__25135ae0",copilotMinimized:"style_module_copilotMinimized__25135ae0",minimizeWrapper:"style_module_minimizeWrapper__25135ae0",minimize:"style_module_minimize__25135ae0",chatPopover:"style_module_chatPopover__25135ae0",c2System:"style_module_c2System__25135ae0",header:"style_module_header__25135ae0",title:"style_module_title__25135ae0",leftSection:"style_module_leftSection__25135ae0",close:"style_module_close__25135ae0",transfer:"style_module_transfer__25135ae0",fullscreen:"style_module_fullscreen__25135ae0",chat:"style_module_chat__25135ae0",rightArrow:"style_module_rightArrow__25135ae0"};Ee(".style_module_copilot__25135ae0 {\n position: fixed;\n right: 8px;\n bottom: 220px;\n z-index: 999;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 54px;\n height: 54px;\n color: #fff;\n font-size: 26px;\n background-color: var(--chat-blue);\n background-clip: padding-box;\n border: 2px solid #fff;\n border-radius: 50%;\n box-shadow: 8px 8px 20px 0 rgba(55, 99, 170, 0.1);\n cursor: pointer;\n transition: all 0.2s ease-in-out;\n}\n.style_module_copilot__25135ae0.style_module_copilotMinimized__25135ae0 {\n right: -40px;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0 {\n position: absolute;\n top: -18px;\n right: -6px;\n display: none;\n width: 22px;\n height: 22px;\n padding: 4px;\n cursor: pointer;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0 .style_module_minimize__25135ae0 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n padding-bottom: 5px;\n background-color: var(--text-color-fifth-4);\n border-radius: 50%;\n transition: all 0.1s ease-in-out;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0:hover .style_module_minimize__25135ae0 {\n background-color: var(--text-color-fifth);\n}\n.style_module_copilot__25135ae0:hover {\n text-decoration: none;\n box-shadow: 8px 8px 20px rgba(55, 99, 170, 0.3);\n}\n.style_module_copilot__25135ae0:hover .style_module_minimizeWrapper__25135ae0 {\n display: block;\n}\n.style_module_chatPopover__25135ae0 {\n position: fixed;\n right: 90px;\n bottom: 5vh;\n z-index: 999;\n display: flex;\n flex-direction: column;\n width: 70vw;\n min-width: 1100px;\n height: 90vh;\n overflow: hidden;\n box-shadow: 4px 4px 10px rgba(55, 99, 170, 0.3), -2px -2px 16px rgba(55, 99, 170, 0.3);\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;\n}\n.style_module_chatPopover__25135ae0.style_module_c2System__25135ae0 {\n width: calc(100vw - 180px);\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 {\n position: relative;\n z-index: 99;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n padding-right: 16px;\n padding-left: 16px;\n background: linear-gradient(81.62deg, #2870ea 8.72%, var(--chat-blue) 85.01%);\n box-shadow: 1px 1px 8px #1b4aef5c;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_title__25135ae0 {\n color: #fff;\n font-weight: 700;\n font-size: 16px;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 {\n position: absolute;\n left: 16px;\n display: flex;\n align-items: center;\n color: #fff;\n font-size: 16px;\n column-gap: 20px;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_close__25135ae0 {\n font-size: 18px;\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_transfer__25135ae0 {\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_fullscreen__25135ae0 {\n font-size: 20px;\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_chat__25135ae0 {\n height: calc(90vh - 40px);\n}\n.style_module_chatPopover__25135ae0.style_module_fullscreen__25135ae0 {\n bottom: 0;\n left: 60px;\n width: calc(100vw - 150px);\n height: 100vh;\n}\n.style_module_chatPopover__25135ae0.style_module_fullscreen__25135ae0 .style_module_chat__25135ae0 {\n height: calc(100vh - 50px);\n}\n.style_module_rightArrow__25135ae0 {\n position: fixed;\n right: 69px;\n bottom: 232px;\n z-index: 999;\n color: var(--chat-blue);\n font-size: 30px;\n}\n",{});var la=w((function(n,t){var o,r,c=n.token,d=n.agentIds,s=n.noInput,u=n.isDeveloper,m=n.integrateSystem,_=n.apiUrl,v=n.onReportMsgEvent,g=n.onOpenChatPage,y=p(!1),x=y[0],b=y[1],w=p(!1),N=w[0],S=w[1],C=p(),T=C[0],E=C[1],L=h();I(t,(function(){return{sendCopilotMsg:M}})),f((function(){c&&en(c)}),[c]),f((function(){_&&localStorage.setItem("SUPERSONIC_CHAT_API_URL",_)}),[_]);var M=function(e){var n;null===(n=null==L?void 0:L.current)||void 0===n||n.sendCopilotMsg(e),A(!0)},A=function(e){b(e)},k=G(ia.copilot,((o={})[ia.copilotMinimized]=N,o)),z=G(ia.chatPopover,((r={})[ia.c2System]="c2"===m,r));return i(l,{children:[i("div",e({className:k,onMouseEnter:function(){S(!1)},onClick:function(){A(!x)}},{children:[a(rn,{type:"icon-copilot-fill"}),a("div",e({className:ia.minimizeWrapper,onClick:function(e){e.stopPropagation(),A(!1),S(!0)}},{children:a("div",e({className:ia.minimize},{children:"-"}))}))]})),i("div",e({className:ia.copilotContent,style:{display:x?"block":"none"}},{children:[i("div",e({className:z},{children:[i("div",e({className:ia.header},{children:[i("div",e({className:ia.leftSection},{children:[a(ce,{className:ia.close,onClick:function(){A(!1)}}),g&&a(rn,{type:"icon-weibiaoti-",className:ia.transfer,onClick:function(){null==g||g(null==T?void 0:T.id)}})]})),a("div",e({className:ia.title},{children:"Copilot"}))]})),a("div",e({className:ia.chat},{children:a(aa,{chatVisible:x,agentIds:d,noInput:s,isDeveloper:u,integrateSystem:m,isCopilot:!0,onCurrentAgentChange:E,onReportMsgEvent:v,ref:L})}))]})),a(me,{className:ia.rightArrow})]}))]})}));export{aa as Chat,St as ChatItem,vt as ChatMsg,la as Copilot,oa as ShowCase,Qt as getAllConversations,Pt as saveConversation,Ln as searchRecommend,en as setToken};
|
|
1
|
+
import{__assign as e,__awaiter as n,__generator as t,__spreadArray as o}from"tslib";import{jsx as a,jsxs as i,Fragment as l}from"react/jsx-runtime";import r from"moment";import{isString as c,isArray as d,debounce as s,isEqual as u,isBoolean as m,cloneDeep as _}from"lodash";import{useState as p,useEffect as f,useRef as h,useMemo as v,useCallback as g,useContext as y,createContext as x,memo as b,forwardRef as w,useImperativeHandle as I}from"react";import{Avatar as N,Table as S,Popover as C,Select as T,InputNumber as E,DatePicker as L,Spin as M,Dropdown as A,Menu as k,Row as z,Col as D,Button as q,message as R,Space as O,Switch as F,Form as B,Modal as P,Input as Q,Tag as j,AutoComplete as Y,Drawer as W,ConfigProvider as V,Tooltip as U}from"antd";import G from"classnames";import{createFromIconfontCN as H,DownOutlined as X,CheckCircleFilled as K,CloseCircleFilled as J,ReloadOutlined as $,SwapOutlined as Z,UpOutlined as ee,InfoCircleOutlined as ne,DownloadOutlined as te,FileJpgOutlined as oe,RedoOutlined as ae,LikeOutlined as ie,DislikeOutlined as le,LoadingOutlined as re,CloseOutlined as ce,SearchOutlined as de,DeleteOutlined as se,PlusCircleOutlined as ue,CaretRightOutlined as me}from"@ant-design/icons";import _e from"axios";import pe from"dayjs";import fe from"dayjs/plugin/quarterOfYear";import he from"rehype-highlight";import ve from"remark-gfm";import ge from"react-markdown";import"github-markdown-css/github-markdown.css";import"highlight.js/styles/github.css";import"dayjs/locale/zh-cn";import*as ye from"echarts";import{Prism as xe}from"react-syntax-highlighter";import{solarizedlight as be}from"react-syntax-highlighter/dist/esm/styles/prism";import{format as we}from"sql-formatter";import{CopyToClipboard as Ie}from"react-copy-to-clipboard";import{useThrottleFn as Ne}from"ahooks";import Se from"antd/locale/zh_CN";var Ce=[],Te=[];function Ee(e,n){if(e&&"undefined"!=typeof document){var t,o=!0===n.prepend?"prepend":"append",a=!0===n.singleTag,i="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(a){var l=Ce.indexOf(i);-1===l&&(l=Ce.push(i)-1,Te[l]={}),t=Te[l]&&Te[l][o]?Te[l][o]:Te[l][o]=r()}else t=r();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function r(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),a=0;a<t.length;a++)e.setAttribute(t[a],n.attributes[t[a]]);var l="prepend"===o?"afterbegin":"beforeend";return i.insertAdjacentElement(l,e),e}}var Le,Me,Ae,ke,ze,De;Ee("body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: 14px;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;\n}\n:root:root {\n --primary: 180deg 4%;\n --primary-color: #f87653;\n --blue: #296df3;\n --green: #00d59c;\n --deep-blue: #446dff;\n --chat-blue: #1b4aef;\n --wy-color: #c20c0c;\n --detail-width: 1300px;\n --primary-1: #fff0f0;\n --primary-2: #ffc7c7;\n --primary-3: #ff9ea1;\n --primary-4: #ff757e;\n --primary-5: #ff4d5e;\n --primary-6: #ff2441;\n --primary-7: #d91434;\n --primary-8: rgba(255, 36, 66, 0.1);\n --body-background: #f7fafa;\n --deep-background: #f0f0f0;\n --light-background: #f5f5f5;\n --component-background: #fff;\n --header-color: #edf2f2;\n --text-color: #181a1a;\n --text-color-secondary: #3d4242;\n --text-color-third: #626a6a;\n --text-color-fourth: #889191;\n --text-color-fifth: #afb6b6;\n --text-color-six: #a3a4a6;\n --text-color-fifth-4: hsla(180, 5%, 70%, 0.4);\n --tooltip-max-width: 350px;\n --info-color: #ff2442;\n --success-color: #52c41a;\n --processing-color: #ff2442;\n --error-color: #ff4d4f;\n --highlight-color: #ff4d4f;\n --newrank-color: #ff7800;\n --warning-color: #faad14;\n --normal-color: #d9d9d9;\n --white: #fff;\n --white-30: hsla(0, 0%, 100%, 0.3);\n --black: #000;\n --disabled-color: #afb6b6;\n --disabled-bg: #eceeee;\n --border-color-base: #e1e6e6;\n --chat-border-color-base: #d5d7db;\n --light-blue-background: rgba(58, 100, 255, 0.1);\n --link-color: #3a64ff;\n --link-hover-color: #638aff;\n --link-active-color: #2748d9;\n --link-bg-color: rgba(58, 100, 255, 0.1);\n --text-accent-color: #3a64ff;\n --primary-green: #31c462;\n --link-hover-bg-color: rgba(58, 100, 255, 0.06);\n --success-2: rgba(82, 196, 26, 0.2);\n --success-pink: #ff8193;\n --disabled-bg-3: hsla(180, 6%, 93%, 0.3);\n --tooltip-bg: #fff;\n --record-btn: #00b354;\n --record-btn-bg: rgba(0, 179, 84, 0.1);\n --record-btn-bg-3: rgba(0, 179, 84, 0.3);\n --border-color-base-bg-5: hsla(180, 9%, 89%, 0.5);\n --user-gao-color: #fcad36;\n --user-hao-color: #ec6f6f;\n --user-all-color: #252526;\n --nr-menu-highlight-color: #ff2442;\n --nr-menu-icon-hover-color: #ff2442;\n --nr-sider-background: #fff;\n --nr-menu-bg: #fff;\n --nr-sider-fixed-zindex: 12;\n --nr-header-fixed-zindex: 11;\n --newrank-color-bg: rgba(255, 120, 0, 0.1);\n --newrank-color-bg-3: rgba(255, 120, 0, 0.3);\n --warning-05: rgba(250, 173, 20, 0.05);\n --bridge-account-color: #ff2442;\n --bridge-agency-color: #3a64ff;\n --bridge-free-color: #ff7800;\n --bridge-medium-color: #00b354;\n}\n.ss-chat-dimension,\n.ss-chat-metric {\n position: relative;\n}\n.ss-chat-dimension::after,\n.ss-chat-metric::after {\n position: absolute;\n right: 0.5px;\n bottom: -2px;\n left: 0.5px;\n height: 2px;\n margin: 0 1px;\n content: '';\n}\n.ss-chat-dimension::after {\n background: var(--chat-blue);\n}\n.ss-chat-metric::after {\n background: var(--primary-green);\n}\n.ss-chat-table-row {\n cursor: pointer;\n}\n.ss-chat-even-row {\n background-color: #fbfbfb;\n}\n.ss-chat-no-border-table .ant-table-cell {\n border: none !important;\n}\n.ss-chat-no-border-table .ant-table-tbody > tr.ant-table-row:hover > td {\n background-color: #efefef !important;\n}\n.ss-chat-chat-msg {\n padding: 6px 14px 8px;\n border: 1px solid var(--border-color-base);\n border-radius: 4px;\n background: #f5f8fb;\n max-width: calc(100vw - 410px);\n}\n.ss-chat-chat-msg-bottom-tools {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 14px;\n margin-top: 12px;\n margin-bottom: 2px;\n}\n.ss-chat-chat-msg-bottom-tools.mobile {\n flex-wrap: wrap;\n}\n.ss-chat-chat-msg-metric-card-tools {\n margin-top: 0;\n}\n.ss-chat-bar-chart {\n height: 260px;\n margin-top: 16px;\n}\n.ss-chat-bar-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n}\n.ss-chat-bar-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-bar-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-bar-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-bar-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-bar-date-range {\n margin-top: 12px;\n font-size: 13px;\n color: var(--text-color-third);\n}\n.ss-chat-table {\n margin-top: 6px;\n}\n.ss-chat-table-photo {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ss-chat-table-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n margin-bottom: 12px;\n}\n.ss-chat-table-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-table-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n font-style: italic;\n margin-bottom: 15px;\n}\n.ss-chat-table-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-table-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-table-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-table-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-table-drill-down-dimensions {\n margin-top: 12px;\n}\n.ss-chat-table table {\n width: 100%;\n}\n.ss-chat-table-even-row {\n background-color: #fbfbfb;\n}\n.ss-chat-table .ant-table-container table > thead > tr:first-child th:first-child {\n border-top-left-radius: 12px !important;\n border-bottom-left-radius: 12px !important;\n}\n.ss-chat-table .ant-table-container table > thead > tr:first-child th:last-child {\n border-top-right-radius: 12px !important;\n border-bottom-right-radius: 12px !important;\n}\n.ss-chat-table .ant-table-tbody > tr.ant-table-row:hover > td {\n background-color: #fafafa !important;\n}\n.ss-chat-table .ant-table-cell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 250px;\n text-align: center !important;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell {\n padding-top: 10px;\n padding-bottom: 10px;\n color: #666;\n font-size: 13px;\n background: #f0f2f5;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell::before {\n display: none;\n}\n.ss-chat-table .ss-chat-table-formatted-value {\n font-weight: 500;\n}\n.ss-chat-table .ant-table-thead .ant-table-cell {\n padding-top: 8.5px;\n padding-bottom: 8.5px;\n color: #737b7b;\n font-weight: 500;\n font-size: 14px;\n background-color: #edf2f2;\n}\n.ss-chat-table .ant-table-tbody .ant-table-cell {\n padding: 12px 2px;\n color: var(--text-color);\n font-size: 14px;\n}\n.ss-chat-table .ant-table-pagination.ant-pagination {\n margin-bottom: 0;\n}\n.ss-chat-message-title-bar {\n display: flex;\n align-items: baseline;\n column-gap: 10px;\n margin-bottom: 6px;\n}\n.ss-chat-message-model-name {\n color: var(--text-color);\n margin-left: 4px;\n font-weight: 500;\n font-size: 15px;\n}\n.ss-chat-message-top-bar {\n position: relative;\n max-width: 80%;\n color: var(--text-color-third);\n font-size: 13px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ss-chat-message-content {\n display: flex;\n align-items: flex-start;\n}\n.ss-chat-message-body {\n width: 100%;\n}\n.ss-chat-message-bubble {\n position: relative;\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 8px 16px 10px;\n background: rgba(255, 255, 255, 0.8);\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.ss-chat-message-filter-section {\n display: flex;\n align-items: center;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.ss-chat-message-filter-values {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.ss-chat-message-filter-item {\n padding: 2px 12px;\n color: var(--text-color-secondary);\n background-color: #edf2f2;\n border-radius: 13px;\n max-width: 200px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ss-chat-message-tip {\n margin-left: 6px;\n color: var(--text-color-third);\n}\n.ss-chat-message-info-bar {\n display: flex;\n align-items: center;\n row-gap: 12px;\n flex-wrap: wrap;\n margin-top: 2px;\n margin-bottom: 12px;\n column-gap: 20px;\n color: var(--text-color-secondary);\n background: rgba(133, 156, 241, 0.1);\n padding: 4px 12px;\n width: fit-content;\n border-radius: 8px;\n}\n.ss-chat-message-main-entity-info {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 20px;\n row-gap: 10px;\n}\n.ss-chat-message-info-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-message-info-name {\n color: var(--text-color-secondary);\n}\n.ss-chat-message-info-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-card {\n width: 100%;\n row-gap: 4px;\n}\n.ss-chat-metric-card-dsl {\n height: 90px;\n}\n.ss-chat-metric-card-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n}\n.ss-chat-metric-card-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-item {\n margin-right: 4px;\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-card-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-metric-card-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-card-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-metric-card-query-tootip {\n margin-left: 5px;\n}\n.ss-chat-metric-card-indicator {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n margin: 12px 0;\n}\n.ss-chat-metric-card-date-range {\n color: var(--text-color-fourth);\n font-size: 12px;\n margin-top: 8px;\n}\n.ss-chat-metric-card-indicator-value {\n color: var(--text-color);\n font-weight: 700;\n font-size: 40px;\n color: var(--chat-blue);\n}\n.ss-chat-metric-card-indicator-switch {\n color: var(--text-color-fourth);\n font-size: 18px;\n margin-left: 6px;\n margin-bottom: 3px;\n}\n.ss-chat-metric-card-period-compare {\n width: 100%;\n display: flex;\n align-items: center;\n column-gap: 40px;\n font-size: 13px;\n overflow-x: auto;\n margin-bottom: 12px;\n}\n.ss-chat-metric-card-period-compare-item {\n display: flex;\n align-items: center;\n column-gap: 10px;\n}\n.ss-chat-metric-card-period-compare-item-title {\n color: var(--text-color-fourth);\n}\n.ss-chat-metric-card-period-compare-item-value {\n display: flex;\n align-items: center;\n column-gap: 4px;\n font-weight: 500;\n}\n.ss-chat-metric-card-period-compare-item-value-up {\n color: #fc6772;\n}\n.ss-chat-metric-card-period-compare-item-value-down {\n color: #2dca93;\n}\n.ss-chat-metric-card-drill-down-dimensions {\n margin-top: 2px;\n}\n.ss-chat-metric-trend {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n margin-top: 4px;\n width: 100%;\n row-gap: 4px;\n}\n.ss-chat-metric-trend-top-bar {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n row-gap: 12px;\n}\n.ss-chat-metric-trend-filter-section-wrapper {\n display: flex;\n align-items: center;\n color: var(--text-color-third);\n margin-left: 4px;\n}\n.ss-chat-metric-trend-filter-section {\n display: flex;\n align-items: center;\n font-size: 13px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-metric-trend-filter-item {\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-trend-filter-item-label {\n color: var(--text-color-third);\n}\n.ss-chat-metric-trend-filter-item-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-metric-trend-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 12px;\n}\n.ss-chat-metric-trend-select-options {\n display: flex;\n justify-content: space-between;\n}\n.ss-chat-metric-trend-indicator {\n display: flex;\n flex-direction: column;\n align-items: baseline;\n justify-content: center;\n}\n.ss-chat-metric-trend-date-range {\n color: var(--text-color-fourth);\n font-size: 14px;\n}\n.ss-chat-metric-trend-indicator-value {\n color: var(--text-color);\n font-weight: 600;\n font-size: 30px;\n}\n.ss-chat-metric-trend-indicator-name {\n color: var(--text-color-fourth);\n font-size: 14px;\n}\n.ss-chat-metric-trend-flow-trend-chart {\n margin-top: 4px;\n height: 230px;\n}\n.ss-chat-metric-trend-flow-trend-chart-single {\n height: 180px;\n}\n.ss-chat-metric-trend-charts {\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 8px;\n}\n.ss-chat-metric-trend-metric-fields {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n row-gap: 12px;\n color: var(--text-color);\n font-size: 15px;\n}\n.ss-chat-metric-trend-metric-field {\n display: inline-block;\n box-sizing: border-box;\n height: auto;\n margin: 0;\n margin-right: 8px;\n padding: 1px 8px;\n color: var(--text-color-third);\n font-variant: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n list-style: none;\n border-color: transparent;\n border-radius: 2px;\n cursor: pointer;\n opacity: 1;\n transition: all 0.3s;\n font-feature-settings: 'tnum', 'tnum';\n}\n.ss-chat-metric-trend-metric-field:hover {\n color: var(--chat-blue);\n}\n.ss-chat-metric-trend-metric-field-single {\n padding-left: 0;\n font-weight: 500;\n cursor: default;\n font-size: 15px;\n color: var(--text-color);\n}\n.ss-chat-metric-trend-metric-field-single:hover {\n color: var(--text-color);\n}\n.ss-chat-metric-info-indicator {\n display: flex;\n align-items: baseline;\n column-gap: 12px;\n}\n.ss-chat-metric-info-indicator-value {\n color: var(--text-color);\n font-weight: 500;\n font-size: 28px;\n line-height: 40px;\n margin-top: 2px;\n color: var(--text-color-secondary);\n}\n.ss-chat-metric-info-bottom-section {\n display: flex;\n align-items: center;\n column-gap: 20px;\n margin-top: 4px;\n}\n.ss-chat-metric-info-date {\n color: var(--text-color-fourth);\n font-size: 13px;\n}\n.ss-chat-metric-info-date-value {\n color: var(--chat-blue);\n}\n.ss-chat-metric-info-indicator-switch {\n color: var(--text-color-fourth);\n font-size: 18px;\n margin-left: 6px;\n margin-bottom: 3px;\n}\n.ss-chat-metric-info-period-compare {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 13px;\n overflow-x: auto;\n}\n.ss-chat-pie-select-options {\n display: flex;\n justify-content: flex-end;\n}\n.ss-chat-pie-chart {\n width: 100%;\n height: 400px;\n min-height: 400px;\n}\n.ss-chat-pie-metric-fields {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: 8px;\n row-gap: 12px;\n}\n.ss-chat-pie-metric-field-single {\n padding-left: 0;\n font-weight: 500;\n cursor: default;\n font-size: 15px;\n color: var(--text-color);\n}\n.ss-chat-pie-metric-field-single:hover {\n color: var(--text-color);\n}\n.ss-chat-pie-indicator-name {\n font-size: 14px;\n color: var(--text-color);\n font-weight: 500;\n margin-top: 2px;\n}\n.ss-chat-apply-auth {\n font-size: 14px;\n color: var(--text-color);\n}\n.ss-chat-apply-auth-apply {\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-no-permission-chart {\n position: relative;\n width: 100%;\n height: 300px;\n}\n.ss-chat-no-permission-chart-holder {\n width: 100%;\n height: 280px;\n}\n.ss-chat-no-permission-chart-bar-chart-holder {\n margin-top: 20px;\n}\n.ss-chat-no-permission-chart-no-permission {\n position: absolute;\n top: 50%;\n left: 50%;\n padding: 4px 12px;\n transform: translate(-50%, -50%);\n}\n.ss-chat-filter-section {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 12px;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.ss-chat-filter-section-field-label {\n color: var(--text-color-fourth);\n}\n.ss-chat-filter-section-filter-values {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 12px;\n}\n.ss-chat-filter-section-filter-item {\n color: var(--text-color-third);\n max-width: 200px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ss-chat-filter-section-filter-value {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-date-options {\n display: flex;\n align-items: center;\n column-gap: 20px;\n font-size: 14px;\n}\n.ss-chat-date-options-item {\n position: relative;\n color: var(--text-color-secondary);\n cursor: pointer;\n}\n.ss-chat-date-options-item:hover {\n color: var(--chat-blue);\n}\n.ss-chat-date-options-date-active {\n color: var(--chat-blue);\n}\n.ss-chat-date-options-date-mobile {\n font-size: 12px;\n}\n.ss-chat-date-options-active-identifier {\n position: absolute;\n bottom: -6px;\n width: 100%;\n height: 4px;\n background-color: var(--chat-blue);\n border-radius: 4px 4px 0 0;\n}\n.ss-chat-date-options-item-divider {\n width: 1px;\n height: 16px;\n background-color: var(--text-color-fifth);\n}\n.ss-chat-text-check-more {\n margin-left: 12px;\n font-size: 13px;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-text-arrow-icon {\n margin-left: 2px;\n font-size: 12px;\n}\n.ss-chat-text-reference-data {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n margin-top: 10px;\n}\n.ss-chat-text-reference-item {\n font-size: 13px;\n}\n.ss-chat-text-reference-item-title {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-text-reference-item-value {\n color: var(--text-color-secondary);\n margin-top: 4px;\n}\n.ss-chat-item {\n position: relative;\n display: flex;\n width: 100%;\n}\n.ss-chat-item-breathing-text {\n --bg-size: 400%;\n --color-one: hsl(235, 87%, 34%);\n --color-two: hsl(203, 95%, 55%);\n font-size: 14px;\n background: linear-gradient(90deg, var(--color-one), var(--color-two), var(--color-one)) 0 0 / var(--bg-size) 100%;\n color: transparent;\n background-clip: text;\n -webkit-background-clip: text;\n animation: move-bg 8s infinite linear;\n}\n@keyframes move-bg {\n to {\n background-position: var(--bg-size) 0;\n }\n}\n.ss-chat-item-loading {\n display: inline-block;\n width: 60px;\n height: 20px;\n}\n.ss-chat-item-loading-dot {\n display: inline-block;\n width: 4px;\n height: 4px;\n background-color: var(--text-color);\n margin: 0 2px;\n opacity: 0;\n animation: dot 1s ease-in-out infinite;\n}\n.ss-chat-item-loading-dot:nth-child(1) {\n animation-delay: 0s;\n}\n.ss-chat-item-loading-dot:nth-child(2) {\n animation-delay: 0.2s;\n}\n.ss-chat-item-loading-dot:nth-child(3) {\n animation-delay: 0.4s;\n}\n@keyframes dot {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 50% {\n opacity: 1;\n transform: scale(1);\n }\n 100% {\n opacity: 0;\n transform: scale(0.5);\n }\n}\n.ss-chat-item-content-parser-container {\n margin: 20px 0 0 10px;\n}\n.ss-chat-item-content-parser-options-title {\n margin-right: 8px;\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-item-content-options {\n display: flex;\n align-items: center;\n column-gap: 13px;\n margin-left: -10px;\n}\n.ss-chat-item-content-options.mobile {\n flex-wrap: wrap;\n}\n.ss-chat-item-content-option {\n border-radius: 4px;\n padding: 0 4px;\n font-weight: normal;\n color: var(--text-color-third);\n cursor: pointer;\n}\n.ss-chat-item-content-option:hover {\n color: var(--chat-blue);\n}\n.ss-chat-item-content-option-active {\n color: #fff !important;\n background-color: var(--chat-blue) !important;\n}\n.ss-chat-item-content-option-disabled {\n cursor: unset;\n background-color: #eee;\n}\n.ss-chat-item-content-option-disabled:hover {\n color: #626a6a;\n}\n.ss-chat-item-avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 40px;\n width: 40px;\n height: 40px;\n margin-right: 6px;\n border-radius: 50%;\n color: var(--chat-blue);\n background-color: #fff;\n}\n.ss-chat-item-time {\n position: absolute;\n top: -22px;\n color: var(--text-color-fourth);\n}\n.ss-chat-item-mobile-msg-card {\n width: 100%;\n}\n.ss-chat-item-content {\n position: relative;\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 12px 20px 12px 16px;\n background: #fff;\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.ss-chat-item-content-mobile {\n width: 100%;\n}\n.ss-chat-item-content-text {\n margin-top: 12px;\n}\n.ss-chat-item .ant-picker {\n background-color: #f5f8fb !important;\n border-color: #ececec !important;\n}\n.ss-chat-item .ant-picker-input > input {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-title-bar {\n display: flex;\n align-items: center;\n column-gap: 10px;\n}\n.ss-chat-item-title-tip {\n margin-left: 2px;\n color: var(--text-color-third);\n font-weight: normal;\n}\n.ss-chat-item-step-title {\n font-weight: 500;\n color: var(--text-color);\n}\n.ss-chat-item-code {\n margin-top: 10px !important;\n padding: 6px 14px 8px !important;\n border: 1px solid var(--border-color-base) !important;\n border-radius: 4px !important;\n background: #f5f8fb !important;\n max-width: calc(100vw - 410px);\n}\n.ss-chat-item-execute-title-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.ss-chat-item-reload {\n margin-left: 2px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-item-step-icon {\n color: var(--green);\n font-size: 16px;\n}\n.ss-chat-item-step-error-icon {\n color: var(--error-color);\n font-size: 16px;\n}\n.ss-chat-item-content-container {\n margin: 2px 0 2px 7px;\n padding: 10px 0 4px 18px;\n border-left: 1px solid var(--green);\n padding-bottom: 10px;\n}\n.ss-chat-item-content-container-simple {\n border-left: none;\n padding: 0;\n}\n.ss-chat-item-empty-content-container {\n padding-bottom: 0;\n}\n.ss-chat-item-content-container-failed {\n border-left: 1px solid transparent;\n}\n.ss-chat-item-auth-tip {\n font-size: 13px;\n color: var(--text-color-secondary);\n margin-bottom: 12px;\n line-height: 20px;\n}\n.ss-chat-item-switch-entity {\n cursor: pointer;\n}\n.ss-chat-item-down-icon {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.ss-chat-item-last-node {\n border-left: none;\n margin-left: 0;\n padding-left: 0;\n}\n.ss-chat-item-chart-content {\n padding: 6px 14px 12px;\n border: 1px solid var(--border-color-base);\n border-radius: 4px;\n background: #f5f8fb;\n}\n.ss-chat-item-multi-options {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 4px 0 12px;\n}\n.ss-chat-item-options {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n margin-top: 4px;\n}\n.ss-chat-item-tip {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n flex-wrap: wrap;\n color: var(--text-color-third);\n}\n.ss-chat-item-tip-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 10px;\n column-gap: 12px;\n color: var(--text-color-third);\n}\n.ss-chat-item-tip-content-option {\n padding: 6px 14px;\n border-radius: 16px;\n border: 1px solid var(--border-color-base);\n cursor: pointer;\n}\n.ss-chat-item-tip-content-option:hover {\n border-color: var(--chat-blue);\n color: var(--chat-blue);\n}\n.ss-chat-item-tip-content-option-disabled {\n cursor: auto;\n}\n.ss-chat-item-tip-content-option-disabled:hover {\n color: var(--text-color-secondary);\n border-color: var(--border-color-base);\n}\n.ss-chat-item-tip-content-option-active {\n border-color: var(--chat-blue);\n color: var(--chat-blue);\n cursor: auto;\n}\n.ss-chat-item-tip-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 4px;\n}\n.ss-chat-item-tip-item-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-item-tip-item-filter-content {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 12px;\n row-gap: 6px;\n}\n.ss-chat-item-tip-item-option {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n}\n.ss-chat-item-mobile-tip-item-option .ant-picker-panel-container .ant-picker-panels {\n flex-wrap: wrap !important;\n width: 280px !important;\n}\n.ss-chat-item-tip-item-filter-name {\n color: var(--text-color-secondary);\n font-weight: 500;\n}\n.ss-chat-item-mode-name {\n margin-right: -10px;\n font-weight: 500;\n}\n.ss-chat-item-tip-item-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-entity-info {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n column-gap: 12px;\n color: var(--text-color-third);\n font-size: 14px;\n}\n.ss-chat-item-dimension-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n}\n.ss-chat-item-dimension-name {\n color: var(--text-color-third);\n}\n.ss-chat-item-dimension-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-item-metric-info-list {\n margin-top: 30px;\n display: flex;\n flex-direction: column;\n row-gap: 30px;\n}\n.ss-chat-item-typing {\n width: 100%;\n padding: 0 5px;\n}\n.ss-chat-item-typing .ant-spin-dot {\n width: 100% !important;\n height: 100% !important;\n}\n.ss-chat-item-typing-bubble {\n width: fit-content;\n}\n.ss-chat-item-text-bubble {\n width: fit-content;\n}\n.ss-chat-item-text {\n line-height: 1.5;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n user-select: text;\n}\n.ss-chat-item-toggle-expand-btn {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n cursor: pointer;\n}\n.ss-chat-item-step-item {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n border-left: 1px solid var(--green);\n overflow: auto;\n}\n.ss-chat-item-export-data {\n margin-left: 12px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-filter-item {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: 6px;\n font-weight: 500;\n}\n.ss-chat-filter-item-filter-name {\n color: var(--text-color-secondary);\n}\n.ss-chat-filter-item-select-control {\n min-width: 120px;\n border-radius: 6px;\n}\n.ss-chat-filter-item-operator-control {\n min-width: 80px;\n border-radius: 6px;\n margin-right: 8px;\n}\n.ss-chat-filter-item-input-number-control {\n min-width: 100px;\n}\n.ss-chat-filter-item-switch-entity-tip {\n display: flex;\n align-items: center;\n column-gap: 6px;\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 13px;\n font-weight: normal;\n}\n.ss-chat-filter-item .ant-select-selector,\n.ss-chat-filter-item .ant-input-number-input {\n background-color: #f5f8fb !important;\n border-color: #ececec !important;\n}\n.ss-chat-filter-item .ant-select-selection-item,\n.ss-chat-filter-item .ant-input-number-input {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-filter-item .ant-select-multiple .ant-select-selection-item {\n background-color: var(--light-blue-background);\n}\n.ss-chat-filter-item-filter-value {\n color: var(--chat-blue);\n font-weight: 500;\n}\n.ss-chat-sql-item {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n border-left: 1px solid var(--green);\n overflow: auto;\n}\n.ss-chat-sql-item-toggle-expand-btn {\n color: var(--text-color-fourth);\n font-size: 12px;\n margin-right: 10px;\n cursor: pointer;\n}\n.ss-chat-sql-item-code {\n margin-top: 10px !important;\n padding: 6px 14px 8px !important;\n border: 1px solid var(--border-color-base) !important;\n border-radius: 4px !important;\n background: #f5f8fb !important;\n}\n.ss-chat-sql-item-copy-btn {\n position: absolute;\n top: 24px;\n right: 20px;\n background: transparent !important;\n border: 0 !important;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-sql-item-schema-row {\n display: flex;\n margin-top: 10px;\n}\n.ss-chat-sql-item-schema-row:first-child {\n margin-top: 0;\n}\n.ss-chat-sql-item-schema-title {\n width: 50px;\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-sql-item-schema-content {\n flex: 1;\n color: var(--text-color);\n}\n.ss-chat-sql-item-few-shot-item {\n margin-top: 10px;\n}\n.ss-chat-sql-item-few-shot-item:first-child {\n margin-top: 4px;\n}\n.ss-chat-sql-item-few-shot-title {\n color: var(--text-color);\n font-weight: 500;\n}\n.ss-chat-sql-item-few-shot-content {\n margin-top: 8px;\n display: flex;\n flex-direction: column;\n row-gap: 2px;\n}\n.ss-chat-sql-item-few-shot-content-item {\n display: flex;\n align-items: baseline;\n}\n.ss-chat-sql-item-few-shot-content-title {\n width: 50px;\n color: var(--text-color);\n}\n.ss-chat-sql-item-few-shot-content-text {\n line-height: 24px;\n color: var(--text-color-secondary);\n}\n.ss-chat-sql-item-few-shot-code {\n padding: 0 !important;\n background-color: transparent !important;\n}\n.ss-chat-sql-item-export-log {\n margin-left: 20px;\n width: fit-content;\n font-weight: normal;\n color: var(--text-color-secondary);\n font-size: 13px !important;\n}\n.ss-chat-sql-item-copilot {\n width: 700px;\n}\n.ss-chat-similar-questions {\n position: relative;\n margin: 2px 0 2px 7px;\n padding: 2px 0 8px 18px;\n overflow: auto;\n}\n.ss-chat-similar-questions-toggle-expand-btn {\n margin-left: 4px;\n color: var(--text-color-fourth);\n font-size: 12px;\n cursor: pointer;\n}\n.ss-chat-similar-questions-content {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n margin-top: 6px;\n margin-bottom: 2px;\n}\n.ss-chat-similar-questions-question {\n width: fit-content;\n color: var(--chat-blue);\n cursor: pointer;\n}\n.ss-chat-tools {\n display: flex;\n align-items: center;\n margin-top: 12px;\n column-gap: 6px;\n}\n.ss-chat-tools-feedback {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 0 10px 0 10px;\n color: var(--text-color-third);\n column-gap: 20px;\n}\n.ss-chat-tools-like {\n margin-right: 4px;\n}\n.ss-chat-tools-feedback-active {\n color: #eac54f;\n}\n.ss-chat-tools-mobile-tools {\n display: flex;\n flex-direction: column;\n margin-top: 12px;\n row-gap: 10px;\n}\n.ss-chat-tools-tools {\n margin-top: 0;\n}\n.ss-chat-tools-feedback {\n margin-left: 2px;\n}\n.ss-chat-tools-feedback-item {\n display: flex;\n align-items: flex-start;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n.ss-chat-tools-feedback-item-title {\n width: 40px;\n margin-right: 20px;\n text-align: right;\n font-size: 14px;\n font-weight: 500;\n color: var(--text-color);\n}\n.ss-chat-tools-font-style {\n font-size: 12px;\n color: grey;\n font-style: italic;\n text-align: center;\n}\n.ss-chat-recommend-options {\n padding: 8px 0 12px;\n}\n.ss-chat-recommend-options-item-name-column {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.ss-chat-recommend-options-entity-name:hover {\n color: var(--primary-color);\n}\n.ss-chat-recommend-options-table-row {\n cursor: pointer;\n}\n.ss-chat-drill-down-dimensions {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n.ss-chat-drill-down-dimensions-section {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 6px;\n}\n.ss-chat-drill-down-dimensions-title {\n color: var(--text-color-third);\n}\n.ss-chat-drill-down-dimensions-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-drill-down-dimensions-content-item-name {\n color: var(--chat-blue);\n font-weight: 500;\n border-bottom: 1px solid var(--chat-blue);\n padding: 1px;\n cursor: pointer;\n}\n.ss-chat-drill-down-dimensions-content-item-active {\n color: #fff;\n border-bottom: none;\n background-color: var(--chat-blue);\n border-radius: 2px;\n}\n.ss-chat-drill-down-dimensions-menu-item-active {\n color: var(--chat-blue);\n}\n.ss-chat-drill-down-dimensions-down-arrow {\n color: var(--chat-blue);\n}\n.ss-chat-drill-down-dimensions-cancel-drill-down {\n margin-left: 20px;\n color: var(--text-color-third);\n cursor: pointer;\n padding: 0 4px;\n border: 1px solid var(--text-color-third);\n border-radius: 4px;\n font-size: 12px;\n}\n.ss-chat-drill-down-dimensions-cancel-drill-down:hover {\n color: var(--chat-blue);\n border-color: var(--chat-blue);\n}\n.ss-chat-metric-options {\n display: flex;\n flex-direction: column;\n}\n.ss-chat-metric-options-section {\n width: 100%;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 6px;\n row-gap: 4px;\n}\n.ss-chat-metric-options-metric-card {\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n border-radius: 8px;\n background-color: #fff;\n width: fit-content;\n padding: 2px 4px;\n font-size: 12px;\n}\n.ss-chat-metric-options-title {\n color: var(--text-color-third);\n}\n.ss-chat-metric-options-content {\n display: flex;\n align-items: center;\n}\n.ss-chat-metric-options-content-item-name {\n color: var(--chat-blue);\n font-weight: 500;\n border-bottom: 1px solid var(--chat-blue);\n padding: 1px;\n cursor: pointer;\n}\n.ss-chat-metric-options-content-item-active {\n color: #fff;\n border-bottom: none;\n background-color: var(--chat-blue);\n border-radius: 2px;\n}\n.ss-chat-metric-options-menu-item-active {\n color: var(--chat-blue);\n}\n.ss-chat-metric-options-cancel-select {\n margin-left: 12px;\n color: var(--text-color-third);\n cursor: pointer;\n padding: 0 4px;\n border: 1px solid var(--text-color-third);\n border-radius: 4px;\n font-size: 12px;\n}\n.ss-chat-metric-options-cancel-select:hover {\n color: var(--chat-blue);\n border-color: var(--chat-blue);\n}\n",{}),function(e){e[e.NORMAL=0]="NORMAL",e[e.SEARCH_EXCEPTION=1]="SEARCH_EXCEPTION",e[e.EMPTY=2]="EMPTY",e[e.INVALID=3]="INVALID"}(Me||(Me={})),function(e){e.COMPLETED="COMPLETED",e.PENDING="PENDING",e.FAILED="FAILED"}(Ae||(Ae={})),function(e){e.DOMAIN="DOMAIN",e.DIMENSION="DIMENSION",e.METRIC="METRIC",e.VALUE="VALUE"}(ke||(ke={})),(Le={})[ke.DOMAIN]="数据模型",Le[ke.DIMENSION]="维度",Le[ke.METRIC]="指标",Le[ke.VALUE]="维度值",function(e){e.None="无",e.TenThousand="万",e.EnTenThousand="w",e.OneHundredMillion="亿",e.Thousand="k",e.Million="M",e.Giga="G"}(De||(De={}));var qe="#446dff",Re="rgba(153, 153, 153, 0.3)",Oe="ss-chat",Fe={DAY:[{label:"近7天",value:7},{label:"近30天",value:30},{label:"近60天",value:60},{label:"近90天",value:90}],WEEK:[{label:"近4周",value:4},{label:"近12周",value:12},{label:"近24周",value:24},{label:"近52周",value:52}],MONTH:[{label:"近3个月",value:3},{label:"近6个月",value:6},{label:"近12个月",value:12},{label:"近24个月",value:24}]},Be=["#3369FF","#36D2B8","#DB8D76","#47B359","#8545E6","#E0B18B","#7258F3","#0095FF","#52CC8F","#6675FF","#CC516E","#5CA9E6"],Pe="查询出错啦,数据库可能出现异常或者负载繁忙,请联系管理员或者稍后重试";(ze={})[Me.SEARCH_EXCEPTION]="数据查询异常",ze[Me.INVALID]="智能助理不太懂您说什么呐,回去一定补充知识";var Qe,je,Ye="ss-chat",We={SUM:"总计",AVG:"平均值",MAX:"最大值",MIN:"最小值"};function Ve(e,n,t){return void 0===t&&(t={}),"".concat(Ue((null==t?void 0:t.needMultiply100)?100*+e:e,(null==t?void 0:t.decimalPlaces)||2)).concat("percent"===n?"%":"")}function Ue(e,n){if(null==e||""===e)return 0;if(isNaN(+e)||n<0||n>100)return e;var t=(+e).toFixed(n);if(!/^-?[0-9.]+$/g.test(t))return"0";for(;t.includes(".")&&(t.endsWith(".")||t.endsWith("0"));)t=t.slice(0,-1);return t}function Ge(e){if(null==e||""===e)return 0;if(isNaN(+e))return e;var n=e.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}function He(e){return Ge(Ue(e,4))}!function(e){e.TEXT="TEXT",e.METRIC_CARD="METRIC_CARD",e.TABLE="TABLE",e.METRIC_TREND="METRIC_TREND",e.METRIC_BAR="METRIC_BAR",e.MARKDOWN="MARKDOWN",e.METRIC_PIE="METRIC_PIE"}(Qe||(Qe={})),function(e){e.AGGREGATE="AGGREGATE",e.METRIC_TAG="METRIC_TAG",e.ID="ID",e.DETAIL="DETAIL",e.OTHER="OTHER"}(je||(je={}));var Xe=function(e,n){if(n&&(void 0===e||0==+e))return 0;if(void 0===e)return"-";if(!isFinite(+e))return e;var t=Math.abs(+e),o=t>=1e8?De.OneHundredMillion:t>=1e4?De.TenThousand:De.None,a=function(e,n){var t=+e;if(isNaN(t)||n===De.None)return e;var o=0;switch(n){case De.TenThousand:case De.EnTenThousand:o=4;break;case De.OneHundredMillion:o=8;break;case De.Thousand:o=3;break;case De.Million:o=6;break;case De.Giga:o=9}return t/Math.pow(10,o)}(e,o);return"number"==typeof(a=Ge(a=Ue(a,o===De.OneHundredMillion?2:t<1?3:1)))&&isNaN(a)||0==+a?"-":"".concat(a).concat(o===De.None?"":o)},Ke=function(e){return isNaN(e)?"-":Math.abs(+e)>=1e4?(e/1e4).toFixed(1)+"万":Ue(e,2)},Je=function(n,t){return n.reduce((function(n,o){var a=e({},n),i=o[t];return a[i]||(a[i]=[]),a[i].push(o),a}),{})};function $e(e,n){var t;if(null==e?void 0:e.includes("rgb")){var o=e.match(/\d+/g).map(Number);t={r:o[0],g:o[1],b:o[2],a:o[3]}}else t=function(e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(e)||{};return"rgba(".concat(t.r+n,",").concat(t.g+n,",").concat(t.b+n).concat(t.a?",".concat(t.a):"",")")}var Ze=window.navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i);function en(e){localStorage.setItem("SUPERSONIC_TOKEN",e)}function nn(){return localStorage.getItem("SUPERSONIC_TOKEN")}window.navigator.userAgent.match(/(iPhone|iPod|ios)/i),window.navigator.userAgent.match(/(Android)/i);var tn=function(e){setTimeout((function(){var n=document.getElementById("messageContainer");if(n&&n.scrollHeight>n.clientHeight)if(e){var t=document.getElementById(e);t&&(n.scrollTop=n.scrollHeight-t.clientHeight-130)}else n.scrollTop=n.scrollHeight}),100)},on=function(e,n){void 0===e&&(e=8),void 0===n&&(n=62);var t,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];if(e)for(t=0;t<e;t++)a[t]=o[Math.floor(Math.random()*n)];else{var i=void 0;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",t=0;t<36;t++)a[t]||(i=Math.floor(16*Math.random()),a[t]=o[19===t?i%4%8+8:i])}return a.join("")},an=null;function ln(e,n){return null===n?"":n}var rn=H({scriptUrl:"//at.alicdn.com/t/c/font_4120566_7rwv3aw6wep.js"}),cn="style_module_leftAvatar__4b5996c0";Ee(".style_module_leftAvatar__4b5996c0 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n margin-right: 6px;\n color: var(--chat-blue);\n font-size: 40px;\n background-color: #fff;\n border-radius: 50%;\n}\n",{});var dn=function(){return a(rn,{type:"icon-zhinengsuanfa",className:cn})},sn={message:"style_module_message__2d45d9fd",messageTitleBar:"style_module_messageTitleBar__2d45d9fd",modelName:"style_module_modelName__2d45d9fd",messageTopBar:"style_module_messageTopBar__2d45d9fd",messageContent:"style_module_messageContent__2d45d9fd",messageBody:"style_module_messageBody__2d45d9fd",avatar:"style_module_avatar__2d45d9fd",bubble:"style_module_bubble__2d45d9fd",text:"style_module_text__2d45d9fd",textMsg:"style_module_textMsg__2d45d9fd",topBar:"style_module_topBar__2d45d9fd",messageTitleWrapper:"style_module_messageTitleWrapper__2d45d9fd",messageTitle:"style_module_messageTitle__2d45d9fd",right:"style_module_right__2d45d9fd",textBubble:"style_module_textBubble__2d45d9fd",listenerSex:"style_module_listenerSex__2d45d9fd",listenerArea:"style_module_listenerArea__2d45d9fd",typing:"style_module_typing__2d45d9fd",messageEntityName:"style_module_messageEntityName__2d45d9fd",messageAvatar:"style_module_messageAvatar__2d45d9fd",dataHolder:"style_module_dataHolder__2d45d9fd",subTitle:"style_module_subTitle__2d45d9fd",subTitleValue:"style_module_subTitleValue__2d45d9fd",avatarPopover:"style_module_avatarPopover__2d45d9fd",moreOption:"style_module_moreOption__2d45d9fd",selectOthers:"style_module_selectOthers__2d45d9fd",indicators:"style_module_indicators__2d45d9fd",indicator:"style_module_indicator__2d45d9fd",contentName:"style_module_contentName__2d45d9fd",aggregatorIndicator:"style_module_aggregatorIndicator__2d45d9fd",entityId:"style_module_entityId__2d45d9fd",idTitle:"style_module_idTitle__2d45d9fd",idValue:"style_module_idValue__2d45d9fd",typingBubble:"style_module_typingBubble__2d45d9fd",quote:"style_module_quote__2d45d9fd",filterSection:"style_module_filterSection__2d45d9fd",filterItem:"style_module_filterItem__2d45d9fd",noPermissionTip:"style_module_noPermissionTip__2d45d9fd",tip:"style_module_tip__2d45d9fd",infoBar:"style_module_infoBar__2d45d9fd",mainEntityInfo:"style_module_mainEntityInfo__2d45d9fd",infoItem:"style_module_infoItem__2d45d9fd",infoName:"style_module_infoName__2d45d9fd",infoValue:"style_module_infoValue__2d45d9fd",textWrapper:"style_module_textWrapper__2d45d9fd",rightTextWrapper:"style_module_rightTextWrapper__2d45d9fd",rightAvatar:"style_module_rightAvatar__2d45d9fd"};Ee(".style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd {\n display: flex;\n align-items: baseline;\n margin-bottom: 6px;\n column-gap: 10px;\n}\n.style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd .style_module_modelName__2d45d9fd {\n margin-left: 4px;\n color: var(--text-color);\n font-weight: 500;\n}\n.style_module_message__2d45d9fd .style_module_messageTitleBar__2d45d9fd .style_module_messageTopBar__2d45d9fd {\n position: relative;\n max-width: 80%;\n overflow: hidden;\n color: var(--text-color-third);\n font-size: 13px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd {\n display: flex;\n align-items: flex-start;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_messageBody__2d45d9fd {\n width: 100%;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_avatar__2d45d9fd {\n margin-right: 4px;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd {\n box-sizing: border-box;\n min-width: 1px;\n max-width: 100%;\n padding: 8px 16px 10px;\n background: rgba(255, 255, 255, 0.8);\n border: 1px solid transparent;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_text__2d45d9fd {\n line-height: 1.5;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n user-select: text;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_textMsg__2d45d9fd {\n padding: 12px 0 5px;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd {\n display: flex;\n align-items: center;\n max-width: 100%;\n padding: 4px 0 8px;\n overflow-x: auto;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n border-bottom: 1px solid rgba(0, 0, 0, 0.03);\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd .style_module_messageTitleWrapper__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_message__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_topBar__2d45d9fd .style_module_messageTitle__2d45d9fd {\n display: flex;\n align-items: center;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd {\n flex-direction: row-reverse;\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd {\n float: right;\n box-sizing: border-box;\n padding: 8px 16px;\n color: #fff;\n font-size: 14px;\n background: linear-gradient(81.62deg, #2870ea 8.72%, var(--chat-blue) 85.01%);\n border: 1px solid transparent;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n}\n.style_module_message__2d45d9fd.style_module_right__2d45d9fd .style_module_messageContent__2d45d9fd .style_module_bubble__2d45d9fd .style_module_text__2d45d9fd::selection {\n background: #1ba1f7;\n}\n.style_module_textBubble__2d45d9fd {\n width: fit-content;\n}\n.style_module_listenerSex__2d45d9fd {\n padding-bottom: 24px;\n}\n.style_module_listenerArea__2d45d9fd {\n padding-top: 24px;\n padding-bottom: 12px;\n}\n.style_module_typing__2d45d9fd {\n width: 100%;\n padding: 0 5px;\n}\n.style_module_typing__2d45d9fd .ant-spin-dot {\n width: 100%;\n}\n.style_module_messageEntityName__2d45d9fd {\n cursor: pointer;\n}\n.style_module_messageEntityName__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_messageAvatar__2d45d9fd {\n margin-right: 8px;\n}\n.style_module_dataHolder__2d45d9fd {\n position: relative;\n}\n.style_module_subTitle__2d45d9fd {\n margin-left: 20px;\n color: var(--text-color-third);\n font-weight: normal;\n font-size: 12px;\n}\n.style_module_subTitle__2d45d9fd .style_module_subTitleValue__2d45d9fd {\n margin-left: 6px;\n color: var(--text-color);\n font-size: 13px;\n}\n.style_module_avatarPopover__2d45d9fd .ant-popover-inner-content {\n padding: 3px 4px !important;\n}\n.style_module_moreOption__2d45d9fd {\n display: flex;\n align-items: center;\n margin-top: 10px;\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.style_module_moreOption__2d45d9fd .style_module_selectOthers__2d45d9fd {\n color: var(--text-color);\n cursor: pointer;\n}\n.style_module_moreOption__2d45d9fd .style_module_selectOthers__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd {\n display: flex;\n align-items: center;\n margin-left: 12px;\n column-gap: 12px;\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd .style_module_indicator__2d45d9fd {\n cursor: pointer;\n}\n.style_module_moreOption__2d45d9fd .style_module_indicators__2d45d9fd .style_module_indicator__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_contentName__2d45d9fd {\n max-width: 350px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_aggregatorIndicator__2d45d9fd {\n color: var(--text-color);\n font-weight: 500;\n font-size: 20px;\n}\n.style_module_entityId__2d45d9fd {\n display: flex;\n align-items: center;\n margin-left: 12px;\n column-gap: 4px;\n}\n.style_module_entityId__2d45d9fd .style_module_idTitle__2d45d9fd {\n color: var(--text-color-fourth);\n font-size: 12px;\n}\n.style_module_entityId__2d45d9fd .style_module_idValue__2d45d9fd {\n color: var(--text-color-fourth);\n font-size: 13px;\n cursor: pointer;\n}\n.style_module_entityId__2d45d9fd .style_module_idValue__2d45d9fd:hover {\n color: var(--primary-color);\n}\n.style_module_typingBubble__2d45d9fd {\n width: fit-content;\n}\n.style_module_quote__2d45d9fd {\n margin-bottom: 4px;\n padding: 0 4px 0 6px;\n color: var(--border-color-base);\n font-size: 13px;\n border-left: 4px solid var(--border-color-base);\n border-top-left-radius: 2px;\n border-bottom-left-radius: 2px;\n}\n.style_module_filterSection__2d45d9fd {\n display: flex;\n align-items: center;\n color: var(--text-color-secondary);\n font-weight: normal;\n font-size: 13px;\n}\n.style_module_filterSection__2d45d9fd .style_module_filterItem__2d45d9fd {\n padding: 2px 12px;\n color: var(--text-color-secondary);\n background-color: #edf2f2;\n border-radius: 13px;\n}\n.style_module_noPermissionTip__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_tip__2d45d9fd {\n margin-left: 6px;\n color: var(--text-color-third);\n}\n.style_module_infoBar__2d45d9fd {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-top: 20px;\n column-gap: 20px;\n}\n.style_module_mainEntityInfo__2d45d9fd {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n font-size: 13px;\n column-gap: 20px;\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd .style_module_infoName__2d45d9fd {\n color: var(--text-color-fourth);\n}\n.style_module_mainEntityInfo__2d45d9fd .style_module_infoItem__2d45d9fd .style_module_infoValue__2d45d9fd {\n color: var(--text-color-secondary);\n}\n.style_module_textWrapper__2d45d9fd {\n display: flex;\n align-items: center;\n}\n.style_module_textWrapper__2d45d9fd.style_module_rightTextWrapper__2d45d9fd {\n justify-content: flex-end;\n}\n.style_module_textWrapper__2d45d9fd .style_module_rightAvatar__2d45d9fd {\n margin-left: 6px;\n}\n",{});var un,mn,_n,pn=function(n){var t,o=n.position,i=n.width,l=n.height,r=n.children,c=n.bubbleClassName,d=G(sn.message,((t={})[sn.left]="left"===o,t[sn.right]="right"===o,t));return a("div",e({className:d,style:{width:i}},{children:a("div",e({className:sn.messageContent},{children:a("div",e({className:sn.messageBody},{children:a("div",e({className:"".concat(sn.bubble).concat(c?" ".concat(c):""),style:{height:l},onClick:function(e){e.stopPropagation()}},{children:r}))}))}))}))},fn=function(n){var t,o=n.position,l=n.data,r=n.quote,c=(n.anonymousUser,G(sn.textWrapper,((t={})[sn.rightTextWrapper]="right"===o,t)));return i("div",e({className:c},{children:[!Ze&&"left"===o&&a(dn,{}),i(pn,e({position:o,bubbleClassName:sn.textBubble},{children:["right"===o&&r&&a("div",e({className:sn.quote},{children:r})),a("div",e({className:sn.text},{children:l}))]})),!Ze&&"right"===o&&""]}))};!function(e){e.TEXT="text",e.QUESTION="question",e.TAG="tag",e.SUGGESTION="suggestion",e.NO_PERMISSION="no_permission",e.SEMANTIC_DETAIL="semantic_detail",e.PLUGIN="PLUGIN",e.WEB_PAGE="WEB_PAGE",e.RECOMMEND_QUESTIONS="recommend_questions",e.AGENT_LIST="agent_list"}(un||(un={})),function(e){e.INTERPRET="interpret"}(mn||(mn={})),function(e){e.DASHBOARD="DASHBOARD",e.WIDGET="WIDGET",e.URL="URL",e.TAG="TAG"}(_n||(_n={}));var hn="style_module_messageContainer__2eea6c23",vn="style_module_messageList__2eea6c23",gn="style_module_messageItem__2eea6c23",yn="style_module_mobile__2eea6c23";Ee(".style_module_messageContainer__2eea6c23 {\n position: relative;\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 {\n display: flex;\n flex-direction: column;\n padding: 70px 20px 60px 14px;\n row-gap: 16px;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 {\n display: flex;\n flex-direction: column;\n row-gap: 20px;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-small .ant-table-tbody .ant-table-cell {\n padding: 6px 0 !important;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-small .ss-chat-table-formatted-value {\n font-size: 15px !important;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-row {\n background-color: #fff;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ant-table-tbody > tr > td {\n border-bottom: 1px solid #f0f0f0;\n transition: background 0.2s, border-color 0.2s;\n}\n.style_module_messageContainer__2eea6c23 .style_module_messageList__2eea6c23 .style_module_messageItem__2eea6c23 .ss-chat-table-even-row {\n background-color: #fbfbfb;\n}\n.style_module_messageContainer__2eea6c23.style_module_mobile__2eea6c23 .style_module_messageList__2eea6c23 {\n padding: 20px 10px 30px;\n}\n",{});var xn="style_module_agentTip__c53e79c4",bn="style_module_agentTipMsg__c53e79c4",wn="style_module_title__c53e79c4",In="style_module_content__c53e79c4",Nn="style_module_examples__c53e79c4",Sn="style_module_example__c53e79c4";Ee(".style_module_agentTip__c53e79c4 {\n display: flex;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 {\n padding: 12px 20px 20px !important;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_title__c53e79c4 {\n margin-bottom: 12px;\n font-size: 14px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 {\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n margin-top: 10px;\n column-gap: 14px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_topBar__c53e79c4 .style_module_tip__c53e79c4 {\n margin-top: 2px;\n font-size: 13px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_examples__c53e79c4 {\n display: flex;\n flex-direction: column;\n font-size: 13px;\n row-gap: 8px;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4 .style_module_examples__c53e79c4 .style_module_example__c53e79c4 {\n color: var(--chat-blue);\n cursor: pointer;\n}\n.style_module_agentTip__c53e79c4 .style_module_agentTipMsg__c53e79c4 .style_module_content__c53e79c4.style_module_fullscreen__c53e79c4 {\n flex: none;\n width: 280px;\n}\n",{});var Cn=function(n){var t,o=n.currentAgent,l=n.onSendMsg;return o?i("div",e({className:xn},{children:[!Ze&&a(dn,{}),i(pn,e({position:"left",bubbleClassName:bn},{children:[i("div",e({className:wn},{children:["您好,智能助理【",o.name,"】将与您对话,试着问:"]})),a("div",e({className:In},{children:a("div",e({className:Nn},{children:(null===(t=o.examples)||void 0===t?void 0:t.length)>0?o.examples.map((function(n){return i("div",e({className:Sn,onClick:function(){l(n)}},{children:["“",n,"”"]}),n)})):a("div",e({className:Sn},{children:o.description}))}))}))]}))]})):null},Tn=_e.create({baseURL:"https://supersonic-test.aisteel.com:9082",timeout:12e4,headers:{"Content-Type":"application/json"}});Tn.interceptors.request.use((function(e){var n=nn();return n&&(null==e?void 0:e.headers)&&(e.headers.Authorization="Bearer ".concat(n)),e}),(function(e){return Promise.reject(e)})),Tn.interceptors.response.use((function(e){if("REDIRECT"===e.headers.redirect){for(var n=window;n!==n.top;)n=n.top;var t=e.headers.contextpath;n.location.href=(null==t?void 0:t.substring(0,null==t?void 0:t.indexOf("&")))+"&redirect_uri=".concat(encodeURIComponent("http://".concat(n.location.host)))}return e.data}),(function(e){return e.response&&401===e.response.status&&console.log("Unauthorized, please log in again."),Promise.reject(e)}));var En=Ze?"/openapi":"/api";function Ln(e,n,t,o){return Tn.post("".concat(En,"/chat/query/search"),{queryText:e,chatId:n||0,modelId:t,agentId:o})}function Mn(e){var n=e.queryText,t=e.chatId,o=e.modelId,a=e.agentId,i=e.parseId,l=e.queryId,r=e.filters,c=e.parseInfo,d=e.dataSetIds;return Tn.post("".concat(En,"/chat/query/parse"),{queryText:n,chatId:t||0,dataSetId:d&&d.length>0?d[0]:o,agentId:a,parseId:i,queryId:l,selectedParse:c,dataSetIds:d,queryFilters:r?{filters:r}:void 0})}function An(e,n,t,o){return Tn.post("".concat(En,"/chat/query/execute"),{queryText:e,agentId:o,chatId:n||0,queryId:t.queryId,parseId:t.id,dataSetIds:t.dataSetIds})}function kn(e,n,t){return Tn.post("".concat(En,"/chat/query/switchQuery"),{queryText:e,modelId:n,chatId:t||0})}function zn(e){return Tn.post("".concat(En,"/chat/query/queryData"),e)}function Dn(e){return Tn.get("".concat(En,"/chat/manage/getChatQuery/").concat(e))}function qn(e){return Tn.delete("".concat(En,"/chat/manage/").concat(e))}function Rn(e,n){return Tn.post("".concat(En,"/chat/query/choice"),{entityId:e,modelId:n})}function On(e,n){return Tn.post("".concat(En,"/chat/manage/updateQAFeedback?id=").concat(e,"&score=").concat(n,"&feedback="))}function Fn(e,n,t,o,a){return Tn.post("".concat(En,"/chat/query/queryDimensionValue"),{modelId:e,bizName:n,agentId:t,elementID:o,value:a})}function Bn(e){return Tn.get("".concat(En,"/semantic/dataSet/").concat(e))}var Pn=function(){var n="".concat(Ye,"-item");return i("span",e({className:"".concat(n,"-loading")},{children:[a("span",{className:"".concat(n,"-loading-dot")}),a("span",{className:"".concat(n,"-loading-dot")}),a("span",{className:"".concat(n,"-loading-dot")})]}))},Qn=function(o){var l,c=o.entityId,d=o.modelId,s=o.modelName,u=o.onSelect,m=p([]),_=m[0],h=m[1],v=p(!1),g=v[0],y=v[1],x="".concat(Oe,"-recommend-options");f((function(){c&&n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return y(!0),[4,Rn(c,d)];case 1:return e=n.sent(),y(!1),h(e.data),[2]}}))}))}),[c]);var b,w,I,C=G(x,((l={})["".concat(x,"-mobile-mode")]=Ze,l));return a("div",e({className:C},{children:(b={dataIndex:"name",key:"name",title:"基本信息",render:function(n,t){return i("div",e({className:"".concat(x,"-item-name-column")},{children:[a(N,{shape:"square",icon:a(rn,{type:"艺人库"===s?"icon-geshou":"icon-zhuanji"}),src:t.url}),i("div",e({className:"".concat(x,"-entity-name")},{children:[n,t.ver&&"完整版"!==t.ver&&"-"!==t.ver&&"(".concat(t.ver,")"),t.singerName&&" - ".concat(t.singerName)]}))]}))}},w=s.includes("歌曲")?"tme3platAvgLogYyPlayCnt":"tme3platJsPlayCnt",I=Ze?[b]:[b,s.includes("艺人")?{dataIndex:"onlineSongCnt",key:"onlineSongCnt",title:"在架歌曲数",align:"center",render:function(e){return e?Xe(+e):"-"}}:{dataIndex:"publishTime",key:"publishTime",title:"发布时间",align:"center",render:function(e){return e?r(e).format("YYYY-MM-DD"):"-"}},{dataIndex:w,key:w,align:"center",title:s.includes("歌曲")?"近7天日均运营播放量":"昨日结算播放量",render:function(e){return e?Xe(+e):"-"}}],a(S,{rowKey:"id",columns:I,dataSource:_,showHeader:!Ze,size:"small",pagination:!1,loading:g,className:"".concat(x,"-table"),rowClassName:"".concat(x,"-table-row"),onRow:function(e){return{onClick:function(){u(e.id)}}}}))}))},jn=function(n){var t,o=n.entityName,l=n.chatContext,r=n.onSwitchEntity,c=p(!1),d=c[0],s=c[1],u=l||{},m=u.modelId,_=u.modelName,f=u.dimensionFilters,h="".concat(Ye,"-item"),v=null===(t=null==f?void 0:f.find((function(e){return"zyqk_song_id"===(null==e?void 0:e.bizName)||"singer_id"===(null==e?void 0:e.bizName)})))||void 0===t?void 0:t.value;return a(C,e({content:a(Qn,{entityId:v,modelId:m,modelName:_,onSelect:function(e){s(!1),r(e)}}),placement:"bottomLeft",trigger:"click",open:d,onOpenChange:function(e){return s(e)}},{children:i("div",e({className:"".concat(h,"-tip-item-value ").concat(h,"-switch-entity")},{children:[o,a(X,{className:"".concat(h,"-down-icon")})]}))}))},Yn=function(o){var r,c,u,m,_=o.disabled,g=void 0!==_&&_,y=o.modelId,x=o.filters,b=o.filter,w=o.index,I=o.chatContext,N=o.agentId,S=o.entityAlias,C=o.integrateSystem,A=o.onFiltersChange,k=o.onSwitchEntity,z=p([]),D=z[0],q=z[1],R=p(!1),O=R[0],F=R[1],B=h(0),P="".concat(Ye,"-filter-item");f((function(){"string"!=typeof b.value&&!d(b.value)||0!==D.length||"showcase"===C||n(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,Fn(y,b.bizName,N,b.elementID,"")];case 1:return e=t.sent().data,q((null===(n=null==e?void 0:e.resultList)||void 0===n?void 0:n.map((function(e){return{label:e[b.bizName],value:e[b.bizName]}})))||[]),[2]}}))}))}),[]);var Q=v((function(){return s((function(e){B.current+=1;var n=B.current;q([]),F(!0),Fn(y,b.bizName,N,b.elementID,e).then((function(e){var t;n===B.current&&(q((null===(t=e.data)||void 0===t?void 0:t.resultList.map((function(e){return{label:e[b.bizName],value:e[b.bizName]}})))||[]),F(!1))}))}),500)}),[Fn]),j=function(e){var n=x.map((function(n,t){return n.bizName===b.bizName&&w===t&&(n.value="number"==typeof b.value||null===b.value||d(e)?e:"".concat(e),d(e)?1===e.length?(n.operator="=",n.value=e[0]):(n.operator="IN",n.value=e):n.value="number"==typeof b.value||null===b.value?e:"".concat(e)),n}));A(n)};return i("span",e({className:P},{children:[i("span",e({className:"".concat(P,"-filter-name")},{children:[b.name,":"]})),("number"==typeof b.value||null===b.value||b.operator&&!["IN","=","LIKE"].includes(b.operator))&&!(null===(r=b.bizName)||void 0===r?void 0:r.includes("_id"))&&a(T,{options:[{label:"大于等于",value:">="},{label:"大于",value:">"},{label:"等于",value:"="},{label:"小于等于",value:"<="},{label:"小于",value:"<"}],disabled:g,className:"".concat(P,"-operator-control"),value:b.operator,onChange:function(e){var n=x.map((function(n,t){return n.bizName===b.bizName&&w===t&&(n.operator=e),n}));A(n)}}),"number"!=typeof b.value&&null!==b.value||(null===(c=b.bizName)||void 0===c?void 0:c.includes("_id"))?"string"==typeof b.value&&pe(b.value,"YYYY-MM-DD").isValid()?a(L,{value:pe(b.value),onChange:function(e,n){var t=x.map((function(e,t){return e.bizName===b.bizName&&w===t&&(e.value=n),e}));A(t)},allowClear:!1}):"string"!=typeof b.value&&!d(b.value)||(null===(u=b.bizName)||void 0===u?void 0:u.includes("_id"))?S&&["歌曲","艺人"].includes(S)&&(null===(m=b.bizName)||void 0===m?void 0:m.includes("_id"))?i(l,{children:[a(jn,{entityName:b.value,chatContext:I,onSwitchEntity:k}),i("span",e({className:"".concat(P,"-switch-entity-tip")},{children:["(如未匹配到相关",S,",可点击","艺人"===S?"歌手":S,"ID切换)"]}))]}):a("span",e({className:"".concat(P,"-filter-value")},{children:"object"!=typeof b.value?b.value:""})):a(T,{disabled:g,value:b.value,options:D.filter((function(e){return""!==e.value&&null!==e.value})),className:"".concat(P,"-select-control"),onSearch:Q,notFoundContent:O?a(M,{size:"small"}):null,onChange:j,mode:"multiple",showSearch:!0,allowClear:!0}):a(E,{disabled:g,className:"".concat(P,"-input-number-control"),value:b.value,onChange:j})]}))},Wn="".concat(Ye,"-item"),Vn=function(n){var t,o,r,c,d,s=n.parseInfo,u=n.dimensionFilters,m=n.entityInfo,_=n.onSwitchDataSet,p=n.availableDataSets,f=n.loadingDataSets,h=s||{},v=h.dataSet,g=h.dimensions,y=h.metrics,x=h.aggType,b=h.queryMode,w=h.queryType,I=h.properties,N=h.entity,S=h.elementMatches,C=null==g?void 0:g.filter((function(e){return"DIMENSION"===e.type})),T="".concat(Wn,"-tip-item-value"),E=(null==u?void 0:u.length)>0?u[0].value:void 0,L=null===(r=null===(o=null===(t=null==N?void 0:N.alias)||void 0===t?void 0:t[0])||void 0===o?void 0:o.split("."))||void 0===r?void 0:r[0],M=null===(c=null==S?void 0:S.find((function(e){var n;return"ID"===(null===(n=e.element)||void 0===n?void 0:n.type)})))||void 0===c?void 0:c.element.name,z=I||{},D=z.type,q=z.name,R="TAG_DETAIL"===b?null==C?void 0:C.concat(y||[]):C;return a("div",e({className:"".concat(Wn,"-tip-content")},{children:D&&"LLM_S2SQL"!==b?i("div",e({className:"".concat(Wn,"-tip-item")},{children:["将由","plugin"===D?"插件":"内置","工具",a("span",e({className:T},{children:q})),"来解答"]})):i(l,{children:[((null==b?void 0:b.includes("ENTITY"))||"LLM_S2SQL"===b)&&"string"==typeof E&&L&&M?i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:[L,":"]})),a("div",e({className:T},{children:M}))]})):i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"数据集:"})),a("div",e({className:T},{children:a(A,e({overlay:function(){if(f)return a(k,{children:a(k.Item,e({disabled:!0},{children:a("div",e({style:{padding:"8px 12px",color:"#999"}},{children:"加载中..."}))}),"loading")});if(!p||p.length<=1)return null;var n=p.map((function(n){return{key:n.id,label:i("div",e({onClick:function(){return e=n,void(_&&e.id!==(null==v?void 0:v.id)&&_(e));var e},style:{padding:"8px 12px",cursor:"pointer",backgroundColor:n.id===(null==v?void 0:v.id)?"#f0f8ff":"transparent",fontWeight:n.id===(null==v?void 0:v.id)?"bold":"normal",color:n.id===(null==v?void 0:v.id)?"#1890ff":"#333"}},{children:[n.name,n.id===(null==v?void 0:v.id)&&a("span",e({style:{marginLeft:"8px",color:"#52c41a",fontSize:"12px"}},{children:"✓ 当前使用"}))]}))}}));return 0===n.length?null:a(k,{children:n.map((function(e){return a(k.Item,{children:e.label},e.key)}))})}()||a(k,{}),placement:"bottomLeft",trigger:["click"],disabled:f||!p||p.length<=1},{children:i("span",e({style:{cursor:f||!p||p.length<=1?"default":"pointer",textDecoration:f||!p||p.length<=1?"none":"underline"}},{children:[f?"加载中...":null==v?void 0:v.name,!f&&p&&p.length>1&&a("span",e({style:{marginLeft:"4px",fontSize:"12px"}},{children:"▼"}))]}))}))}))]})),(w===je.AGGREGATE||"METRIC_TAG"===w||"DETAIL"===w)&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:",可点击切换,查询模式:"})),a("div",e({className:T},{children:w===je.AGGREGATE||"METRIC_TAG"===w?"聚合模式":"明细模式"}))]})),"DETAIL"!==w&&y&&y.length>0&&!(null==g?void 0:g.some((function(e){var n;return null===(n=e.bizName)||void 0===n?void 0:n.includes("_id")})))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"指标:"})),a("div",e({className:T},{children:y.map((function(e){return e.name})).join("、")}))]})),["METRIC_GROUPBY","METRIC_ORDERBY","TAG_DETAIL","LLM_S2SQL","METRIC_FILTER"].includes(b)&&R&&R.length>0&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:["DETAIL"===w?"查询字段":"下钻维度",":"]})),i("div",e({className:T},{children:[R.slice(0,2).map((function(e){return e.name})).join("、"),R.length>2&&"..."]}))]})),"TAG_ID"!==b&&!(null==g?void 0:g.some((function(e){var n;return null===(n=e.bizName)||void 0===n?void 0:n.includes("_id")})))&&(null===(d=null==m?void 0:m.dimensions)||void 0===d?void 0:d.filter((function(e){return null!=e.value})).map((function(n){return i("div",e({className:"".concat(Wn,"-tip-item")},{children:[i("div",e({className:"".concat(Wn,"-tip-item-name")},{children:[n.name,":"]})),a("div",e({className:T},{children:n.value}))]}),n.itemId)}))),("METRIC_ORDERBY"===b||"METRIC_MODEL"===b)&&x&&"NONE"!==x&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"聚合方式:"})),a("div",e({className:T},{children:We[x]}))]}))]})}))},Un=function(n){var t=n.markdown;n.loading,n.onApplyAuth;var o="".concat(Oe,"-markdown");return a("div",e({className:"".concat(o," markdown-body"),style:{fontSize:14}},{children:a(ge,e({rehypePlugins:[he],remarkPlugins:[ve]},{children:t}))}))};pe.extend(fe),pe.locale("zh-cn");var Gn=L.RangePicker,Hn=function(o){var r,c,d,s=o.isSimpleMode,u=void 0!==s&&s,m=o.parseInfoOptions,_=o.agentId,h=o.integrateSystem,v=o.parseTimeCost,g=o.isDeveloper,y=o.onSelectParseInfo,x=o.onSwitchEntity,b=o.onFiltersChange,w=o.onDateInfoChange,I=o.onRefresh,N=o.handlePresetClick,S=o.setSelectedDataSetIds,C=p(),T=C[0],E=C[1],L=p([]),M=L[0],A=L[1],k=p(!1),R=k[0],O=k[1];f((function(){n(void 0,void 0,void 0,(function(){var e,o,a,i,l;return t(this,(function(r){switch(r.label){case 0:if(e=m.map((function(e){return e.dataSet})).filter(Boolean),!((o=null==T?void 0:T.dataSetIds)&&o.length>1))return[3,6];O(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,Promise.all(o.map((function(e){return n(void 0,void 0,void 0,(function(){var n,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Bn(e)];case 1:return n=t.sent(),[2,(null===(a=n.data)||void 0===a?void 0:a.data)||n.data];case 2:return o=t.sent(),console.error("Failed to fetch dataset ".concat(e,":"),o),[2,null];case 3:return[2]}}))}))})))];case 2:return a=r.sent(),(i=a.filter(Boolean)).length>0?A(i):A(e),[3,5];case 3:return l=r.sent(),console.error("Failed to fetch datasets:",l),A(e),[3,5];case 4:return O(!1),[7];case 5:return[3,7];case 6:A(e),r.label=7;case 7:return[2]}}))}))}),[null==T?void 0:T.dataSetIds,m]);var F={"近7日":[pe().subtract(7,"day"),pe()],"近14日":[pe().subtract(14,"day"),pe()],"近30日":[pe().subtract(30,"day"),pe()],"本周":[pe().startOf("week"),pe().endOf("week")],"本月":[pe().startOf("month"),pe().endOf("month")],"上月":[pe().subtract(1,"month").startOf("month"),pe().subtract(1,"month").endOf("month")],"本季度":[pe().startOf("quarter"),pe().endOf("quarter")],"本年":[pe().startOf("year"),pe().endOf("year")]},B=T||{},P=B.modelId;B.queryMode;var Q,j,Y,W=B.entity,V=B.nativeQuery,U=null===(d=null===(c=null===(r=null==W?void 0:W.alias)||void 0===r?void 0:r[0])||void 0===c?void 0:c.split("."))||void 0===d?void 0:d[0],H=function(n,t){var o,l="".concat(Wn,"-tip-item-value"),r=t||{},c=r.startDate,d=r.endDate,s=G("".concat(Wn,"-tip-item-option"),((o={})["".concat(Wn,"-mobile-tip-item-option")]=Ze,o)),u=!0;return i("div",e({className:"".concat(Wn,"-tip-item-filter-content")},{children:[!!t&&i("div",e({className:s},{children:[a("span",e({className:"".concat(Wn,"-tip-item-filter-name")},{children:"数据时间:"})),V?a("span",e({className:l},{children:c===d?c:"".concat(c," ~ ").concat(d)})):a(Gn,{value:[pe(c),pe(d)],onChange:w,format:"YYYY-MM-DD",disabled:u,renderExtraFooter:function(){return a(z,e({gutter:[28,28]},{children:Object.keys(F).map((function(n){return a(D,{children:a(q,e({size:"small",onClick:function(){return N(F[n])}},{children:n}))},n)}))}))}})]})),null==n?void 0:n.map((function(e,t){return a(Yn,{disabled:u,modelId:P,filters:n,filter:e,index:t,chatContext:T,entityAlias:U,agentId:_,integrateSystem:h,onFiltersChange:b,onSwitchEntity:x},"".concat(e.name,"_").concat(t))}))]}))},X=function(n){var t=n.dateInfo,o=n.dimensionFilters;return a(l,{children:(!!t||!!(null==o?void 0:o.length))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"筛选条件:"})),a("div",e({className:"".concat(Wn,"-tip-item-content")},{children:H(o,t)}))]}))})};return Q=a("div",e({className:"".concat(Wn,"-title-bar")},{children:i("div",{children:["意图确认",!!v&&g&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",v,"ms)"]}))]})})),j=a(l,{children:i("div",{children:[m.map((function(n,t){var o=n||{},r=o.queryMode,c=o.properties,d=o.textInfo,s=o.id,m=o.dimensionFilters,_=o.entityInfo,p=(c||{}).type;return u?a(l,{children:a("div",e({style:{marginBottom:10}},{children:i("span",e({className:"".concat(Wn,"-content-parser-options-title"),style:{display:"flex"}},{children:[i("span",e({style:{paddingTop:3,marginRight:10}},{children:["解析",t+1,": "]}))," ",a(Un,{markdown:d})]}))}))}):i("div",e({style:{marginBottom:10,paddingBottom:10,borderBottom:"1px solid #eee"}},{children:[a("div",e({style:{marginBottom:10,height:"30px",lineHeight:"30px"}},{children:i("span",e({className:"".concat(Wn,"-content-parser-options-title")},{children:["解析",t+1,":"]}))})),a("div",e({className:"".concat(Wn,"-tip")},{children:i(l,{children:[Vn({parseInfo:n,dimensionFilters:m,entityInfo:_,onSwitchDataSet:function(t){S([t.id]),setTimeout((function(){I(e(e({},n),{dataSet:t,dataSetIds:[t.id],id:(null==n?void 0:n.id)||0}))}),0)},availableDataSets:M,loadingDataSets:R}),!(p&&"LLM_S2SQL"!==r)&&X(n)]})}))]}),"".concat(s,"-").concat(d))})),(null==m?void 0:m.length)>1&&a("div",e({className:"".concat(Wn,"-content-parser-container")},{children:i("div",e({className:"".concat(Wn,"-content-options")},{children:[!T&&a("span",e({className:"".concat(Wn,"-breathing-text")},{children:"请选择适合的解析意图,并进行下一步:"})),m.map((function(n,t){return i("div",e({className:"".concat(Wn,"-content-option ").concat(n.id===(null==T?void 0:T.id)?"".concat(Wn,"-content-option-active"):""," ").concat(T?"".concat(Wn,"-content-option-disabled"):""),onClick:function(){T||(E(n),y(n))}},{children:["解析",t+1]}),n.id)}))]}))}))]})}),i("div",e({className:"".concat(Wn,"-parse-tip")},{children:[u?a(l,{}):i("div",e({className:"".concat(Wn,"-title-bar")},{children:[Y?a(J,{className:"".concat(Wn,"-step-error-icon")}):a(K,{className:"".concat(Wn,"-step-icon")}),i("div",e({className:"".concat(Wn,"-step-title")},{children:[Q,void 0===j&&a(Pn,{})]}))]})),(j||null===j)&&a("div",e({className:G(!u&&"".concat(Wn,"-content-container"),null===j&&"".concat(Wn,"-empty-content-container"),Y&&"".concat(Wn,"-content-container-failed"))},{children:j}))]}))};pe.extend(fe),pe.locale("zh-cn");var Xn=L.RangePicker,Kn=function(o){var r,c,d,s,u=o.isSimpleMode,m=void 0!==u&&u,_=o.parseLoading,h=o.parseInfoOptions,v=o.parseTip,g=o.currentParseInfo,y=o.agentId,x=o.dimensionFilters,b=o.dateInfo,w=o.entityInfo,I=o.integrateSystem,N=o.parseTimeCost,S=o.isDeveloper;o.onSelectParseInfo;var C=o.onSwitchEntity,T=o.onFiltersChange,E=o.onDateInfoChange,L=o.onRefresh,M=o.handlePresetClick,A=o.setSelectedDataSetIds,k=p([]),R=k[0],O=k[1],F=p(!1),B=F[0],P=F[1];f((function(){n(void 0,void 0,void 0,(function(){var e,n,o,a,i,l,r;return t(this,(function(t){switch(t.label){case 0:if(e=h.map((function(e){return e.dataSet})).filter(Boolean),n=new Set,h.forEach((function(e){var t;(null===(t=e.dataSet)||void 0===t?void 0:t.id)&&n.add(e.dataSet.id),e.dataSetIds&&e.dataSetIds.forEach((function(e){return n.add(e)}))})),(null==g?void 0:g.dataSetIds)&&g.dataSetIds.forEach((function(e){return n.add(e)})),(null===(r=null==g?void 0:g.dataSet)||void 0===r?void 0:r.id)&&n.add(g.dataSet.id),!((o=Array.from(n)).length>0))return[3,6];P(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),a=o.map((function(e){return Bn(e).then((function(e){var n;return(null===(n=e.data)||void 0===n?void 0:n.data)||e.data}))})),[4,Promise.all(a)];case 2:return i=t.sent(),O(i),[3,5];case 3:return l=t.sent(),console.error("获取候选数据集信息失败:",l),O(e),[3,5];case 4:return P(!1),[7];case 5:return[3,7];case 6:O(e),t.label=7;case 7:return[2]}}))}))}),[null==g?void 0:g.dataSetIds,null===(r=null==g?void 0:g.dataSet)||void 0===r?void 0:r.id,h]);var Q={"近7日":[pe().subtract(7,"day"),pe()],"近14日":[pe().subtract(14,"day"),pe()],"近30日":[pe().subtract(30,"day"),pe()],"本周":[pe().startOf("week"),pe().endOf("week")],"本月":[pe().startOf("month"),pe().endOf("month")],"上月":[pe().subtract(1,"month").startOf("month"),pe().subtract(1,"month").endOf("month")],"本季度":[pe().startOf("quarter"),pe().endOf("quarter")],"本年":[pe().startOf("year"),pe().endOf("year")]},j=function(n,t,o){return i("div",e({className:"".concat(Wn,"-parse-tip")},{children:[i("div",e({className:"".concat(Wn,"-title-bar")},{children:[o?a(J,{className:"".concat(Wn,"-step-error-icon")}):a(K,{className:"".concat(Wn,"-step-icon")}),i("div",e({className:"".concat(Wn,"-step-title")},{children:[n,void 0===t&&a(Pn,{})]}))]})),(t||null===t)&&a("div",e({className:G("".concat(Wn,"-content-container"),null===t&&"".concat(Wn,"-empty-content-container"),o&&"".concat(Wn,"-content-container-failed"))},{children:t}))]}))};if(_)return j("意图解析中");if(v)return j(i(l,{children:["意图解析失败",!!N&&S&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",N,"ms)"]}))]}),v,!0);if(m||0===h.length)return null;var Y=g||{},W=Y.modelId,V=Y.queryMode,U=Y.properties,H=Y.entity,X=Y.nativeQuery;Y.textInfo;var Z=null===(s=null===(d=null===(c=null==H?void 0:H.alias)||void 0===c?void 0:c[0])||void 0===d?void 0:d.split("."))||void 0===s?void 0:s[0],ee=function(n){var t,o="".concat(Wn,"-tip-item-value"),l=b||{},r=l.startDate,c=l.endDate,d=G("".concat(Wn,"-tip-item-option"),((t={})["".concat(Wn,"-mobile-tip-item-option")]=Ze,t));return i("div",e({className:"".concat(Wn,"-tip-item-filter-content")},{children:[!!b&&i("div",e({className:d},{children:[a("span",e({className:"".concat(Wn,"-tip-item-filter-name")},{children:"数据时间:"})),X?a("span",e({className:o},{children:r===c?r:"".concat(r," ~ ").concat(c)})):a(Xn,{value:[pe(r),pe(c)],onChange:E,format:"YYYY-MM-DD",renderExtraFooter:function(){return a(z,e({gutter:[28,28]},{children:Object.keys(Q).map((function(n){return a(D,{children:a(q,e({size:"small",onClick:function(){return M(Q[n])}},{children:n}))},n)}))}))}})]})),null==n?void 0:n.map((function(e,t){return a(Yn,{modelId:W,filters:n,filter:e,index:t,chatContext:g,entityAlias:Z,agentId:y,integrateSystem:I,onFiltersChange:T,onSwitchEntity:C},"".concat(e.name,"_").concat(t))}))]}))},ne=(U||{}).type,te=i("div",e({className:"".concat(Wn,"-tip")},{children:[Vn({parseInfo:g,dimensionFilters:x,entityInfo:w,onSwitchDataSet:function(n){var t;n.id!==(null===(t=null==g?void 0:g.dataSet)||void 0===t?void 0:t.id)&&(A([n.id]),setTimeout((function(){L(e(e({},g),{dataSet:n,dataSetIds:[n.id],id:(null==g?void 0:g.id)||0}))}),0))},availableDataSets:R,loadingDataSets:B}),!(ne&&"LLM_S2SQL"!==V)&&i(l,{children:[(!!b||!!(null==x?void 0:x.length))&&i("div",e({className:"".concat(Wn,"-tip-item")},{children:[a("div",e({className:"".concat(Wn,"-tip-item-name")},{children:"筛选条件:"})),a("div",e({className:"".concat(Wn,"-tip-item-content")},{children:ee(x)}))]})),i(q,e({className:"".concat(Wn,"-reload"),size:"small",onClick:function(){return L(g)}},{children:[a($,{}),"重新查询"]}))]})]}));return j(a("div",e({className:"".concat(Wn,"-title-bar")},{children:i("div",{children:["意图解析",!!N&&S&&i("span",e({className:"".concat(Wn,"-title-tip")},{children:["(耗时: ",N,"ms)"]}))]})})),"PLAIN_TEXT"===V?null:te)},Jn=function(n){var t=n.model,o=n.onApplyAuth,l="".concat(Ye,"-apply-auth");return i("div",e({className:l},{children:["暂无权限,",o?a("span",e({className:"".concat(l,"-apply"),onClick:function(){o(t)}},{children:"点击申请"})):"请联系管理员申请权限"]}))},$n=function(n){var t,o=n.model,l=n.chartType,r=n.onApplyAuth,c="".concat(Oe,"-no-permission-chart"),d=G("".concat(c,"-holder"),((t={})["".concat(c,"-bar-chart-holder")]="barChart"===l,t));return i("div",e({className:c},{children:[a("div",{className:d}),a("div",e({className:"".concat(c,"-no-permission")},{children:a(Jn,{model:o,onApplyAuth:r})}))]}))},Zn=function(n){var t=n.instanceRef,o=n.question,a=n.options;return{downloadChartAsImage:function(){var n=function(){if(t.current)return t.current.getConnectedDataURL(e({type:"png",pixelRatio:2,backgroundColor:"#fff",excludeComponents:["toolbox"]},a))}();n?(!function(e){var n=document.createElement("a");n.href=e,n.download="".concat(o,".png"),n.click()}(n),R.success("导出图片成功")):R.error("该条消息暂不支持导出图片")}}},et=function(n){var t,l=n.data,c=n.question,d=void 0===c?"":c,s=n.triggerResize,u=n.loading,m=n.metricField,_=n.onApplyAuth,p=h(),v=h(),g=l.queryColumns,x=l.queryResults,b=l.entityInfo,w=(null===(t=null==g?void 0:g.find((function(e){return"CATEGORY"===e.showType})))||void 0===t?void 0:t.bizName)||"",I=null==g?void 0:g.find((function(e){return"NUMBER"===e.showType}));null==I||I.bizName;if(f((function(){x&&x.length>0&&(null==I?void 0:I.authorized)&&function(){var e;v.current?e=v.current:(e=ye.init(p.current),v.current=e);var n=x||[],t=x[0]?Object.keys(x[0]).find((function(e){return e.toLowerCase().includes("date")||e.toLowerCase().includes("time")})):null,a=n;t&&(a=o([],n,!0).sort((function(e,n){return r(e[t]).diff(r(n[t]))})));var i,l=a.map((function(e){return void 0!==e[w]?e[w]:"未知"}));e.setOption({xAxis:{type:"category",axisTick:{show:!1},axisLine:{lineStyle:{color:Re}},axisLabel:{width:200,overflow:"truncate",showMaxLabel:!0,hideOverlap:!1,interval:0,color:"#333",rotate:30},data:l},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:"percent"===m.dataFormatType?Ve(e,m.dataFormatType,m.dataFormat):Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":"percent"===m.dataFormatType||"decimal"===m.dataFormatType?Ve(e.value,m.dataFormatType,m.dataFormat):Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"2%",right:"1%",bottom:"3%",top:20,containLabel:!0},series:{type:"bar",name:null==I?void 0:I.name,barWidth:20,itemStyle:{borderRadius:[10,10,0,0],color:new ye.graphic.LinearGradient(0,0,0,1,[{offset:0,color:qe},{offset:1,color:(i=qe,$e(i,80))}])},label:{show:!0,position:"top",formatter:function(e){var n=e.value;return 0===n?0:"percent"===m.dataFormatType?Ve(n,m.dataFormatType,m.dataFormat):Xe(n)}},data:a.map((function(e){return e[(null==I?void 0:I.bizName)||""]}))}}),e.resize()}()}),[x]),f((function(){s&&v.current&&v.current.resize()}),[s]),I&&!(null==I?void 0:I.authorized))return a($n,{model:(null==b?void 0:b.dataSetInfo.name)||"",chartType:"barChart",onApplyAuth:_});var N="".concat(Ye,"-bar"),S=Zn({instanceRef:v,question:d}).downloadChartAsImage;return(0,y(Nt).register)("downloadChartAsImage",S),i("div",{children:[a("div",e({className:"".concat(N,"-top-bar")},{children:a("div",e({className:"".concat(N,"-indicator-name")},{children:d}))})),a(M,e({spinning:u},{children:a("div",{className:"".concat(N,"-chart"),ref:p})}))]})},nt=function(n){var t,o=n.title,l=n.value,r="".concat(Ye,"-metric-card"),c=G("".concat(r,"-period-compare-item-value"),((t={})["".concat(r,"-period-compare-item-value-up")]=!l.includes("-"),t["".concat(r,"-period-compare-item-value-down")]=l.includes("-"),t));return i("div",e({className:"".concat(r,"-period-compare-item")},{children:[a("div",e({className:"".concat(r,"-period-compare-item-title")},{children:o})),i("div",e({className:c},{children:[a(rn,{type:l.includes("-")?"icon-xiajiang":"icon-shangsheng"}),a("div",{children:l})]}))]}))},tt=function(n){var t,o,l=n.data,r=n.question,c=n.loading,d=n.onApplyAuth,s=l.queryMode,u=l.queryColumns,m=l.queryResults,_=l.entityInfo,f=(l.aggregateInfo||{}).metricInfos,h=null==u?void 0:u.find((function(e){return"NUMBER"===e.showType})),v=(null==h?void 0:h.bizName)||"",g=h||{},y=g.dataFormatType,x=g.dataFormat,b=(null===(o=null==m?void 0:m[0])||void 0===o?void 0:o[v])||0,w="".concat(Ye,"-metric-card"),I=G(w,((t={})["".concat(Ye,"-metric-card-dsl")]="LLM_S2SQL"===s,t)),N=p(!1),S=N[0],C=N[1];return i("div",e({className:I},{children:[a("div",e({className:"".concat(w,"-top-bar")},{children:a("div",e({className:"".concat(w,"-indicator-name")},{children:r}))})),a(M,e({spinning:c},{children:i("div",e({className:"".concat(w,"-indicator")},{children:[h&&!(null==h?void 0:h.authorized)?a(Jn,{model:(null==_?void 0:_.dataSetInfo.name)||"",onApplyAuth:d}):i("div",e({style:{display:"flex",alignItems:"flex-end"}},{children:[a("div",e({className:"".concat(w,"-indicator-value")},{children:"string"==typeof b&&isNaN(+b)?b:"percent"===y||"decimal"===y?Ve(b,y,x):S?He(b)||"-":Ke(+b)})),!isNaN(+b)&&+b>=1e4&&a("div",e({className:"".concat(w,"-indicator-switch")},{children:a(Z,{onClick:function(){C(!S)}})}))]})),(null==f?void 0:f.length)>0&&a("div",e({className:"".concat(w,"-period-compare")},{children:Object.keys(f[0].statistics).map((function(e){return a(nt,{title:e,value:f[0].statistics[e]})}))}))]}))}))]}))},ot=function(n){var t,o=n.model,i=n.dateColumnName,l=n.categoryColumnName,c=n.metricField,s=n.resultList,u=n.triggerResize,m=n.onApplyAuth,_=n.chartType,p=h(),v=h(),g=function(){var n,t;v.current?(t=v.current).clear():(t=ye.init(p.current),v.current=t);var o=c.bizName,a=s.map((function(n){var t;return e(e({},n),((t={})[i]=Array.isArray(n[i])?r(n[i].join("")).format("MM-DD"):n[i],t))})),u=Je(a,l),m=function(e,n){var t=e.map((function(e){return r(e[n])}));return[r.min(t).format("YYYY-MM-DD"),r.max(t).format("YYYY-MM-DD")]}(a,i),f=m[0],h=m[1],g=Object.keys(u).reduce((function(n,t){return n[t]=f&&h&&(i.includes("date")||i.includes("month"))?function(n,t,o,a,i,l){var c=function(e,n,t){var o=[],a=n.diff(e,t||"days"),i="months"===t?"YYYY-MM":"YYYY-MM-DD";o.push(e.format(i));for(var l=1;l<=a;l++)o.push(e.add(1,t||"days").format(i));return o}(r(a),r(i),l),d=c.map((function(a){var i,c=n.find((function(e){return r(e[t]).format("months"===l?"YYYY-MM":"YYYY-MM-DD")===a}));return e(e({},c||{}),((i={})[t]=a,i[o]=c?c[o]:0,i))}));return d}(u[t],i,o,f,h,i.includes("month")?"months":"days"):u[t],n}),{}),y=Object.keys(g).sort((function(e,n){return g[n][g[n].length-1][o]-g[e][g[e].length-1][o]})),x=null===(n=g[y[0]])||void 0===n?void 0:n.map((function(e){var n=d(e[i])?e[i].join("-"):"".concat(e[i]);return 10===n.length?r(n).format("MM-DD"):n}));t.setOption({legend:l&&{left:0,top:0,icon:"rect",itemWidth:15,itemHeight:5,type:"scroll"},xAxis:{type:"category",axisTick:{alignWithLabel:!0,lineStyle:{color:Re}},axisLine:{lineStyle:{color:Re}},axisLabel:{showMaxLabel:!0,color:"#999"},data:x},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:"percent"===c.dataFormatType?Ve(e,c.dataFormatType,c.dataFormat):Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.sort((function(e,n){return n.value-e.value})).map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":"percent"===c.dataFormatType||"decimal"===c.dataFormatType?Ve(e.value,c.dataFormatType,c.dataFormat):Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"1%",right:"4%",bottom:"3%",top:l?45:20,containLabel:!0},series:y.slice(0,20).map((function(e,n){var t=g[e];return{type:_,name:l?e:c.name,symbol:"circle",showSymbol:1===t.length,smooth:!0,data:t.map((function(e){var n,t=e[o];return"percent"!==c.dataFormatType&&"decimal"!==c.dataFormatType||!(null===(n=c.dataFormat)||void 0===n?void 0:n.needMultiply100)?t:100*t})),color:Be[n]}}))}),t.resize()},x=Zn({instanceRef:v,question:c.name}).downloadChartAsImage;(0,y(Nt).register)("downloadChartAsImage",x),f((function(){c.authorized&&g()}),[s,c,_]),f((function(){u&&v.current&&v.current.resize()}),[u]);var b="".concat(Oe,"-metric-trend"),w=G("".concat(b,"-flow-trend-chart"),((t={})["".concat(b,"-flow-trend-chart-single")]=!l,t));return a("div",{children:c.authorized?a("div",{className:w,ref:p}):a($n,{model:o||"",onApplyAuth:m})})},at=function(n){var t=n.data,o=n.size,l=n.loading,c=n.question,d=n.onApplyAuth,s=t.entityInfo,u=t.queryColumns,m=t.queryResults,_="".concat(Oe,"-table"),p=u.map((function(n){var t=n.name,o=n.bizName,i=n.showType,l=n.dataFormatType,r=n.dataFormat,c=n.authorized;return{dataIndex:o,key:o,title:t||o,sorter:"NUMBER"===i?function(e,n){return e[o]-n[o]}:void 0,render:function(n){return c?"percent"===l?a("div",e({className:"".concat(_,"-formatted-value")},{children:"".concat(n?Ve(n,l,r):"0%")})):"NUMBER"===i?a("div",e({className:"".concat(_,"-formatted-value")},{children:Ge(n)})):o.includes("photo")?a("div",e({className:"".concat(_,"-photo")},{children:a("img",{width:40,height:40,src:n,alt:""})})):n:a(Jn,{model:(null==s?void 0:s.dataSetInfo.name)||"",onApplyAuth:d})}}})),f=u.find((function(e){return"DATE"===e.type||"DATE"===e.showType})),h=f?m.sort((function(e,n){return r(e[f.bizName]).diff(r(n[f.bizName]))})):m;return i("div",e({className:_},{children:[c&&a("div",e({className:"".concat(_,"-top-bar")},{children:a("div",e({className:"".concat(_,"-indicator-name")},{children:c}))})),a(S,{pagination:!(m.length<=10)&&{defaultPageSize:10,position:["bottomCenter"]},columns:p,dataSource:h,style:{width:"100%",overflowX:"auto",overflowY:"hidden"},rowClassName:function(e,n){return n%2!=0?"".concat(_,"-even-row"):""},size:o,loading:l})]}))},it=function(n){var t=n.aggregateInfo,o=n.currentMetricField,l=(t||{}).metricInfos,r=(null==l?void 0:l[0])||{}||{},c=r.date,d=r.value,s=r.statistics,u=o.dataFormatType,m=o.dataFormat,_="".concat(Ye,"-metric-info"),f=p(!1),h=f[0],v=f[1];return a("div",e({className:_},{children:i("div",e({className:"".concat(_,"-indicator")},{children:[i("div",e({style:{display:"flex",alignItems:"flex-end"}},{children:[a("div",e({className:"".concat(_,"-indicator-value")},{children:"percent"===u||"decimal"===u?Ve(d,u,m):h?He(d):Ke(+d)})),!isNaN(+d)&&+d>=1e4&&a("div",e({className:"".concat(_,"-indicator-switch")},{children:a(Z,{onClick:function(){v(!h)}})}))]})),i("div",e({className:"".concat(_,"-bottom-section")},{children:[i("div",e({className:"".concat(_,"-date")},{children:["最新数据日期:",a("span",e({className:"".concat(_,"-date-value")},{children:c}))]})),(null==l?void 0:l.length)>0&&a("div",e({className:"".concat(_,"-period-compare")},{children:Object.keys(s).map((function(e){return a(nt,{title:e,value:l[0].statistics[e]})}))}))]}))]}))}))},lt=function(n){var t,o=n.chatContext,r=n.currentDateOption,c=n.onSelectDateOption,d="".concat(Oe,"-date-options"),s=Fe[null===(t=null==o?void 0:o.dateInfo)||void 0===t?void 0:t.period]||Fe.DAY;return a("div",e({className:d},{children:s.map((function(n,t){var o,u=G("".concat(d,"-item"),((o={})["".concat(d,"-date-active")]=n.value===r,o["".concat(d,"-date-mobile")]=Ze,o));return i(l,{children:[i("div",e({className:u,onClick:function(){c(n.value)}},{children:[n.label,n.value===r&&a("div",{className:"".concat(d,"-active-identifier")})]}),n.value),t!==s.length-1&&a("div",{className:"".concat(d,"-item-divider")})]})}))}))},rt=function(e){var n=e.dateColumnName,t=e.metricFields,o=e.resultList,i=e.triggerResize,l=e.chartType,c=e.question,s=h(),u=h(),m=Zn({instanceRef:u,question:c}).downloadChartAsImage;(0,y(Nt).register)("downloadChartAsImage",m),f((function(){!function(){var e;u.current?(e=u.current).clear():(e=ye.init(s.current),u.current=e);var a=null==o?void 0:o.map((function(e){var t=d(e[n])?e[n].join("-"):"".concat(e[n]);return 10===t.length?r(t).format("MM-DD"):t}));e.setOption({legend:{left:0,top:0,icon:"rect",itemWidth:15,itemHeight:5,type:"scroll"},xAxis:{type:"category",axisTick:{alignWithLabel:!0,lineStyle:{color:Re}},axisLine:{lineStyle:{color:Re}},axisLabel:{showMaxLabel:!0,color:"#999"},data:a},yAxis:{type:"value",splitLine:{lineStyle:{opacity:.3}},axisLabel:{formatter:function(e){return 0===e?0:Xe(e)}}},tooltip:{trigger:"axis",formatter:function(e){var n=e[0],t=e.sort((function(e,n){return n.value-e.value})).map((function(e){return'<div style="margin-top: 3px;">'.concat(e.marker,' <span style="display: inline-block; width: 70px; margin-right: 12px;">').concat(e.seriesName,'</span><span style="display: inline-block; width: 90px; text-align: right; font-weight: 500;">').concat(""===e.value?"-":Xe(e.value),"</span></div>")})).join("");return"".concat(n.name,"<br />").concat(t)}},grid:{left:"1%",right:"4%",bottom:"3%",top:45,containLabel:!0},series:t.map((function(e,n){return{type:l,name:e.name,symbol:"circle",showSymbol:1===o.length,smooth:!0,data:o.map((function(n){var t,o=n[e.bizName];return"percent"!==e.dataFormatType&&"decimal"!==e.dataFormatType||!(null===(t=e.dataFormat)||void 0===t?void 0:t.needMultiply100)?o:100*o})),color:Be[n]}}))}),e.resize()}()}),[o,l]),f((function(){i&&u.current&&u.current.resize()}),[i]);var _="".concat(Oe,"-metric-trend");return a("div",{className:"".concat(_,"-flow-trend-chart"),ref:s})},ct=[{value:"line",label:"折线图"},{value:"bar",label:"柱状图"}],dt=function(n){var t,o,l=n.data,r=n.question,c=n.chartIndex,d=n.triggerResize,s=n.loading;n.activeMetricField;var u=n.drillDownDimension,m=n.currentDateOption,_=n.onApplyAuth,f=n.onSelectDateOption,h=l.queryColumns,v=l.queryResults,g=l.aggregateInfo,y=l.entityInfo,x=l.chatContext,b=p("line"),w=b[0],I=b[1],N=null==h?void 0:h.find((function(e){return"DATE"===e.showType||"DATE"===e.type})),S=(null==N?void 0:N.bizName)||"",C=(null===(t=null==h?void 0:h.find((function(e){return"CATEGORY"===e.showType})))||void 0===t?void 0:t.bizName)||"",E=null==h?void 0:h.filter((function(e){return"NUMBER"===e.showType})),L=null==h?void 0:h.find((function(e){return"NUMBER"===e.showType}));if(!L)return null;var A="".concat(Oe,"-metric-trend");return a("div",e({className:A},{children:i("div",e({className:"".concat(A,"-charts")},{children:[a("div",e({className:"".concat(A,"-top-bar")},{children:a("div",e({className:"".concat(A,"-metric-fields ").concat(A,"-metric-field-single")},{children:r}))})),a(M,e({spinning:s},{children:i("div",e({className:"".concat(A,"-content")},{children:[!Ze&&(null===(o=null==g?void 0:g.metricInfos)||void 0===o?void 0:o.length)>0&&void 0===u&&a(it,{aggregateInfo:g,currentMetricField:L}),i("div",e({className:"".concat(A,"-select-options")},{children:[a(lt,{chatContext:x,currentDateOption:m,onSelectDateOption:f}),a("div",{children:a(T,{defaultValue:"line",bordered:!1,options:ct,onChange:function(e){return I(e)}})})]})),1===(null==v?void 0:v.length)||c%2==1?a(at,{data:e(e({},l),{queryResults:v}),onApplyAuth:_}):E.length>1?a(rt,{dateColumnName:S,metricFields:E,question:r,resultList:v,triggerResize:d,chartType:w}):a(ot,{model:null==y?void 0:y.dataSetInfo.name,dateColumnName:S,categoryColumnName:C,metricField:L,resultList:v,triggerResize:d,onApplyAuth:_,chartType:w})]}))}))]}))}))},st=function(n){var t=n.columns,o=n.referenceColumn,l=n.dataSource,r=p(),c=r[0],d=r[1],s=p(!1),u=s[0],m=s[1],_=p([]),h=_[0],v=_[1],g="".concat(Oe,"-text");f((function(){!function(){var e=l[0][t[0].bizName];if(d(void 0===e?"暂无数据":e),o){var n=l[0][o.bizName];v(n||[])}}()}),[]);return i("div",e({style:{lineHeight:"24px",width:"fit-content",maxWidth:"100%",overflowX:"hidden"}},{children:[c,h.length>0&&i("span",e({className:"".concat(g,"-check-more"),onClick:function(){m(!u)}},{children:[u?"收起":"查看","更多",a(u?ee:X,{className:"".concat(g,"-arrow-icon")})]})),h.length>0&&u&&a("div",e({className:"".concat(g,"-reference-data")},{children:h.map((function(n){return i("div",e({className:"".concat(g,"-reference-item")},{children:[a("div",e({className:"".concat(g,"-reference-item-title")},{children:n.doc_title})),a("div",e({className:"".concat(g,"-reference-item-value")},{children:n.doc_chunk}))]}),n.doc_title)}))}))]}))},ut=function(n){var t=n.drillDownDimension,o=n.dimensions,l=n.isSecondDrillDown,r=n.onSelectDimension,c=n.onCancelDrillDown,d="".concat(Oe,"-drill-down-dimensions"),s=o.slice(0,5);return 0===s.length?null:i("div",e({className:"".concat(d,"-section")},{children:[i("div",e({className:"".concat(d,"-title")},{children:[l?"二级":"推荐","下钻维度:"]})),i("div",e({className:"".concat(d,"-content")},{children:[s.map((function(n,o){var l,c=G("".concat(d,"-content-item-name"),((l={})["".concat(d,"-content-item-active")]=(null==t?void 0:t.id)===n.id,l));return i("div",{children:[a("span",e({className:c,onClick:function(){r((null==t?void 0:t.id)===n.id?void 0:n)}},{children:n.name})),o!==s.length-1&&a("span",{children:"、"})]})})),o.length>5&&i("div",{children:[a("span",{children:"、"}),a(A,e({overlay:a(k,{children:o.slice(5).map((function(n){var o,i=G(((o={})["".concat(d,"-menu-item-active")]=(null==t?void 0:t.id)===n.id,o));return a(k.Item,{children:a("span",e({className:i,onClick:function(){r(n)}},{children:n.name}))},n.id)}))})},{children:i("span",{children:[a("span",e({className:"".concat(d,"-content-item-name")},{children:"更多"})),a(X,{className:"".concat(d,"-down-arrow")})]})}))]}),t&&i("div",e({className:"".concat(d,"-cancel-drill-down"),onClick:c},{children:["取消",l?"二级":"","下钻"]}))]}))]}))},mt=function(o){var l=o.drillDownDimensions,r=o.drillDownDimension,c=o.secondDrillDownDimension,d=o.originDimensions,s=o.dimensionFilters,u=o.onSelectDimension,m=o.onSelectSecondDimension,_=p([]),h=_[0],v=_[1],g="".concat(Oe,"-drill-down-dimensions");f((function(){n(void 0,void 0,void 0,(function(){return t(this,(function(e){return v(l.filter((function(e){return!((null==s?void 0:s.some((function(n){return n.name===e.name})))||d&&d.some((function(n){return n.id===e.id})))})).slice(0,20)),[2]}))}))}),[]);return i("div",e({className:g},{children:[a(ut,{drillDownDimension:r,dimensions:h,onSelectDimension:u,onCancelDrillDown:function(){u(void 0)}}),r&&h.length>1&&a(ut,{drillDownDimension:c,dimensions:h.filter((function(e){return e.id!==(null==r?void 0:r.id)})),isSecondDrillDown:!0,onSelectDimension:m,onCancelDrillDown:function(){m(void 0)}})]}))},_t=function(n){var t,o=n.metrics,l=n.defaultMetric,r=n.currentMetric,c=n.isMetricCard,d=n.onSelectMetric,s=Ze?2:5,u="".concat(Oe,"-metric-options"),m=o.filter((function(e){return e.id!==(null==l?void 0:l.id)})).slice(0,s),_=G("".concat(u,"-section"),((t={})["".concat(u,"-metric-card")]=c,t));return m.length?a("div",e({className:u},{children:i("div",e({className:_},{children:[a("div",e({className:"".concat(u,"-title")},{children:"推荐相关指标:"})),a("div",e({className:"".concat(u,"-content")},{children:m.map((function(n,t){var o,c=G("".concat(u,"-content-item-name"),((o={})["".concat(u,"-content-item-active")]=(null==r?void 0:r.id)===n.id,o));return i("div",{children:[a("span",e({className:c,onClick:function(){d((null==r?void 0:r.id)===n.id?l:n)}},{children:n.name})),t!==m.length-1&&a("span",{children:"、"})]})}))})),(null==r?void 0:r.id)!==(null==l?void 0:l.id)&&a("div",e({className:"".concat(u,"-cancel-select"),onClick:function(){d(l)}},{children:"取消"}))]}))})):null},pt=function(e){var n=e.data,t=e.metricField,i=e.categoryField,l=e.triggerResize,c=h(),d=h(),s=n.queryResults,u=(null==i?void 0:i.bizName)||"",m=(null==t?void 0:t.bizName)||"";return f((function(){s&&s.length>0&&function(){var e;d.current?e=d.current:(e=ye.init(c.current),d.current=e);var n=s||[],a=s[0]?Object.keys(s[0]).find((function(e){return e.toLowerCase().includes("date")||e.toLowerCase().includes("time")})):null,i=n;a&&(i=o([],n,!0).sort((function(e,n){return r(e[a]).diff(r(n[a]))})));var l=i.map((function(e,n){var t=e[m];return{name:void 0!==e[u]?e[u]:"未知",value:t,itemStyle:{color:Be[n%Be.length]}}}));e.setOption({tooltip:{trigger:"item",formatter:function(e){var n=e.value;return"".concat(e.name,": ").concat("percent"===t.dataFormatType?Ve(n,t.dataFormatType,t.dataFormat):Xe(n))}},legend:{orient:"vertical",left:"left",type:"scroll",data:l.map((function(e){return e.name})),selectedMode:!0,textStyle:{color:"#666"}},series:[{name:"占比",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:"14",fontWeight:"bold"}},labelLine:{show:!1},data:l}]}),e.resize()}()}),[s,t,i]),f((function(){l&&d.current&&d.current.resize()}),[l]),a("div",{className:"".concat(Ye,"-pie-chart"),ref:c})},ft=[{value:"pie",label:"饼图"},{value:"bar",label:"柱状图"}],ht=function(n){var t,o=n.data,l=n.question,r=n.triggerResize,c=n.loading,d=n.metricField,s=n.categoryField,u=n.onApplyAuth,m=p("pie"),_=m[0],f=m[1],h=o.entityInfo;if(d&&!(null==d?void 0:d.authorized))return a($n,{model:(null===(t=null==h?void 0:h.dataSetInfo)||void 0===t?void 0:t.name)||"",chartType:"pieChart",onApplyAuth:u});var v="".concat(Ye,"-pie");return i("div",e({className:v},{children:[a("div",e({className:"".concat(v,"-metric-fields ").concat(v,"-metric-field-single")},{children:l})),a("div",e({className:"".concat(v,"-select-options")},{children:a(T,{defaultValue:"pie",bordered:!1,options:ft,onChange:function(e){return f(e)}})})),"pie"===_?a(pt,{data:o,metricField:d,categoryField:s,triggerResize:r}):a(et,{data:o,triggerResize:r,loading:c,metricField:d,onApplyAuth:u})]}))},vt=function(l){var r,c,d,s,u=l.queryId,m=l.question,_=l.data,h=l.chartIndex,v=l.triggerResize,g=l.forceShowTable,y=void 0!==g&&g,x=l.isSimpleMode,b=l.onMsgContentTypeChange,w=_||{},I=w.queryColumns,N=w.queryResults,S=w.chatContext,C=w.queryMode,T=S||{},E=T.dimensionFilters,L=T.elementMatches,M=p([]),A=M[0],k=M[1],z=p(),D=z[0],q=z[1],R=p(N),O=R[0],F=R[1],B=p(),P=B[0],Q=B[1],j=p(),Y=j[0],W=j[1],V=p(!1),U=V[0],H=V[1],X=p(),K=X[0],J=X[1],$=p(),Z=$[0],ee=$[1],ne=p(),te=ne[0],oe=ne[1],ae=p(),ie=ae[0],le=ae[1],re="".concat(Ye,"-chat-msg"),ce=function(e){var n=e.find((function(e){return"more"===e.showType}));q(n),k(e.filter((function(e){return"more"!==e.showType})))};f((function(){var e,n,t,o;ce(I),F(N),J(null===(e=null==S?void 0:S.metrics)||void 0===e?void 0:e[0]),ee(null===(n=null==S?void 0:S.metrics)||void 0===n?void 0:n[0]),oe(null===(t=null==S?void 0:S.dateInfo)||void 0===t?void 0:t.dateMode),le(null===(o=null==S?void 0:S.dateInfo)||void 0===o?void 0:o.unit),Q(void 0),W(void 0)}),[_]);var de=A.filter((function(e){return"NUMBER"===e.showType})),se=function(){var e=1===O.length,n=A.find((function(e){return"DATE"===e.showType||"DATE"===e.type})),t=A.filter((function(e){return"CATEGORY"===e.showType})),o=A.filter((function(e){return"NUMBER"===e.showType}));if(A){if(x)return Qe.MARKDOWN;if(y)return Qe.TABLE;var a="LLM_S2SQL"===C&&e&&1===o.length&&1===A.length,i=(C.includes("METRIC")||a)&&e,l=!(null==I?void 0:I.length);return l?Qe.TEXT:i?Qe.METRIC_CARD:l||i||!(t.length>1||"TAG_DETAIL"===C||"ENTITY_DIMENSION"===C||1===(null==O?void 0:O.length)||1===t.length&&0===o.length)?n&&o.length>0&&t.length<=1&&!(o.length>1&&t.length>0)&&O.some((function(e){return e[n.bizName]!==O[0][n.bizName]}))?Qe.METRIC_TREND:t.length>0&&1===(null==o?void 0:o.length)&&(Ze?(null==O?void 0:O.length)<=5:(null==O?void 0:O.length)<=10)&&O.every((function(e){return e[o[0].bizName]>=0}))?Qe.METRIC_PIE:(null==t?void 0:t.length)>0&&1===(null==o?void 0:o.length)&&(Ze?(null==O?void 0:O.length)<=5:(null==O?void 0:O.length)<=50)&&O.every((function(e){return isFinite(Number(e[o[0].bizName]))}))?Qe.METRIC_BAR:Qe.TABLE:Qe.TABLE}};if(f((function(){var e=se();e&&(null==b||b(e))}),[_,A,x]),!I||!N||!A)return null;var ue=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i;return t(this,(function(t){switch(t.label){case 0:return H(!0),[4,zn(e(e(e({},S),o),{queryId:u,parseId:S.id}))];case 1:return n=t.sent(),H(!1),200===n.code&&(ce((null===(a=n.data)||void 0===a?void 0:a.queryColumns)||[]),F((null===(i=n.data)||void 0===i?void 0:i.queryResults)||[])),[2]}}))}))},me=function(n){le(n),oe("RECENT"),ue({metrics:[Z||K],dimensions:P?o(o([],S.dimensions||[],!0),[P],!1):S.dimensions,dateInfo:e(e({},null==S?void 0:S.dateInfo),{dateMode:"RECENT",unit:n})})},_e=G(((r={})[re]=![Qe.TABLE,Qe.MARKDOWN].includes(se()),r)),pe=(null==E?void 0:E.length)>0?E[0].value:void 0,fe=null===(d=null===(c=null==L?void 0:L.find((function(e){var n;return"ID"===(null===(n=e.element)||void 0===n?void 0:n.type)})))||void 0===c?void 0:c.element)||void 0===d?void 0:d.name,he=("TAG_LIST_FILTER"===C||"METRIC_TAG"===C)&&"string"==typeof pe&&void 0!==fe,ve=(C.includes("METRIC")||"LLM_S2SQL"===C)&&se()!==Qe.TEXT&&!he,ge=null===(s=null==S?void 0:S.metrics)||void 0===s?void 0:s.filter((function(e){return I.every((function(n){return n.bizName!==e.bizName}))})),ye=(C.includes("METRIC")||"LLM_S2SQL"===C)&&(null==ge?void 0:ge.length)>0&&1===(null==I?void 0:I.filter((function(e){return"NUMBER"===e.showType})).length),xe=se(),be=xe?function(e){var n,t;return Ze?{maxWidth:"calc(100vw - 20px)"}:(null==N?void 0:N.length)&&I.length?e===Qe.METRIC_BAR?((n={})[N.length>5?"width":"minWidth"]=150*N.length,n):e===Qe.TABLE?((t={})[I.length>5?"width":"minWidth"]=150*I.length,t):e===Qe.METRIC_TREND||e===Qe.METRIC_PIE?{width:"calc(100vw - 410px)"}:void 0:void 0}(xe):void 0;return a("div",e({className:_e,style:be},{children:0===(null==O?void 0:O.length)?a("div",{children:"暂无数据"}):i("div",{children:[function(){switch(se()){case Qe.TEXT:return a(st,{columns:A,referenceColumn:D,dataSource:O});case Qe.METRIC_CARD:return a(tt,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,loading:U});case Qe.TABLE:return a(at,{question:m,data:e(e({},_),{queryColumns:A,queryResults:O}),loading:U});case Qe.METRIC_TREND:return a(dt,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,loading:U,chartIndex:h,triggerResize:v,activeMetricField:Z,drillDownDimension:P,currentDateOption:ie,onSelectDateOption:me});case Qe.METRIC_BAR:return a(et,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,triggerResize:v,loading:U,metricField:de[0]});case Qe.METRIC_PIE:var n=A.find((function(e){return"CATEGORY"===e.showType}));return a(ht,{data:e(e({},_),{queryColumns:A,queryResults:O}),question:m,triggerResize:v,loading:U,metricField:de[0],categoryField:n});case Qe.MARKDOWN:return a("div",e({style:{maxHeight:800}},{children:a(Un,{markdown:_.textResult,loading:U})}));default:return a(at,{question:m,data:e(e({},_),{queryColumns:A,queryResults:O}),loading:U})}}(),(ye||ve)&&!x&&i("div",e({className:"".concat(re,"-bottom-tools ").concat(se()===Qe.METRIC_CARD?"".concat(re,"-metric-card-tools"):""," ").concat(Ze?"mobile":"")},{children:[ye&&a(_t,{metrics:S.metrics,defaultMetric:K,currentMetric:Z,onSelectMetric:function(n){var t;ee(n),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(t=S.dateInfo)||void 0===t?void 0:t.unit)}),dimensions:P?o(o([],S.dimensions||[],!0),[P],!1):S.dimensions,metrics:[n||K]})}}),ve&&a(mt,{drillDownDimensions:(null==_?void 0:_.recommendedDimensions)||[],drillDownDimension:P,secondDrillDownDimension:Y,originDimensions:S.dimensions,dimensionFilters:S.dimensionFilters,onSelectDimension:function(a){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){return H(!0),Q(a),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(n=S.dateInfo)||void 0===n?void 0:n.unit)}),dimensions:a?o(o([],S.dimensions||[],!0),[a],!1):S.dimensions,metrics:[Z||K]}),[2]}))}))},onSelectSecondDimension:function(n){var t;W(n),ue({dateInfo:e(e({},S.dateInfo),{dateMode:te,unit:ie||(null===(t=S.dateInfo)||void 0===t?void 0:t.unit)}),dimensions:o(o(o([],S.dimensions||[],!0),P?[P]:[],!0),n?[n]:[],!0),metrics:[Z||K]})}})]}))]})}))},gt=800,yt=function(e){var n=e.id,t=e.data,o=p(""),i=o[0],l=o[1],r=p(gt),c=r[0],d=r[1],s=t.response||{},u=s.name,m=s.webPage,_=m.url,h=m.params,v=g((function(e){var t=e.data,o=t.type,a=t.payload;if("changeMiniProgramContainerSize"!==o)if("storyResize"!==t);else{var i=document.getElementById("reportIframe_".concat(n)),l=i.contentDocument||i.document||i.contentWindow;setTimeout((function(){d("production"===process.env.NODE_ENV?function(e){var n,t=e.getElementById("titleArea"),o=Math.max((null==t?void 0:t.clientHeight)||0,(null==t?void 0:t.scrollHeight)||0),a=null===(n=e.getElementsByClassName("dashboardGrid"))||void 0===n?void 0:n[0],i=Math.max((null==a?void 0:a.clientHeight)||0,(null==a?void 0:a.scrollHeight)||0);return Math.max(o+i+10,gt)}(l):gt)}),200)}else{var r=a.msgId,c=a.height;"".concat(r)==="".concat(n)&&d(c)}}),[]);f((function(){return window.addEventListener("message",v),function(){window.removeEventListener("message",v)}}),[v]);return f((function(){!function(){var e,n=(null===(e=null==h?void 0:h.find((function(e){return"FORWARD"===e.paramType&&"height"===e.key})))||void 0===e?void 0:e.value)||gt;d(n);var t=_,o=(h||[]).filter((function(e){return"FORWARD"!==e.paramType})).reduce((function(e,n){return e[n.key]=n.value,e}),{});if(t.includes("?type=dashboard")||t.includes("?type=widget")){var a=encodeURIComponent(JSON.stringify(t.includes("dashboard")?{global:o}:{local:o}));t=t.replace("?","?token=".concat(nn(),"&miniProgram=true&reportName=").concat(u,"&filterData=").concat(a,"&")),t="".concat("").concat(t)}else{var i=Object.keys(o||{}).map((function(e){return"".concat(e,"=").concat(o[e])}));i.length>0&&(t=_.includes("?")?t.replace("?","?".concat(i.join("&"),"&")):"".concat(t,"?").concat(i.join("&")))}l(t)}()}),[]),a("iframe",{id:"reportIframe_".concat(n),name:"reportIframe_".concat(n),src:i,style:{width:Ze?"calc(100vw - 20px)":"calc(100vw - 410px)",height:c,border:"none"},title:"reportIframe",allowFullScreen:!0})},xt=function(n){var t,o=n.queryId,r=n.parseId,c=n.question,d=n.queryMode,s=n.executeLoading,u=n.entitySwitchLoading,m=void 0!==u&&u,_=n.chartIndex,h=n.executeTip,v=n.executeErrorMsg,g=n.executeItemNode,y=n.renderCustomExecuteNode,x=n.data,b=n.triggerResize,w=n.isDeveloper,I=n.isSimpleMode,N=n.enableStreamingSummary;n.onStreamingSummaryUpdate;var S=n.agentId;n.dataSetIds;var C="".concat(Ye,"-item"),T=p(!1),E=T[0],L=T[1],A=p(),k=A[0],z=A[1],D=p(!1),q=D[0],R=D[1],B=p(!1);B[0],B[1];var P=p("");P[0],P[1];var Q="PLAIN_TEXT"===d||"WEB_SERVICE"===d?"问答":"数据",j=function(n,t){return i(l,{children:[i("div",e({className:"".concat(C,"-title-bar")},{children:[a(K,{className:"".concat(C,"-step-icon")}),i("div",e({className:"".concat(C,"-step-title")},{children:[n,!t&&a(Pn,{})]}))]})),t&&a("div",e({className:"".concat(C,"-content-container")},{children:t}))]})};if(f((function(){}),[N,o,r,S]),s)return j("".concat(Q,"查询中"));if(h)return j(i(l,{children:[i("span",{children:[Q,"查询失败"]}),v&&i(O,{children:[a(ne,{style:{marginLeft:5,color:"red"}}),a("a",e({onClick:function(){R(!q)}},{children:q?"收起":"查看"}))]}),!!(null==x?void 0:x.queryTimeCost)&&w&&i("span",e({className:"".concat(C,"-title-tip")},{children:["(耗时: ",x.queryTimeCost,"ms)"]}))]}),a(l,{children:q&&a(xe,e({className:"".concat(C,"-code"),language:"sql",style:be},{children:v}))}));if(!x)return null;return i(l,{children:[!I&&i("div",e({className:"".concat(C,"-title-bar")},{children:[a(K,{className:"".concat(C,"-step-icon")}),i("div",e({className:"".concat(C,"-step-title ").concat(C,"-execute-title-bar"),style:{width:"100%"}},{children:[i("div",{children:[Q,"查询",!!(null==x?void 0:x.queryTimeCost)&&w&&i("span",e({className:"".concat(C,"-title-tip")},{children:["(耗时: ",x.queryTimeCost,"ms)"]}))]}),a("div",{children:[Qe.METRIC_TREND,Qe.METRIC_BAR,Qe.METRIC_PIE].includes(k)&&a(F,{checkedChildren:"表格",unCheckedChildren:"表格",onChange:function(e){L(e)}})})]}))]})),a("div",e({className:"".concat(C,"-content-container ").concat(I?"".concat(C,"-content-container-simple"):""),style:{borderLeft:"PLAIN_TEXT"===d?"none":void 0}},{children:i(M,e({spinning:m},{children:[(null===(t=x.queryAuthorization)||void 0===t?void 0:t.message)&&i("div",e({className:"".concat(C,"-auth-tip")},{children:["提示:",x.queryAuthorization.message]})),x.textSummary?a("div",e({className:"".concat(C,"-summary")},{children:a(ge,{children:x.textSummary})})):null,y&&g?g:"PLAIN_TEXT"===(null==x?void 0:x.queryMode)||"WEB_SERVICE"===(null==x?void 0:x.queryMode)?null==x?void 0:x.textResult:"WEB_PAGE"===(null==x?void 0:x.queryMode)?a(yt,{id:o,data:x}):a(vt,{isSimpleMode:I,forceShowTable:E,queryId:o,question:c,data:x,chartIndex:_,triggerResize:b,onMsgContentTypeChange:z})]}))}))]})},bt=function(n){var t,o,r=n.queryId,c=n.scoreValue,d=n.isLastMessage,s=n.isParserError,u=void 0!==s&&s,m=n.isSimpleMode,_=void 0!==m&&m,f=n.onExportData,h=n.onReExecute,v=p(c||0),g=v[0],x=v[1],b=p(!1),w=b[0],I=b[1],N="".concat(Oe,"-tools"),S=G("".concat(N,"-like"),((t={})["".concat(N,"-feedback-active")]=5===g,t)),C=G("".concat(N,"-dislike"),((o={})["".concat(N,"-feedback-active")]=1===g,o)),T=y(Nt).call;return a("div",e({className:N},{children:!Ze&&i("div",e({className:"".concat(N,"-feedback")},{children:[a("div",e({className:"".concat(N,"-feedback-left")},{children:!u&&i(l,{children:[i(q,e({size:"small",onClick:function(){I(!0),null==f||f(),setTimeout((function(){I(!1)}),1e3)},type:"text",loading:w},{children:[a(te,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"导出数据"}))]})),!_&&i(q,e({size:"small",onClick:function(){T("downloadChartAsImage")},type:"text"},{children:[a(oe,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"导出图片"}))]})),d&&i(q,e({size:"small",onClick:function(){null==h||h(r)},type:"text"},{children:[a(ae,{}),a("span",e({className:"".concat(N,"-font-style")},{children:"再试一次"}))]}))]})})),i("div",e({className:"".concat(N,"-feedback-left")},{children:[a(ie,{className:S,onClick:function(){x(5),On(r,5)},style:{marginRight:10}}),a(le,{className:C,onClick:function(e){e.stopPropagation(),x(1),On(r,1)}})]}))]}))}))},wt=function(n){var t,o,r,c=n.agentId,d=n.queryId,s=n.question,u=n.llmReq,m=n.llmResp,_=n.integrateSystem,h=n.queryMode,v=n.sqlInfo,g=n.sqlTimeCost,y=n.executeErrorMsg,x=n.dataSetIds,b=p(""),w=b[0],I=b[1];f((function(){I((function(e){return e&&!v[e]?v.querySQL?"querySQL":v.correctedQuerySQL?"correctedQuerySQL":v.correctedS2SQL?"correctedS2SQL":v.parsedS2SQL?"parsedS2SQL":"":!e&&v.querySQL?"querySQL":e}))}),[v]),f((function(){I(""),setTimeout((function(){v.querySQL?I("querySQL"):v.correctedQuerySQL?I("correctedQuerySQL"):v.correctedS2SQL?I("correctedS2SQL"):v.parsedS2SQL&&I("parsedS2SQL")}),100)}),[x]);var N="".concat(Ye,"-item"),S="".concat(Ye,"-sql-item");if(!(u||v.parsedS2SQL||v.correctedS2SQL||v.querySQL))return null;var C=u||{},T=C.schema,E=C.terms,L=C.priorExts,M=(null===(t=Object.values((null==m?void 0:m.sqlRespMap)||{})[0])||void 0===t?void 0:t.fewShots)||[];return i("div",e({className:"".concat(N,"-parse-tip")},{children:[i("div",e({className:"".concat(N,"-title-bar")},{children:[a(K,{className:"".concat(N,"-step-icon")}),i("div",e({className:"".concat(N,"-step-title")},{children:["SQL生成",!!g&&i("span",e({className:"".concat(N,"-title-tip")},{children:["(耗时: ",g,"ms)"]})),":",w&&a("span",e({className:"".concat(S,"-toggle-expand-btn"),onClick:function(){I("")}},{children:a(ee,{})}))]})),i("div",e({className:"".concat(N,"-content-options")},{children:[u&&a("div",e({className:"".concat(N,"-content-option ").concat("schemaMap"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("schemaMap"===w?"":"schemaMap")}},{children:"Schema映射"})),M.length>0&&a("div",e({className:"".concat(N,"-content-option ").concat("fewShots"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("fewShots"===w?"":"fewShots")}},{children:"Few-shot示例"})),v.parsedS2SQL&&i("div",e({className:"".concat(N,"-content-option ").concat("parsedS2SQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("parsedS2SQL"===w?"":"parsedS2SQL")}},{children:["LLM_S2SQL"===h||"PLAIN_TEXT"===h?"LLM":"Rule","解析S2SQL"]})),v.correctedS2SQL&&a("div",e({className:"".concat(N,"-content-option ").concat("correctedS2SQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("correctedS2SQL"===w?"":"correctedS2SQL")}},{children:"修正S2SQL"})),v.correctedQuerySQL&&a("div",e({className:"".concat(N,"-content-option ").concat("correctedQuerySQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("correctedQuerySQL"===w?"":"correctedQuerySQL")}},{children:"物理SQL修正"})),v.querySQL&&a("div",e({className:"".concat(N,"-content-option ").concat("querySQL"===w?"".concat(N,"-content-option-active"):""),onClick:function(){I("querySQL"===w?"":"querySQL")}},{children:(v.correctedQuerySQL,"最终执行SQL")})),i(q,e({className:"".concat(S,"-export-log"),size:"small",onClick:function(){var e="";s&&(e+="\n问题:".concat(s,"\n")),u&&(e+=function(){var e,n;return"\nSchema映射\n".concat((null===(e=null==T?void 0:T.fieldNameList)||void 0===e?void 0:e.length)>0?"名称:".concat(T.fieldNameList.join("、")):"").concat((null===(n=null==T?void 0:T.values)||void 0===n?void 0:n.length)>0?"\n取值:".concat(T.values.map((function(e){return"".concat(e.fieldName,": ").concat(e.fieldValue)})).join("、")):"").concat(L?"\n附加:".concat(L):"").concat((null==E?void 0:E.length)>0?"\n术语:".concat(E.map((function(e){var n;return"".concat(e.name).concat((null===(n=e.alias)||void 0===n?void 0:n.length)>0?"(".concat(e.alias.join(","),")"):"",": ").concat(e.description)})).join("、")):"","\n\n")}()),M.length>0&&(e+="\nFew-shot示例".concat(M.map((function(e,n){return"\n\n示例".concat(n+1,":\n问题:").concat(e.question,"\nSQL:\n").concat(we(e.sql),"\n")})).join(""),"\n")),v.parsedS2SQL&&(e+="\n".concat("LLM_S2SQL"===h||"PLAIN_TEXT"===h?"LLM":"Rule","解析S2SQL\n\n").concat(we(v.parsedS2SQL),"\n")),v.correctedS2SQL&&(e+="\n修正S2SQL\n\n".concat(we(v.correctedS2SQL),"\n")),v.correctedQuerySQL&&(e+="\n物理SQL修正\n\n".concat(we(v.correctedQuerySQL||""),"\n")),v.querySQL&&(e+="\n最终执行SQL\n\n".concat(we(v.querySQL),"\n")),y&&(e+="\n异常日志\n\n".concat(y,"\n")),function(e,n,t){void 0===t&&(t="text/plain");var o=new Blob([e],{type:t}),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}(e,"supersonic-debug-".concat(c,"-").concat(d,".log"))}},{children:[a(te,{}),"导出日志"]}))]}))]})),i("div",e({className:"".concat(S," ").concat(!window.location.pathname.includes("/chat")&&_&&"wiki"!==_?"".concat(S,"-copilot"):"")},{children:["schemaMap"===w&&i("div",e({className:"".concat(S,"-code")},{children:[(null===(o=null==T?void 0:T.fieldNameList)||void 0===o?void 0:o.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"名称:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:T.fieldNameList.join("、")}))]})),(null===(r=null==T?void 0:T.values)||void 0===r?void 0:r.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"取值:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:T.values.map((function(e){return"".concat(e.fieldName,": ").concat(e.fieldValue)})).join("、")}))]})),L&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"附加:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:L}))]})),(null==E?void 0:E.length)>0&&i("div",e({className:"".concat(S,"-schema-row")},{children:[a("div",e({className:"".concat(S,"-schema-title")},{children:"术语:"})),a("div",e({className:"".concat(S,"-schema-content")},{children:E.map((function(e){var n;return"".concat(e.name).concat((null===(n=e.alias)||void 0===n?void 0:n.length)>0?"(".concat(e.alias.join(","),")"):"",": ").concat(e.description)})).join("、")}))]}))]})),"fewShots"===w&&a("div",e({className:"".concat(S,"-code")},{children:M.map((function(n,t){return i("div",e({className:"".concat(S,"-few-shot-item")},{children:[i("div",e({className:"".concat(S,"-few-shot-title")},{children:["示例",t+1,":"]})),i("div",e({className:"".concat(S,"-few-shot-content")},{children:[i("div",e({className:"".concat(S,"-few-shot-content-item")},{children:[a("div",e({className:"".concat(S,"-few-shot-content-title")},{children:"问题:"})),a("div",e({className:"".concat(S,"-few-shot-content-text")},{children:n.question}))]})),i("div",e({className:"".concat(S,"-few-shot-content-item")},{children:[a("div",e({className:"".concat(S,"-few-shot-content-title")},{children:"SQL:"})),a("div",e({className:"".concat(S,"-few-shot-content-text")},{children:a(xe,e({className:"".concat(S,"-few-shot-code"),language:"sql",style:be},{children:n.sql}))}))]}))]}))]}),t)}))})),w&&v[w]&&i(l,{children:[a(xe,e({className:"".concat(S,"-code"),language:"sql",style:be},{children:we(v[w])})),a(Ie,e({text:we(v[w]),onCopy:function(e,n){return function(e,n){n?R.success("复制SQL成功",1):R.error("复制SQL失败",1)}(0,n)}},{children:a("button",e({className:"".concat(S,"-copy-btn")},{children:"复制代码"}))}))]})]}))]}))},It=function(o){var r=o.queryId,c=o.similarQueries,d=o.defaultExpanded,s=o.onSelectQuestion,u=p(c||[]),m=u[0],_=u[1],h=p(d||!1),v=h[0],g=h[1],y=p(!1),x=y[0],b=y[1],w="".concat(Ye,"-item"),I="".concat(Ye,"-similar-questions");f((function(){v&&0===(null==m?void 0:m.length)&&r&&n(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return b(!0),[4,Dn(r)];case 1:return e=t.sent(),b(!1),_((null===(n=e.data)||void 0===n?void 0:n.similarQueries)||[]),[2]}}))}))}),[v,r]);return i("div",e({className:"".concat(w,"-parse-tip")},{children:[i("div",e({className:"".concat(w,"-title-bar")},{children:[a(K,{className:"".concat(w,"-step-icon")}),i("div",e({className:"".concat(w,"-step-title")},{children:["推荐相似问题",a("span",e({className:"".concat(I,"-toggle-expand-btn"),onClick:function(){g(!v)}},{children:a(x?re:v?ee:X,{})}))]}))]})),a("div",e({className:I},{children:v&&a("div",e({className:"".concat(I,"-content")},{children:Array.isArray(m)&&m.length>0?null==m?void 0:m.slice(0,5).map((function(n,t){return i("div",e({className:"".concat(I,"-question"),onClick:function(){s(n)}},{children:[t+1,". ",n.queryText]}),n.queryText)})):a(l,{children:"暂无推荐"})}))}))]}))},Nt=x({register:function(){},call:function(){}}),St=function(o){var r,c,d,s,u=o.msg,m=o.conversationId,_=o.questionId,v=o.modelId,y=o.agentId,x=o.score,b=o.filter,w=o.triggerResize,I=o.parseInfos,N=o.parseTimeCostValue,S=o.msgData,C=o.isDeveloper,T=o.integrateSystem,E=o.executeItemNode,L=o.renderCustomExecuteNode,A=o.isSimpleMode,k=o.currentAgent,z=o.isDebugMode,D=o.isLastMessage,q=o.onMsgDataLoaded,O=o.onUpdateMessageScroll,F=o.onSendMsg,B=p(!1),P=B[0],Q=B[1],j=p(),Y=j[0],W=j[1],V=p(),U=V[0],H=V[1],X=p([]),K=X[0],J=X[1],$=p([]),Z=$[0],ee=$[1],ne=p(""),te=ne[0],oe=ne[1],ae=p(!1),ie=ae[0],le=ae[1],re=p(!1),ce=re[0],de=re[1],se=p(!1),ue=se[0],me=se[1],_e=p(!1),fe=_e[0],he=_e[1],ve=p(""),ge=ve[0],ye=ve[1],xe=p(""),be=xe[0],we=xe[1],Ie=p(),Ne=Ie[0],Se=Ie[1],Ce=p(!1),Te=Ce[0],Ee=Ce[1],Le=p([]),Me=Le[0],ke=Le[1],ze=p({}),De=ze[0],qe=ze[1],Re=p({}),Oe=Re[0],Fe=Re[1],Be=p({}),Qe=Be[0],je=Be[1],We=p(!1),Ve=We[0],Ue=We[1],Ge=p([]),He=Ge[0],Xe=Ge[1],Ke=p("");Ke[0];var Je=Ke[1],$e="".concat(Ye,"-item"),en=function(e){var n;if(!e)return"";var t=e.id||"",o=e.dataSetIds||[],a=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||"";if(0===o.length&&!a)return"".concat(t,"_no_dataset");var i=o.sort().join("_"),l=a?"_".concat(a):"";return"".concat(t,"_").concat(i).concat(l)},nn=function(n){var t,o="",a=void 0,i=n.data||{},l=i.queryColumns,r=i.queryResults,c=i.queryState,d=i.queryMode,s=i.response,u=i.chatContext,m=i.errorMsg;if(we(m),400===n.code||401===n.code||412===n.code?o=n.msg:200!==n.code?o=Pe:"SUCCESS"!==c?o=s&&"string"==typeof s?s:Pe:(l&&l.length>0&&r||"WEB_PAGE"===d||"WEB_SERVICE"===d||"PLAIN_TEXT"===d)&&(a=n.data,o=""),u){var _=en(u);je(e(e({},Qe),((t={})[_]={tip:o,data:a},t)))}return a?(Se(a),ye(""),!0):(ye(o||Pe),!1)},tn=function(o,a,i,l){return void 0===l&&(l=!1),n(void 0,void 0,void 0,(function(){var n,r,c,d,s,_,p,f,h,v;return t(this,(function(t){switch(t.label){case 0:le(!0),i?Ee(!0):he(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),n=He.length>0?He:o.dataSetIds||((null===(v=o.dataSet)||void 0===v?void 0:v.id)?[o.dataSet.id]:void 0),r=(null==U?void 0:U.dataSetIds)||[],c=n||[],JSON.stringify(r.sort())!==JSON.stringify(c.sort())&&(Se(void 0),ye("")),d=e(e({},o),{dataSetIds:n}),[4,An(u,m,d,y)];case 2:return s=t.sent(),_=nn(s),H(d),null==q||q(e(e({},s.data),{parseInfos:a,queryId:o.queryId}),_,l),[3,4];case 3:return t.sent(),p=Pe,ye(Pe),f=en(o),je(e(e({},Qe),((h={})[f]={tip:p},h))),[3,4];case 4:return i?Ee(!1):he(!1),[2]}}))}))},on=function(e){ke(e.sort((function(e,n){return e.name<n.name?-1:e.name>n.name?1:0})))},an=function(){return n(void 0,void 0,void 0,(function(){var n,o,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I;return t(this,(function(t){switch(t.label){case 0:return Q(!0),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,dataSetIds:He.length>0?He:void 0})];case 1:return n=t.sent(),Q(!1),a=(o=n||{}).code,i=o.data,r=(l=i||{}).state,c=l.selectedParses,d=l.candidateParses,s=l.queryId,_=l.parseTimeCost,p=l.errorMsg,f=(null==c?void 0:c.concat(d||[]))||[],200===a&&r!==Ae.FAILED&&f.length&&((null===(w=null===(x=f[0])||void 0===x?void 0:x.properties)||void 0===w?void 0:w.type)||(null===(I=f[0])||void 0===I?void 0:I.queryMode))?(null==O||O(),(h=f.slice(0,5).map((function(n){return e(e({},n),{queryId:s})}))).length>1&&(ee(h),me(!0),de(!0)),J(h||[]),g=h[0],1===(null==k?void 0:k.enableFeedback)&&h.length>1||H(g),W(_),Fe(g.entityInfo||{}),on((null==g?void 0:g.dimensionFilters)||[]),qe(null==g?void 0:g.dateInfo),1===h.length&&tn(g,h),[2]):(oe(r===Ae.FAILED&&p?p:"智能助理不太懂您说什么呐,回去一定补充知识"),H({queryId:s}),[2])}}))}))},cn=function(n,t){if(t){var o=I&&I.length>0?I.map((function(n){return e(e({},n),{queryId:t.queryId})})):[e(e({},t.chatContext),{queryId:t.queryId})],a=o[0];J(o),H(a),W(N),on(a.dimensionFilters||[]),qe(a.dateInfo),le(!0),nn({code:200,data:t,msg:"success"})}else n&&an()};f((function(){void 0!==Ne||""!==ge||P||cn(u,S)}),[u,S]);var dn=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return Ee(!0),[4,kn(o,null===(s=null==Ne?void 0:Ne.chatContext)||void 0===s?void 0:s.modelId,m||0)];case 1:return n=t.sent(),Ee(!1),Se(n.data),a=n.data||{},i=a.chatContext,l=a.entityInfo,r=e(e({},i||{}),{queryId:null==U?void 0:U.queryId}),H(r),Fe(l),on((null==r?void 0:r.dimensionFilters)||[]),qe(null==r?void 0:r.dateInfo),c=en(r),je(e(e({},Qe),((d={})[c]={tip:"",data:n.data},d))),[2]}}))}))},sn=function(e){ke(e)},un=function(n){if(n&&n[0]&&n[1]){var t=n[0],o=n[1];qe(e(e({},De||{}),{startDate:pe(t).format("YYYY-MM-DD"),endDate:pe(o).format("YYYY-MM-DD"),dateMode:"BETWEEN",unit:0}))}},mn=function(n){qe(e(e({},De||{}),{startDate:pe(n[0]).format("YYYY-MM-DD"),endDate:pe(n[1]).format("YYYY-MM-DD"),dateMode:"BETWEEN",unit:0}))},_n=function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I,N,S,C,T,E,L,M,A,k,z,D,R,O,F,B,P;return t(this,(function(t){switch(t.label){case 0:return Ee(!0),a=(n=o||U||{}).dimensions,i=n.metrics,l=n.id,r=n.queryId,c=n.dataSetIds,n.dataSet,d=c||(null==o?void 0:o.dataSetIds)||(null==U?void 0:U.dataSetIds)||(He.length>0?He:void 0),d&&(null==U?void 0:U.dataSetIds)&&JSON.stringify(d.sort())!==JSON.stringify((U.dataSetIds||[]).sort())||void 0!==o&&o!==U?(s=e({},Qe),Object.keys(s).forEach((function(e){s[e]={tip:"",data:void 0}})),je(s),Se(void 0),ye(""),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,parseId:l,queryId:r,parseInfo:o||U,dataSetIds:d})]):[3,2];case 1:return _=t.sent(),p=_.code,f=_.data,Ee(!1),200===p&&(W(f.parseTimeCost),(h=f.selectedParses[0]).queryId=f.queryId,h.dataSetIds=d,!h.dataSet&&d&&d.length>0&&(g=(null===(z=null==U?void 0:U.dataSet)||void 0===z?void 0:z.name)||(null===(R=null===(D=K.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&d.includes(t)})))||void 0===D?void 0:D.dataSet)||void 0===R?void 0:R.name)||"数据集".concat(d[0]),h.dataSet={id:d[0],name:g}),x=K.map((function(e){var n,t,o=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0],a=(null===(t=h.dataSet)||void 0===t?void 0:t.id)||h.dataSetIds&&h.dataSetIds[0];return o&&a&&o===a?h:e})),w=(null===(O=h.dataSet)||void 0===O?void 0:O.id)||h.dataSetIds&&h.dataSetIds[0],I=x.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&w&&t===w})),I||x.push(h),J(x),H(h),on(h.dimensionFilters||[]),qe(h.dateInfo),h.entityInfo&&Fe(h.entityInfo),M=en(h),je(e(e({},Qe),((A={})[M]={tip:"",data:void 0},A))),N=e(e({},h),{dataSetIds:d}),tn(N,x,!0,!0)),[3,4];case 2:return[4,zn(S={dimensions:a,metrics:i,dateInfo:De,dimensionFilters:Me,parseId:l,queryId:r,dataSetIds:d,dataSet:(null==o?void 0:o.dataSet)||(null==U?void 0:U.dataSet)})];case 3:C=t.sent(),Ee(!1),200===C.code&&(T=null===(F=C.data)||void 0===F?void 0:F.chatContext,E=e(e({},T||S),{queryId:r,properties:e(e({},(null==o?void 0:o.properties)||(null==U?void 0:U.properties)||{}),{CONTEXT:(null===(B=null==o?void 0:o.properties)||void 0===B?void 0:B.CONTEXT)||(null===(P=null==U?void 0:U.properties)||void 0===P?void 0:P.CONTEXT)})}),L=e(e({},C.data),{chatContext:E,parseInfos:K,queryId:r}),null==q||q(L,!0,!0),Se(L),H(E),M=en(E),je(e(e({},Qe),((k={})[M]={tip:"",data:L},k)))),t.label=4;case 4:return[2]}}))}))},pn=function(e){return n(void 0,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,qn(e)];case 1:return 200===n.sent().code&&(Q(!1),W(void 0),H(void 0),J([]),de(!1),me(!1),ee([]),oe(""),le(!1),ke([]),Se(void 0),we(""),qe({}),Fe({}),je({}),Ue(!1),Xe([]),Je(""),cn(u,void 0)),[2]}}))}))},fn=function(){var e=Ne||{},n=e.queryColumns,t=e.queryResults;t&&n&&function(e){var n=[],t=Object.keys(e[0]);n.push(t.join(","));for(var o=function(e){n.push(t.map((function(n){return JSON.stringify(e[n],ln)})).join(","))},a=0,i=e;a<i.length;a++)o(i[a]);var l="\ufeff"+n.join("\n"),r=new Blob([l],{type:"text/csv;charset=utf-8;"}),c=window.URL.createObjectURL(r),d=document.createElement("a");d.href=c,d.download="data.csv",document.body.appendChild(d),d.click(),d.remove(),window.URL.revokeObjectURL(c)}(t.map((function(e){return n.reduce((function(n,t){return n[t.name||t.nameEn]=e[t.nameEn],n}),{})})))},hn=G("".concat($e,"-content"),((r={})["".concat($e,"-content-mobile")]=Ze,r)),vn=(null===(c=null==U?void 0:U.properties)||void 0===c?void 0:c.CONTEXT)||{},gn=vn.llmReq,yn=vn.llmResp,xn=function(e){var n=h(new Map),t=g((function(e,t){n.current.set(e,t)}),[n]),o=g((function(t){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var i=n.current.get(t);return i?i.apply(void 0,o):null==e?void 0:e.apply(void 0,o)}),[n]);return{register:t,call:o}}((function(){return R.error("该条消息暂不支持该操作")})),bn=xn.register,wn=xn.call,In=null===(s=null===(d=null==U?void 0:U.properties)||void 0===d?void 0:d.CONTEXT)||void 0===s?void 0:s.queryText;return In=null==In?u:In,a(Nt.Provider,e({value:{register:bn,call:wn}},{children:i("div",e({className:$e},{children:[!Ze&&a(rn,{type:"icon-zhinengsuanfa",className:"".concat($e,"-avatar")}),i("div",e({className:Ze?"".concat($e,"-mobile-msg-card"):""},{children:[a("div",e({className:"".concat($e,"-time")},{children:(null==Y?void 0:Y.parseStartTime)?pe(Y.parseStartTime).format("M月D日 HH:mm"):""})),i("div",e({className:hn},{children:[i(l,{children:[1===(null==k?void 0:k.enableFeedback)&&!_&&ue&&a("div",e({style:{marginBottom:10}},{children:a(Hn,{isSimpleMode:A,parseInfoOptions:Z,agentId:y,integrateSystem:T,parseTimeCost:null==Y?void 0:Y.parseTime,isDeveloper:C,onSelectParseInfo:function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,_,p,f,h,g,x,w,I,N;return t(this,(function(t){switch(t.label){case 0:return H(o),de(!1),(n=(null===(g=o.dataSet)||void 0===g?void 0:g.id)?[o.dataSet.id]:o.dataSetIds||He)&&n.length>0&&Xe(n),a=o.id,i=o.queryId,Q(!0),[4,Mn({queryText:u,chatId:m,modelId:v,agentId:y,filters:b,parseId:a,queryId:i,parseInfo:o,dataSetIds:n})];case 1:return l=t.sent(),r=l.code,c=l.data,Q(!1),200===r&&(W(c.parseTimeCost),(d=c.selectedParses[0]).queryId=c.queryId,d.dataSetIds=n,!d.dataSet&&n&&n.length>0&&(s=(null===(x=null==d?void 0:d.dataSet)||void 0===x?void 0:x.name)||(null===(I=null===(w=K.find((function(e){var t,o=(null===(t=e.dataSet)||void 0===t?void 0:t.id)||e.dataSetIds&&e.dataSetIds[0];return o&&n.includes(o)})))||void 0===w?void 0:w.dataSet)||void 0===I?void 0:I.name)||"数据集".concat(n[0]),d.dataSet={id:n[0],name:s}),_=K.map((function(e){var n,t,o=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0],a=(null===(t=d.dataSet)||void 0===t?void 0:t.id)||d.dataSetIds&&d.dataSetIds[0];return o&&a&&o===a?d:e})),p=(null===(N=d.dataSet)||void 0===N?void 0:N.id)||d.dataSetIds&&d.dataSetIds[0],f=_.find((function(e){var n,t=(null===(n=e.dataSet)||void 0===n?void 0:n.id)||e.dataSetIds&&e.dataSetIds[0];return t&&p&&t===p})),f||_.push(d),J(_),H(d),on(d.dimensionFilters||[]),qe(d.dateInfo),d.entityInfo&&Fe(d.entityInfo),h=e(e({},d),{dataSetIds:n}),tn(h,_,!0,!0)),[2]}}))}))},onSwitchEntity:dn,onFiltersChange:sn,onDateInfoChange:un,onRefresh:_n,handlePresetClick:mn,setSelectedDataSetIds:Xe})})),!ce&&a(Kn,{isSimpleMode:A,parseLoading:P,parseInfoOptions:K,parseTip:te,currentParseInfo:U,agentId:y,dimensionFilters:Me,dateInfo:De,entityInfo:Oe,integrateSystem:T,parseTimeCost:null==Y?void 0:Y.parseTime,isDeveloper:C,onSelectParseInfo:function(o){return n(void 0,void 0,void 0,(function(){var n,a,i,l,r,c,d,s,u,m,_;return t(this,(function(t){return H(o),on(o.dimensionFilters||[]),qe(o.dateInfo),o.entityInfo&&Fe(o.entityInfo),(n=(null===(_=o.dataSet)||void 0===_?void 0:_.id)?[o.dataSet.id]:o.dataSetIds||He)&&n.length>0&&Xe(n),a=(null==U?void 0:U.dataSetIds)||[],i=n||[],(l=JSON.stringify(a.sort())!==JSON.stringify(i.sort()))&&(r=e({},Qe),Object.keys(r).forEach((function(e){r[e]={tip:"",data:void 0}})),je(r),Se(void 0),ye("")),c=en(o),Qe[c]&&!l?(d=Qe[c],s=d.tip,u=d.data,ye(s),Se(u)):(m=e(e({},o),{dataSetIds:n}),tn(m,K,!0)),[2]}))}))},onSwitchEntity:dn,onFiltersChange:sn,onDateInfoChange:un,onRefresh:function(e){_n(e)},handlePresetClick:mn,setSelectedDataSetIds:Xe})]}),ie&&a(M,e({spinning:Te},{children:i("div",e({style:{minHeight:50}},{children:[!Ze&&(null==U?void 0:U.sqlInfo)&&C&&z&&!A&&a(wt,{agentId:y,queryId:U.queryId,question:In,llmReq:gn,llmResp:yn,integrateSystem:T,queryMode:U.queryMode,sqlInfo:U.sqlInfo,sqlTimeCost:null==Y?void 0:Y.sqlTime,executeErrorMsg:be,dataSetIds:U.dataSetIds}),a(xt,{isSimpleMode:A,queryId:null==U?void 0:U.queryId,parseId:null==U?void 0:U.id,question:In,queryMode:null==U?void 0:U.queryMode,executeLoading:fe,executeTip:ge,executeErrorMsg:be,chartIndex:0,data:Ne,triggerResize:w,executeItemNode:E,isDeveloper:C,renderCustomExecuteNode:L,enableStreamingSummary:!(null==Ne?void 0:Ne.textSummary),onStreamingSummaryUpdate:Je,agentId:y,dataSetIds:null==U?void 0:U.dataSetIds})]}))})),ie&&!fe&&!A&&"PLAIN_TEXT"!==(null==U?void 0:U.queryMode)&&a(It,{queryId:null==U?void 0:U.queryId,defaultExpanded:""!==te||""!==ge,similarQueries:null==Ne?void 0:Ne.similarQueries,onSelectQuestion:function(e){null==F||F(e.queryText)}})]})),(""!==te||ie&&!fe)&&"PLAIN_TEXT"!==(null==U?void 0:U.queryMode)&&a(bt,{isLastMessage:D,queryId:(null==U?void 0:U.queryId)||0,scoreValue:x,isParserError:Ve,onExportData:function(){fn()},isSimpleMode:A,onReExecute:function(e){pn(e)}})]}))]}))}))};var Ct=b((function(n){var t,o=n.id,r=n.chatId,c=n.messageList,d=n.historyVisible,s=n.currentAgent,u=n.chatVisible,m=n.isDeveloper,_=n.integrateSystem,h=n.isSimpleMode,v=n.isDebugMode,y=n.onMsgDataLoaded,x=n.onSendMsg,b=p(!1),w=b[0],I=b[1],N=g((function(){I(!0),setTimeout((function(){I(!1)}),0)}),[]);f((function(){return window.addEventListener("resize",N),function(){window.removeEventListener("resize",N)}}),[]),f((function(){N()}),[d,u]);var S=G(hn,((t={})[yn]=Ze,t));return a("div",e({id:o,className:S},{children:a("div",e({className:vn},{children:c.map((function(n,t){var o=n.id,d=n.questionId,u=n.modelId,p=n.agentId,f=n.type,g=n.msg,b=n.msgValue,I=n.score,N=n.identityMsg,S=n.parseInfos,C=n.parseTimeCost,T=n.msgData,E=n.filters;return i("div",e({id:"".concat(o),className:gn},{children:[f===un.TEXT&&a(fn,{position:"left",data:g}),f===un.AGENT_LIST&&a(Cn,{currentAgent:s,onSendMsg:x}),f===un.QUESTION&&i(l,{children:[a(fn,{position:"right",data:g}),N&&a(fn,{position:"left",data:N}),a(St,{questionId:d,currentAgent:s,isSimpleMode:h,isDebugMode:v,msg:b||g||"",parseInfos:S,parseTimeCostValue:C,msgData:T,conversationId:r,modelId:u,agentId:p,score:I,filter:E,triggerResize:w,isDeveloper:m,integrateSystem:_,onMsgDataLoaded:function(e,n,t){y(e,o,b||g||"",n,t)},onUpdateMessageScroll:tn,onSendMsg:x,isLastMessage:t===c.length-1})]})]}),o)}))}))}))}),(function(e,n){return!(e.id!==n.id||!u(e.messageList,n.messageList)||e.historyVisible!==n.historyVisible||e.currentAgent!==n.currentAgent||e.chatVisible!==n.chatVisible||e.isSimpleMode!==n.isSimpleMode)})),Tt="style_module_chat__9f758d37",Et="style_module_chatSection__9f758d37",Lt="style_module_chatApp__9f758d37",Mt="style_module_chatBody__9f758d37",At="style_module_chatContent__9f758d37",kt="style_module_chatHeader__9f758d37",zt="style_module_chatHeaderTitle__9f758d37",Dt="style_module_chatHeaderTip__9f758d37",qt="style_module_historyVisible__9f758d37",Rt="style_module_mobile__9f758d37",Ot="style_module_showCaseModal__9f758d37",Ft="style_module_showCaseDrawer__9f758d37";Ee(".style_module_chat__9f758d37 {\n height: 100%;\n overflow: hidden;\n background: linear-gradient(180deg, rgba(23, 74, 228, 0) 29.44%, rgba(23, 74, 228, 0.06) 100%), linear-gradient(90deg, #f3f3f7 0%, #f3f3f7 20%, #ebf0f9 60%, #f3f3f7 80%, #f3f3f7 100%);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 {\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n color: rgba(0, 0, 0, 0.87);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 {\n display: flex;\n flex: 1;\n height: 100%;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 {\n position: absolute;\n top: 0;\n z-index: 9;\n display: flex;\n align-items: baseline;\n width: 100%;\n padding: 14px 16px;\n background: rgba(243, 243, 247, 0.85);\n backdrop-filter: blur(2px);\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 .style_module_chatHeaderTitle__9f758d37 {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_chat__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 .style_module_chatBody__9f758d37 .style_module_chatContent__9f758d37 .style_module_chatHeader__9f758d37 .style_module_chatHeaderTip__9f758d37 {\n max-width: 600px;\n margin-left: 5px;\n overflow: hidden;\n color: var(--text-color-third);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_chat__9f758d37.style_module_historyVisible__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n width: calc(100% - 707px);\n}\n.style_module_chat__9f758d37.style_module_mobile__9f758d37 .style_module_chatSection__9f758d37 .style_module_chatApp__9f758d37 {\n width: 100%;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content {\n border-radius: 8px;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content .ant-modal-header {\n border-radius: 8px 8px 0 0;\n}\n.style_module_showCaseModal__9f758d37 .ant-modal-content .ant-modal-body {\n padding: 20px 0 !important;\n}\n.style_module_showCaseDrawer__9f758d37 .ant-drawer-content {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.style_module_showCaseDrawer__9f758d37 .ant-drawer-content .ant-drawer-body {\n padding: 4px 0 !important;\n}\n.ss-chat-recommend-options .ant-table-thead .ant-table-cell {\n padding: 8px !important;\n}\n.ss-chat-recommend-options .ant-table-tbody .ant-table-cell {\n padding: 8px !important;\n border-bottom: 1px solid #f0f0f0;\n}\n",{});var Bt=Ze?"/openapi":"/api";function Pt(e,n){return Tn.post("".concat(Bt,"/chat/manage/save?chatName=").concat(e,"&agentId=").concat(n))}function Qt(e){return Tn.get("".concat(Bt,"/chat/manage/getAll"),{params:{agentId:e}})}var jt,Yt,Wt=B.Item,Vt={labelCol:{span:6},wrapperCol:{span:18}},Ut=function(o){var i=o.visible,l=o.editConversation,r=o.onClose,c=o.onFinish,d=B.useForm()[0],s=p(!1),u=s[0],m=s[1],_=h();f((function(){i&&(d.setFieldsValue({conversationName:l.chatName}),setTimeout((function(){_.current.focus({cursor:"all"})}),0))}),[i]);var v=function(){return n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return[4,d.validateFields()];case 1:return e=n.sent(),m(!0),[4,(t=e.conversationName,o=l.chatId,void 0===o&&(o=0),Tn.post("".concat(Bt,"/chat/manage/updateChatName?chatName=").concat(t,"&chatId=").concat(o)))];case 2:return n.sent(),m(!1),c(e.conversationName),[2]}var t,o}))}))};return a(P,e({title:"修改问答名称",open:i,onCancel:r,onOk:v,confirmLoading:u},{children:a(B,e({},Vt,{form:d},{children:a(Wt,e({name:"conversationName",label:"名称",rules:[{required:!0}]},{children:a(Q,{placeholder:"请输入问答名称",ref:_,onPressEnter:v})}))}))}))},Gt="style_module_conversation__e5d9ab2c",Ht="style_module_rightSection__e5d9ab2c",Xt="style_module_titleBar__e5d9ab2c",Kt="style_module_title__e5d9ab2c",Jt="style_module_rightOperation__e5d9ab2c",$t="style_module_newConversation__e5d9ab2c",Zt="style_module_closeIcon__e5d9ab2c",eo="style_module_searchConversation__e5d9ab2c",no="style_module_searchIcon__e5d9ab2c",to="style_module_searchTask__e5d9ab2c",oo="style_module_conversationList__e5d9ab2c",ao="style_module_conversationItem__e5d9ab2c",io="style_module_conversationContent__e5d9ab2c",lo="style_module_topTitleBar__e5d9ab2c",ro="style_module_conversationTitleBar__e5d9ab2c",co="style_module_conversationName__e5d9ab2c",so="style_module_currentConversation__e5d9ab2c",uo="style_module_conversationTime__e5d9ab2c",mo="style_module_bottomSection__e5d9ab2c",_o="style_module_subTitle__e5d9ab2c",po="style_module_deleteIcon__e5d9ab2c",fo="style_module_activeConversationItem__e5d9ab2c",ho="style_module_historyVisible__e5d9ab2c";Ee(".style_module_conversation__e5d9ab2c {\n position: relative;\n width: 0;\n height: 100%;\n background: #fff;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c {\n width: 100%;\n height: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_title__e5d9ab2c {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_newConversation__e5d9ab2c {\n color: var(--text-color);\n font-size: 14px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_newConversation__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_closeIcon__e5d9ab2c {\n color: var(--text-color);\n font-size: 16px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_titleBar__e5d9ab2c .style_module_rightOperation__e5d9ab2c .style_module_closeIcon__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c {\n display: flex;\n align-items: center;\n padding: 12px 0 10px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchIcon__e5d9ab2c {\n color: #999 !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchTask__e5d9ab2c {\n font-size: 13px;\n background-color: #f5f5f5;\n border: 0;\n border-radius: 4px;\n box-shadow: none !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_searchConversation__e5d9ab2c .style_module_searchTask__e5d9ab2c .ant-input {\n font-size: 13px !important;\n background-color: transparent !important;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c {\n display: flex;\n flex-direction: column;\n height: calc(100% - 70px);\n padding: 2px 0 0;\n overflow-y: auto;\n row-gap: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n border: 1px solid #efefef;\n border-radius: 8px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c {\n width: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c .style_module_conversationName__e5d9ab2c {\n max-width: 300px;\n margin-right: 2px;\n overflow: hidden;\n color: var(--text-color);\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTitleBar__e5d9ab2c .style_module_currentConversation__e5d9ab2c {\n padding: 0 4px;\n color: var(--chat-blue);\n font-size: 12px;\n background-color: var(--light-blue-background);\n border-radius: 4px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_topTitleBar__e5d9ab2c .style_module_conversationTime__e5d9ab2c {\n color: var(--text-color-six);\n font-size: 12px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 4px;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_subTitle__e5d9ab2c {\n width: 350px;\n overflow: hidden;\n color: var(--text-color-six);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_deleteIcon__e5d9ab2c {\n color: var(--text-color-six);\n font-size: 14px;\n cursor: pointer;\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c .style_module_conversationContent__e5d9ab2c .style_module_bottomSection__e5d9ab2c .style_module_deleteIcon__e5d9ab2c:hover {\n color: var(--chat-blue);\n}\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c:hover,\n.style_module_conversation__e5d9ab2c .style_module_rightSection__e5d9ab2c .style_module_conversationList__e5d9ab2c .style_module_conversationItem__e5d9ab2c.style_module_activeConversationItem__e5d9ab2c {\n background-color: #f0f0f0;\n}\n.style_module_conversation__e5d9ab2c.style_module_historyVisible__e5d9ab2c {\n width: 400px;\n padding: 10px 16px;\n border-left: 1px solid #f1f1f1;\n z-index: 99;\n}\n",{}),function(e){e.MODEL="MODEL",e.DIMENSION="DIMENSION",e.METRIC="METRIC",e.VALUE="VALUE",e.TERM="TERM"}(Yt||(Yt={}));var vo=((jt={})[Yt.MODEL]="数据模型",jt[Yt.DIMENSION]="维度",jt[Yt.METRIC]="指标",jt[Yt.VALUE]="维度值",jt[Yt.TERM]="术语",jt),go=["icon-fukuanbaobiaochaxun","icon-hangweifenxi1","icon-xiaofeifenxi","icon-renwuchaxun","icon-baobiao","icon-liushuichaxun","icon-cangkuchaxun","icon-xiaoshoushuju","icon-tongji","icon-shujutongji","icon-mendiankanban"],yo="@_supersonic_@";var xo=b(w((function(o,l){var c,d=o.currentAgent,s=o.currentConversation,u=o.historyVisible,m=o.onSelectConversation,_=o.onCloseConversation,h=p([]),v=h[0],g=h[1],y=p(!1),x=y[0],b=y[1],w=p(),N=w[0],S=w[1],C=p(""),T=C[0],E=C[1];I(l,(function(){return{updateData:L,onAddConversation:q}}));var L=function(e){return n(void 0,void 0,void 0,(function(){var n,o;return t(this,(function(t){switch(t.label){case 0:return[4,Qt(e||d.id)];case 1:return n=t.sent().data,g((o=n||[]).slice(0,200)),[2,o]}}))}))},M=function(){return n(void 0,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return[4,L()];case 1:return(e=n.sent()).length>0?m(e[0]):q(),[2]}}))}))};f((function(){d&&(d.initialSendMsgParams?q(d.initialSendMsgParams):M())}),[d]);var z=function(e){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Pt("新问答对话",n=(null==e?void 0:e.agentId)||d.id)];case 1:return t.sent(),[2,L(n)]}}))}))},D=function(e){return n(void 0,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return[4,(t=e,Tn.post("".concat(Bt,"/chat/manage/delete?chatId=").concat(t)))];case 1:return n.sent(),M(),[2]}var t}))}))},q=function(e){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,z(e)];case 1:return(n=t.sent()).length>0&&m(n[0],e,!0),[2]}}))}))},R=G(Gt,((c={})[ho]=u,c)),O=function(e){r.locale("zh-cn");var n=r(),t=r(e);return n.diff(t,"minutes")<1?"刚刚":t.isSame(n,"day")?t.format("HH:mm"):t.isSame(n.subtract(1,"day"),"day")?"昨天":t.format("MM/DD")};return i("div",e({className:R},{children:[i("div",e({className:Ht},{children:[i("div",e({className:Xt},{children:[a("div",e({className:Kt},{children:"历史对话"})),i("div",e({className:Jt},{children:[a("div",e({className:$t,onClick:function(){z()}},{children:"新对话"})),a(ce,{className:Zt,onClick:_})]}))]})),a("div",e({className:eo},{children:a(Q,{placeholder:"搜索",prefix:a(de,{className:no}),className:to,value:T,onChange:function(e){E(e.target.value)},allowClear:!0})})),a("div",e({className:oo},{children:v.filter((function(e){return""===T||e.chatName.toLowerCase().includes(T.toLowerCase())})).map((function(n){var t,o=G(ao,((t={})[fo]=(null==s?void 0:s.chatId)===n.chatId,t));return a(A,e({overlay:a(k,{items:[{label:"修改对话名称",key:"editName"},{label:"删除",key:"delete"}],onClick:function(e){!function(e,n){"editName"===e?(S(n),b(!0)):"delete"===e&&D(n.chatId)}(e.key,n)}}),trigger:["contextMenu"]},{children:a("div",e({className:o,onClick:function(){m(n)}},{children:i("div",e({className:io},{children:[i("div",e({className:lo},{children:[i("div",e({className:ro},{children:[a("div",e({className:co},{children:n.chatName})),(null==s?void 0:s.chatId)===n.chatId&&a("div",e({className:so},{children:"当前对话"}))]})),a("div",e({className:uo},{children:O(n.lastTime||"")}))]})),i("div",e({className:mo},{children:[a("div",e({className:_o},{children:n.lastQuestion})),a(se,{className:po,onClick:function(e){e.stopPropagation(),D(n.chatId)}})]}))]}))}))}),n.chatId)}))}))]})),a(Ut,{visible:x,editConversation:N,onClose:function(){b(!1)},onFinish:function(){b(!1),L()}})]}))})),(function(e,n){var t,o,a,i;return(null===(t=e.currentAgent)||void 0===t?void 0:t.id)===(null===(o=n.currentAgent)||void 0===o?void 0:o.id)&&(null===(a=e.currentConversation)||void 0===a?void 0:a.chatId)===(null===(i=n.currentConversation)||void 0===i?void 0:i.chatId)&&e.historyVisible===n.historyVisible})),bo={chatFooter:"style_module_chatFooter__fe028c7a",tools:"style_module_tools__fe028c7a",toolItem:"style_module_toolItem__fe028c7a",composer:"style_module_composer__fe028c7a",collapseBtn:"style_module_collapseBtn__fe028c7a",addConversation:"style_module_addConversation__fe028c7a",composerInputWrapper:"style_module_composerInputWrapper__fe028c7a",composerInput:"style_module_composerInput__fe028c7a",sendBtn:"style_module_sendBtn__fe028c7a",sendBtnActive:"style_module_sendBtnActive__fe028c7a",mobile:"style_module_mobile__fe028c7a",searchOption:"style_module_searchOption__fe028c7a",model:"style_module_model__fe028c7a",autoCompleteDropdown:"style_module_autoCompleteDropdown__fe028c7a",modelOptions:"style_module_modelOptions__fe028c7a",semanticType:"style_module_semanticType__fe028c7a",quoteText:"style_module_quoteText__fe028c7a"};Ee(".style_module_chatFooter__fe028c7a {\n position: relative;\n z-index: 10;\n display: flex;\n flex-direction: column;\n margin: 6px 20px 20px;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a {\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n column-gap: 8px;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a .style_module_toolItem__fe028c7a {\n display: flex;\n align-items: center;\n padding: 2px 6px;\n color: var(--text-color-secondary);\n font-size: 12px;\n column-gap: 6px;\n background-color: #f6f6f6;\n border-radius: 6px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_tools__fe028c7a .style_module_toolItem__fe028c7a:hover {\n background-color: #f1f1f1;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a {\n display: flex;\n height: 70px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_collapseBtn__fe028c7a {\n height: 46px;\n margin: 0 10px;\n color: var(--text-color-third);\n font-size: 20px;\n line-height: 46px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_collapseBtn__fe028c7a:hover {\n color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_addConversation__fe028c7a {\n height: 46px;\n margin: 0 20px 0 10px;\n color: var(--text-color-fourth);\n font-size: 26px;\n line-height: 54px;\n cursor: pointer;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_addConversation__fe028c7a:hover {\n color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a {\n position: relative;\n flex: 1;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a {\n width: 100%;\n height: 100%;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector {\n box-sizing: border-box;\n height: 100%;\n overflow: hidden;\n color: rgba(0, 0, 0, 0.87);\n font-size: 14px;\n word-break: break-all;\n background: #f9f9f9;\n border: 0;\n border-radius: 8px;\n transition: border-color 0.15s ease-in-out;\n resize: none;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-search-input {\n height: 40px !important;\n padding: 0 12px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-search {\n right: 0 !important;\n left: 0 !important;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-selector .ant-select-selection-placeholder {\n line-height: 40px;\n margin-bottom: 30px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .style_module_composerInput__fe028c7a .ant-select-clear {\n right: auto;\n left: 500px;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n font-size: 16px;\n}\n.style_module_chatFooter__fe028c7a .style_module_composer__fe028c7a .style_module_composerInputWrapper__fe028c7a .ant-select-focused .ant-select-selector {\n box-shadow: #4a72f5 0px 0px 3px !important;\n}\n.style_module_chatFooter__fe028c7a .style_module_sendBtn__fe028c7a {\n position: absolute;\n right: 10px;\n bottom: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n color: #fff;\n font-size: 20px;\n background-color: #b8b8bf;\n border: unset;\n border-radius: 50%;\n transition: background-color 0.3s ease 0s;\n}\n.style_module_chatFooter__fe028c7a .style_module_sendBtn__fe028c7a.style_module_sendBtnActive__fe028c7a {\n background-color: var(--chat-blue);\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a {\n margin: 6px 10px 10px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_addConversation__fe028c7a {\n height: 40px;\n margin: 0 12px 0 4px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a {\n height: 40px;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selector {\n font-size: 14px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selection-search-input {\n padding: 0 10px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_composer__fe028c7a .ant-select-selection-placeholder {\n margin-bottom: 0 !important;\n padding-left: 0 !important;\n line-height: 38px !important;\n}\n.style_module_chatFooter__fe028c7a.style_module_mobile__fe028c7a .style_module_sendBtn__fe028c7a {\n right: 4px;\n bottom: 6px;\n}\n.style_module_searchOption__fe028c7a {\n padding: 6px 20px;\n color: #212121;\n font-size: 16px;\n}\n.style_module_mobile__fe028c7a .style_module_searchOption__fe028c7a {\n min-height: 26px;\n padding: 2px 12px;\n font-size: 14px;\n}\n.style_module_model__fe028c7a {\n margin-top: 2px;\n color: var(--text-color-fourth);\n font-size: 13px;\n line-height: 12px;\n}\n.style_module_autoCompleteDropdown__fe028c7a {\n left: 20px !important;\n width: fit-content !important;\n min-width: 100px !important;\n border-radius: 6px;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a {\n width: 150px !important;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a .style_module_searchOption__fe028c7a {\n padding: 0 10px;\n color: var(--text-color-secondary);\n font-size: 14px;\n}\n.style_module_autoCompleteDropdown__fe028c7a.style_module_modelOptions__fe028c7a .ant-select-item {\n height: 30px !important;\n line-height: 30px !important;\n}\n.style_module_semanticType__fe028c7a {\n margin-right: 10px;\n}\n.style_module_quoteText__fe028c7a {\n color: var(--chat-blue);\n}\n",{});var wo=T.OptGroup,Io=T.Option,No=!1,So=!1,Co=function(){No=!0},To=function(){No=!1},Eo=w((function(o,l){var r,c,d,u=o.inputMsg,m=o.chatId,_=o.currentAgent,v=o.agentList,y=o.onToggleHistoryVisible,x=o.onOpenAgents,b=o.onInputMsgChange,w=o.onSendMsg,N=o.onAddConversation,S=o.onSelectAgent,C=o.onOpenShowcase,T=p([]),E=T[0],L=T[1],M=p({}),A=M[0],k=M[1],z=p(!1),D=z[0],q=z[1],R=p(!1),O=R[0],F=R[1],B=h(),P=h(0),Q=function(){var e;null===(e=B.current)||void 0===e||e.focus()},W=function(){var e;null===(e=B.current)||void 0===e||e.blur()};I(l,(function(){return{inputFocus:Q,inputBlur:W}}));f((function(){var e;return(e=document.getElementById("chatInput")).addEventListener("compositionstart",Co),e.addEventListener("compositionend",To),function(){!function(){var e=document.getElementById("chatInput");e&&(e.removeEventListener("compositionstart",Co),e.removeEventListener("compositionend",To))}()}}),[]);var V=g((function(){return s((function(e,o,a){return n(void 0,void 0,void 0,(function(){var n,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return No||(""===e||1===e.length&&"@"===e[0])?[2]:(P.current+=1,n=P.current,i=function(e){var n=e;if("/"===(null==e?void 0:e[0])){var t=v.find((function(n){return e.includes("/".concat(n.name))}));n=t?e.replace("/".concat(t.name),""):e}return{msgValue:n,dataSetId:void 0}}(e),l=i.msgValue,r=i.dataSetId,[4,Ln(l.trim(),o,r,null==a?void 0:a.id)]);case 1:return c=t.sent(),n!==P.current?[2]:(d=l&&c.data||[],(s=d.map((function(e){return e.subRecommend}))).length>0&&s.every((function(e){return null!==e}))?k(function(e){var n=Je(e,"dataSetName");return Ze&&e.length>6?Object.keys(n).slice(0,4).reduce((function(e,t){return e[t]=n[t].slice(0,Object.keys(n).length>2?2:Object.keys(n).length>1?3:6),e}),{}):n}(d)):k({}),q(d.length>0),[2])}}))}))}),200)}),[]),U=p(V)[0];f((function(){if(1===u.length&&"/"===u[0])return q(!0),L(v),void k({});E.length>0&&setTimeout((function(){L([])}),50),So?So=!1:U(u,m,_),u||(k({}),P.current=0)}),[u]),f((function(){O||q(!1)}),[O]),f((function(){var e=document.querySelector(".".concat(bo.autoCompleteDropdown));if(e){var n=function(e,n,t,o){void 0===n&&(n="16px"),void 0===t&&(t="normal"),void 0===o&&(o="DINPro Medium");var a=(an||(an=document.createElement("canvas"))).getContext("2d");a.font="".concat(t," ").concat(n," ").concat(o);var i=a.measureText(e);return Math.ceil(i.width)}(u);Object.keys(A).length>0?e.style.marginLeft="".concat(n,"px"):setTimeout((function(){e.style.marginLeft="0px"}),200)}}),[A]);var H=function(e){var n=Object.keys(A).reduce((function(e,n){return e=e.concat(A[n])}),[]).find((function(n){return 1===Object.keys(A).length?n.recommend===e:"".concat(n.dataSetName||"").concat(n.recommend)===e}));n&&So?w(n.recommend,n.dataSetIds):w(e.trim(),null==n?void 0:n.dataSetId)},X=G(bo.autoCompleteDropdown,((r={})[bo.mobile]=Ze,r[bo.modelOptions]=E.length>0,r)),K=G(bo.chatFooter,((c={})[bo.mobile]=Ze,c)),J=E.map((function(n){return a(Io,e({value:"/".concat(n.name," "),className:bo.searchOption},{children:n.name}),n.id)})),$=Object.keys(A).map((function(n){return a(wo,e({label:n},{children:A[n].map((function(n){var t=1===Object.keys(A).length?n.recommend:"".concat(n.dataSetName||"").concat(n.recommend);if("/"===u[0]){var o=v.find((function(e){return u.includes(e.name)}));t=o?"/".concat(o.name," ").concat(n.recommend):t}return a(Io,e({value:"".concat(t).concat(yo),className:bo.searchOption},{children:i("div",e({className:bo.optionContent},{children:[n.schemaElementType&&a(j,e({className:bo.semanticType,color:n.schemaElementType===Yt.DIMENSION||n.schemaElementType===Yt.MODEL?"blue":n.schemaElementType===Yt.VALUE?"geekblue":"cyan"},{children:vo[n.schemaElementType]||n.schemaElementType||"维度"})),n.subRecommend]}))}),"".concat(n.recommend).concat(n.dataSetName?"_".concat(n.dataSetName):""))}))}),n)})),Z=function(){setTimeout((function(){var e=document.querySelector("."+bo.autoCompleteDropdown+" .rc-virtual-list-holder-inner");if(e){var n=window.getComputedStyle(e);e.setAttribute("style","".concat(n.cssText,";width: fit-content"));var t=e.clientWidth;e.parentElement.style.width=t+20+"px"}else Z()}))};f((function(){(J.length||$.length)&&Z()}),[J.length,$.length]);var ee=function(e){var n=p(!1),t=n[0],o=n[1];return f((function(){var n,t=function(){o(!0)},a=function(){o(!1)},i=(null!==(n=e)&&"object"==typeof n&&"current"in n?e.current:e)||window;return i.addEventListener("compositionstart",t),i.addEventListener("compositionend",a),function(){i.removeEventListener("compositionstart",t),i.removeEventListener("compositionend",a)}}),[e]),{isComposing:t,setIsComposing:o}}(document.getElementById("chatInput")).isComposing;return i("div",e({className:K},{children:[i("div",e({className:bo.tools},{children:[i("div",e({className:bo.toolItem,onClick:function(){N()}},{children:[a(rn,{type:"icon-c003xiaoxiduihua",className:bo.toolIcon}),a("div",{children:"新对话"})]})),!Ze&&i("div",e({className:bo.toolItem,onClick:y},{children:[a(rn,{type:"icon-lishi",className:bo.toolIcon}),a("div",{children:"历史对话"})]})),(null==v?void 0:v.length)>1&&i("div",e({className:bo.toolItem,onClick:x},{children:[a(rn,{type:"icon-zhinengzhuli",className:bo.toolIcon}),a("div",{children:"智能助理"})]})),i("div",e({className:bo.toolItem,onClick:C},{children:[a(rn,{type:"icon-showcase",className:bo.toolIcon}),a("div",{children:"showcase"})]}))]})),a("div",e({className:bo.composer},{children:i("div",e({className:bo.composerInputWrapper},{children:[a(Y,e({className:bo.composerInput,placeholder:_?"【".concat(_.name,"】将与您对话,点击").concat(Ze?"":"左侧","【智能助理】").concat(Ze?"":"列表","可切换"):"请输入您的问题",value:u,onChange:function(e){b(e)},onSelect:function(e){if(So=!0,E.length>0){var n=v.find((function(n){return e.includes(n.name)}));n&&(n.id!==(null==_?void 0:_.id)&&S(n),b(""))}else b(e.replace(yo,""));q(!1),setTimeout((function(){So=!1}),200)},autoFocus:!Ze,ref:B,id:"chatInput",onKeyDown:function(e){if("Enter"===e.code||"NumpadEnter"===e.code){var n=document.getElementById("chatInput"),t=v.find((function(e){return"/"===n.value[0]&&n.value.includes(e.name)}));if(t)return t.id!==(null==_?void 0:_.id)&&S(t),void b("");So||ee||(H(n.value),q(!1))}},onFocus:function(){F(!0)},onBlur:function(){F(!1)},dropdownClassName:X,listHeight:500,allowClear:!0,open:D,defaultActiveFirstOption:!1,getPopupContainer:function(e){return e.parentNode}},{children:E.length>0?J:$})),a("div",e({className:G(bo.sendBtn,(d={},d[bo.sendBtnActive]=(null==u?void 0:u.length)>0,d)),onClick:function(){H(u)}},{children:a(rn,{type:"icon-ios-send"})}))]}))}))]}))})),Lo="style_module_agentList__d41a8a7b",Mo="style_module_header__d41a8a7b",Ao="style_module_headerTitle__d41a8a7b",ko="style_module_plusIcon__d41a8a7b",zo="style_module_agentListContent__d41a8a7b",Do="style_module_agentItem__d41a8a7b",qo="style_module_avatar__d41a8a7b",Ro="style_module_agentInfo__d41a8a7b",Oo="style_module_agentName__d41a8a7b",Fo="style_module_agentDesc__d41a8a7b",Bo="style_module_active__d41a8a7b";Ee(".style_module_agentList__d41a8a7b {\n position: relative;\n width: 248px;\n height: 100%;\n background: #f9f9f9;\n border-right: 1px solid #f1f1f1;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 50px;\n padding: 0 16px;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_headerTitle__d41a8a7b {\n color: var(--text-color);\n font-weight: 500;\n font-size: 15px;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_plusIcon__d41a8a7b {\n color: var(--text-color);\n font-size: 15px;\n cursor: pointer;\n}\n.style_module_agentList__d41a8a7b .style_module_header__d41a8a7b .style_module_plusIcon__d41a8a7b:hover {\n color: var(--chat-blue);\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b {\n display: flex;\n flex-direction: column;\n padding: 4px 8px;\n row-gap: 2px;\n height: calc(100% - 50px);\n overflow-y: auto;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b {\n display: flex;\n align-items: center;\n padding: 8px 4px;\n column-gap: 8px;\n border-radius: 8px;\n cursor: pointer;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_avatar__d41a8a7b {\n font-size: 40px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b {\n display: flex;\n flex-direction: column;\n row-gap: 2px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b .style_module_agentName__d41a8a7b {\n color: #000;\n font-size: 14px;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b .style_module_agentInfo__d41a8a7b .style_module_agentDesc__d41a8a7b {\n width: 160px;\n overflow: hidden;\n color: var(--text-color-fourth);\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b {\n background: #22a5f7;\n}\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover .style_module_agentName__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b .style_module_agentName__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b:hover .style_module_agentDesc__d41a8a7b,\n.style_module_agentList__d41a8a7b .style_module_agentListContent__d41a8a7b .style_module_agentItem__d41a8a7b.style_module_active__d41a8a7b .style_module_agentDesc__d41a8a7b {\n color: #fff;\n}\n",{});var Po=function(n){var t=n.agentList,o=n.currentAgent,l=n.onSelectAgent;return i("div",e({className:Lo},{children:[i("div",e({className:Mo},{children:[a("div",e({className:Ao},{children:"智能助理"})),a(ue,{className:ko,onClick:function(){R.info("正在开发中,敬请期待")}})]})),a("div",e({className:zo},{children:t.map((function(n,t){var r,c=G(Do,((r={})[Bo]=(null==o?void 0:o.id)===n.id,r));return i("div",e({className:c,onClick:function(){l(n)}},{children:[a(rn,{type:go[t%go.length],className:qo}),i("div",e({className:Ro},{children:[a("div",e({className:Oo},{children:n.name})),a("div",e({className:Fo},{children:n.description}))]}))]}),n.id)}))}))]}))},Qo="style_module_mobileAgents__c9cbfa90",jo="style_module_agentListContent__c9cbfa90",Yo="style_module_agentItem__c9cbfa90",Wo="style_module_active__c9cbfa90",Vo="style_module_agentTitleBar__c9cbfa90",Uo="style_module_avatar__c9cbfa90",Go="style_module_agentName__c9cbfa90",Ho="style_module_agentDesc__c9cbfa90";Ee(".style_module_mobileAgents__c9cbfa90 .ant-drawer-content {\n border-top-left-radius: 12px;\n border-top-right-radius: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .ant-drawer-content .ant-drawer-header {\n padding: 16px 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .ant-drawer-content .ant-drawer-body {\n padding: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 {\n padding: 12px 16px;\n background-color: #f5f7f9;\n border: 1px solid transparent;\n border-radius: 10px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90.style_module_active__c9cbfa90 {\n border: 1px solid var(--chat-blue);\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 {\n display: flex;\n align-items: center;\n column-gap: 6px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 .style_module_avatar__c9cbfa90 {\n font-size: 24px;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentTitleBar__c9cbfa90 .style_module_agentName__c9cbfa90 {\n color: var(--text-color);\n font-weight: 500;\n}\n.style_module_mobileAgents__c9cbfa90 .style_module_agentListContent__c9cbfa90 .style_module_agentItem__c9cbfa90 .style_module_agentDesc__c9cbfa90 {\n margin-top: 8px;\n color: var(--text-color-third);\n font-size: 13px;\n line-height: 24px;\n}\n",{});var Xo=function(n){var t=n.open,o=n.agentList,l=n.currentAgent,r=n.onSelectAgent,c=n.onClose;return a(W,e({title:"智能助理",placement:"bottom",open:t,height:"85%",className:Qo,onClose:c},{children:a("div",e({className:jo},{children:o.map((function(n,t){var o,d=G(Yo,((o={})[Wo]=(null==l?void 0:l.id)===n.id,o));return i("div",e({className:d,onClick:function(){r(n),c()}},{children:[i("div",e({className:Vo},{children:[a(rn,{type:go[t%go.length],className:Uo}),a("div",e({className:Go},{children:n.name}))]})),a("div",e({className:Ho},{children:n.description}))]}),n.id)}))}))}))},Ko="style_module_showCase__4980a35e",Jo="style_module_showCaseContent__4980a35e",$o="style_module_showCaseItem__4980a35e",Zo="style_module_showCaseChatItem__4980a35e",ea="style_module_mobile__4980a35e";Ee(".style_module_showCase__4980a35e {\n position: relative;\n height: 100%;\n padding: 0 20px;\n overflow-y: auto;\n padding-bottom: 2px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e {\n column-count: 2;\n column-gap: 20px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showcaseLoading__4980a35e {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 400px;\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showCaseItem__4980a35e {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 12px;\n margin-bottom: 20px;\n overflow-y: auto;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);\n background: linear-gradient(180deg, rgba(23, 74, 228, 0) 29.44%, rgba(23, 74, 228, 0.06) 100%), linear-gradient(90deg, #f3f3f7 0%, #f3f3f7 20%, #ebf0f9 60%, #f3f3f7 80%, #f3f3f7 100%);\n}\n.style_module_showCase__4980a35e .style_module_showCaseContent__4980a35e .style_module_showCaseItem__4980a35e .style_module_showCaseChatItem__4980a35e {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n.style_module_showCase__4980a35e.style_module_mobile__4980a35e {\n padding: 0 4px;\n}\n.style_module_showCase__4980a35e.style_module_mobile__4980a35e .style_module_showCaseContent__4980a35e {\n column-count: 1;\n}\n",{});var na=Ze?"/openapi":"/api";function ta(e,n,t){return Tn.post("".concat(na,"/chat/manage/queryShowCase?agentId=").concat(e),{current:n,pageSize:t})}var oa=function(l){var r,c=l.height,d=l.agentId,s=l.onSendMsg,u=p([]),m=u[0],_=u[1],v=p(!1),g=v[0],y=v[1],x=p(1),b=x[0],w=x[1],I=h(null),N=function(e){return n(void 0,void 0,void 0,(function(){var n,a,i;return t(this,(function(t){switch(t.label){case 0:return 1===e&&y(!0),[4,ta(d,e,Ze?10:20)];case 1:return n=t.sent(),1===e&&y(!1),a=n.data.showCaseMap||{},i=Object.keys(a).reduce((function(e,n){return e.push({msgList:a[n],caseId:n}),e}),[]).sort((function(e,n){var t,o,a,i;return((null===(o=null===(t=n.msgList)||void 0===t?void 0:t[0])||void 0===o?void 0:o.score)||3)-((null===(i=null===(a=e.msgList)||void 0===a?void 0:a[0])||void 0===i?void 0:i.score)||3)})),_(1===e?i:o(o([],m,!0),i,!0)),[2]}}))}))},S=Ne((function(e){(e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight||e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight+.5)&&(N(b+1),w(b+1))}),{leading:!0,trailing:!0,wait:200}).run;f((function(){if(!Ze){var e=I.current;return null==e||e.addEventListener("scroll",S),function(){e.removeEventListener("scroll",S)}}}),[]),f((function(){d&&(_([]),N(1),w(1))}),[d]);var C=G(Ko,((r={})[ea]=Ze,r));return a(M,e({spinning:g,size:"large"},{children:a("div",e({className:C,style:{height:c},ref:I},{children:a("div",e({className:Jo},{children:m.map((function(n){return a("div",e({className:$o},{children:n.msgList.filter((function(e){return!!e.queryResult})).slice(0,1).map((function(n){return i("div",e({className:Zo},{children:[a(fn,{position:"right",data:n.queryText,anonymousUser:!0}),a(St,{msg:n.queryText,parseInfos:n.parseInfos,msgData:n.queryResult,conversationId:n.chatId,agentId:d,integrateSystem:"showcase",score:n.score,onSendMsg:s})]}),n.questionId)}))}),n.caseId)}))}))}))}))};pe.locale("zh-cn");var aa=w((function(l,r){var d,s=l.token,u=l.agentIds,v=l.initialAgentId,g=l.chatVisible,y=l.noInput,x=l.isDeveloper,b=l.integrateSystem,w=l.isCopilot,N=l.onCurrentAgentChange,S=l.onReportMsgEvent,C=p([]),T=C[0],E=C[1],L=p(""),M=L[0],A=L[1],k=p(1),q=k[0],R=k[1],B=p(!1),Q=B[0],j=B[1],Y=p(!1),H=Y[0],X=Y[1],K=p(Ze?{chatId:0,chatName:"问答"}:void 0),J=K[0],$=K[1],Z=p(!1),ee=Z[0],ne=Z[1],te=p([]),oe=te[0],ae=te[1],ie=p(),le=ie[0],re=ie[1],ce=p(!1),de=ce[0],se=ce[1],ue=p(!0),me=ue[0],_e=ue[1],pe=p(!1),fe=pe[0],he=pe[1],ve=p(!1),ge=ve[0],ye=ve[1],xe=p(!0),be=xe[0],we=xe[1],Ie=h(),Ce=h();I(r,(function(){return{sendCopilotMsg:Te}}));var Te=function(n){_e(!1);var t=n.agentId,o=n.msg,a=n.modelId;if((null==le?void 0:le.id)!==t){E([]);var i=oe.find((function(e){return e.id===t}))||{};Le(e(e({},i),{initialSendMsgParams:n}))}else De(o,T,a,n)},Ee=function(e){var n=function(e,n){if(!c(e))return e;if(!e)return n;try{return JSON.parse(e)}catch(e){return console.log(e),n}}(null==e?void 0:e.toolConfig,{}),t=n.simpleMode,o=n.debugMode;m(t)?ye(t):ye(!1),m(o)?we(o):we(!0)},Le=function(e){re(e),null==N||N(e),localStorage.setItem("AGENT_ID","".concat(null==e?void 0:e.id)),e&&Ee(e),w||window.history.replaceState({},"","".concat(window.location.pathname,"?agentId=").concat(null==e?void 0:e.id))};f((function(){n(void 0,void 0,void 0,(function(){var e,n,o,a;return t(this,(function(t){switch(t.label){case 0:return[4,Tn.get("".concat(Bt,"/chat/agent/getAgentList"))];case 1:return e=t.sent(),n=(e.data||[]).filter((function(e){return 1===e.status&&(void 0===u||u.includes(e.id))})),ae(n),n.length>0&&((o=v||localStorage.getItem("AGENT_ID"))?(a=n.find((function(e){return e.id===+o})),Le(a||n[0])):Le(n[0])),[2]}}))}))}),[]),f((function(){s&&en(s)}),[s]),f((function(){g&&(ze(),tn())}),[g]),f((function(){if(J){var e=J.initialMsgParams;if(J.isAdd)return ze(),e?void De(e.msg,[],e.modelId,e):void Me();Ae(1),R(1)}}),[J]),f((function(){if(H){var e=document.getElementById("messageContainer");null==e||e.addEventListener("scroll",ke)}return function(){var e=document.getElementById("messageContainer");null==e||e.removeEventListener("scroll",ke)}}),[H]);var Me=function(e){var n;y||E([{id:on(),type:un.AGENT_LIST,msg:(null==e?void 0:e.name)||(null==le?void 0:le.name)||(null===(n=null==oe?void 0:oe[0])||void 0===n?void 0:n.name)}])},Ae=function(a){return n(void 0,void 0,void 0,(function(){var n,i,l,r,c,d,s;return t(this,(function(t){switch(t.label){case 0:return[4,(u=a,m=J.chatId,_=3,void 0===m&&(m=0),void 0===_&&(_=10),Tn.post("".concat(En,"/chat/manage/pageQueryInfo?chatId=").concat(m),{current:u,pageSize:_}))];case 1:return n=t.sent(),i=(null==n?void 0:n.data)||{hasNextPage:!1,list:[]},l=i.hasNextPage,r=i.list,c=o(o([],function(n){return n.map((function(n){return{id:n.questionId,questionId:n.questionId,type:un.QUESTION,msg:n.queryText,parseInfos:n.parseInfos,parseTimeCost:n.parseTimeCost,msgData:e(e({},n.queryResult||{}),{similarQueries:n.similarQueries}),score:n.score,agentId:null==le?void 0:le.id}}))}(r),!0),1===a?[]:T,!0),E(c),j(l),1===a?(0===r.length&&Me(),tn(),X(!0),ze()):null==(d=document.getElementById("".concat(null===(s=T[0])||void 0===s?void 0:s.id)))||d.scrollIntoView(),[2]}var u,m,_}))}))},ke=Ne((function(e){0===e.target.scrollTop&&Q&&(Ae(q+1),R(q+1))}),{leading:!0,trailing:!0,wait:200}).run,ze=function(){var e;Ze||null===(e=Ce.current)||void 0===e||e.inputFocus()},De=function(e,a,i,l){return n(void 0,void 0,void 0,(function(){var n,r,c,d,s,u;return t(this,(function(t){return""===(n=e||M).trim()?(A(""),[2]):(r=oe.find((function(e){return 1===n.indexOf(e.name)})),c="/"===n[0]&&r,d=c?r.id:void 0,((s=oe.find((function(e){return e.id===(null==l?void 0:l.agentId)})))||c)&&Le(s||r),u=o(o([],a||T,!0),[{id:on(),msg:n,msgValue:c?n.replace("/".concat(c.name),"").trim():n,modelId:-1===i?void 0:i,agentId:(null==s?void 0:s.id)||d||(null==le?void 0:le.id),type:un.QUESTION,filters:null==l?void 0:l.filters}],!1),E(u),tn(),A(""),[2])}))}))},qe=function(e){e.id!==(null==le?void 0:le.id)&&(1===T.length&&T[0].type===un.AGENT_LIST&&E([]),Le(e),tn())},Re=G(Tt,((d={})[Rt]=Ze,d[qt]=ee,d));return a(V,e({locale:Se},{children:i("div",e({className:Re},{children:[i("div",e({className:Et},{children:[!Ze&&oe.length>1&&me&&a(Po,{agentList:oe,currentAgent:le,onSelectAgent:qe}),a("div",e({className:Lt},{children:J&&a("div",e({className:Mt},{children:i("div",e({className:At},{children:[le&&!Ze&&!y&&a("div",e({className:kt},{children:i(z,e({style:{width:"100%"}},{children:[a(D,e({flex:"1 1 200px"},{children:i(O,{children:[a("div",e({className:zt},{children:le.name})),a("div",e({className:Dt},{children:le.description})),a(U,e({title:"精简模式下,问答结果将以文本形式输出"},{children:a(F,{style:{position:"relative",top:-1},size:"small",value:ge,checkedChildren:"精简模式",unCheckedChildren:"精简模式",onChange:function(e){ye(e)}},le.id)}))]})})),a(D,{flex:"0 1 118px"})]}))})),a(Ct,{id:"messageContainer",isSimpleMode:ge,isDebugMode:be,messageList:T,chatId:null==J?void 0:J.chatId,historyVisible:ee,currentAgent:le,chatVisible:g,isDeveloper:x,integrateSystem:b,onMsgDataLoaded:function(e,n,t,o,a){var i;if(null==S||S(t,o),Ze||null===(i=null==Ie?void 0:Ie.current)||void 0===i||i.updateData(null==le?void 0:le.id),e){var l=_(T),r=l.find((function(e){return e.id===n}));r&&(r.msgData=e,E(l)),a||tn("".concat(n))}},onSendMsg:De}),!y&&a(Eo,{inputMsg:M,chatId:null==J?void 0:J.chatId,agentList:oe,currentAgent:le,onToggleHistoryVisible:function(){ne(!ee)},onInputMsgChange:function(e){A(e||"")},onSendMsg:function(e,n){De(e,T,n),Ze&&function(){var e;null===(e=Ce.current)||void 0===e||e.inputBlur()}()},onAddConversation:function(){var e;null===(e=Ie.current)||void 0===e||e.onAddConversation(),ze()},onSelectAgent:qe,onOpenAgents:function(){Ze?se(!0):_e(!me)},onOpenShowcase:function(){he(!fe)},ref:Ce})]}))}))})),a(xo,{currentAgent:le,currentConversation:J,historyVisible:ee,onSelectConversation:function(n,t,o){$(e(e({},n),{initialMsgParams:t,isAdd:o})),function(e){e?-1!==e.chatId&&localStorage.setItem("CONVERSATION_ID","".concat(e.chatId)):localStorage.removeItem("CONVERSATION_ID")}(n)},onCloseConversation:function(){ne(!1)},ref:Ie}),le&&(Ze?a(W,e({title:"showcase",placement:"bottom",height:"95%",open:fe,className:Ft,destroyOnClose:!0,onClose:function(){he(!1)}},{children:a(oa,{agentId:le.id,onSendMsg:De})})):a(P,e({title:"showcase",width:"98%",open:fe,centered:!0,footer:null,wrapClassName:Ot,destroyOnClose:!0,onCancel:function(){he(!1)}},{children:a(oa,{height:"calc(100vh - 140px)",agentId:le.id,onSendMsg:De})})))]})),a(Xo,{open:de,agentList:oe,currentAgent:le,onSelectAgent:qe,onClose:function(){se(!1)}})]}))}))})),ia={copilot:"style_module_copilot__25135ae0",copilotMinimized:"style_module_copilotMinimized__25135ae0",minimizeWrapper:"style_module_minimizeWrapper__25135ae0",minimize:"style_module_minimize__25135ae0",chatPopover:"style_module_chatPopover__25135ae0",c2System:"style_module_c2System__25135ae0",header:"style_module_header__25135ae0",title:"style_module_title__25135ae0",leftSection:"style_module_leftSection__25135ae0",close:"style_module_close__25135ae0",transfer:"style_module_transfer__25135ae0",fullscreen:"style_module_fullscreen__25135ae0",chat:"style_module_chat__25135ae0",rightArrow:"style_module_rightArrow__25135ae0"};Ee(".style_module_copilot__25135ae0 {\n position: fixed;\n right: 8px;\n bottom: 220px;\n z-index: 999;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 54px;\n height: 54px;\n color: #fff;\n font-size: 26px;\n background-color: var(--chat-blue);\n background-clip: padding-box;\n border: 2px solid #fff;\n border-radius: 50%;\n box-shadow: 8px 8px 20px 0 rgba(55, 99, 170, 0.1);\n cursor: pointer;\n transition: all 0.2s ease-in-out;\n}\n.style_module_copilot__25135ae0.style_module_copilotMinimized__25135ae0 {\n right: -40px;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0 {\n position: absolute;\n top: -18px;\n right: -6px;\n display: none;\n width: 22px;\n height: 22px;\n padding: 4px;\n cursor: pointer;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0 .style_module_minimize__25135ae0 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n padding-bottom: 5px;\n background-color: var(--text-color-fifth-4);\n border-radius: 50%;\n transition: all 0.1s ease-in-out;\n}\n.style_module_copilot__25135ae0 .style_module_minimizeWrapper__25135ae0:hover .style_module_minimize__25135ae0 {\n background-color: var(--text-color-fifth);\n}\n.style_module_copilot__25135ae0:hover {\n text-decoration: none;\n box-shadow: 8px 8px 20px rgba(55, 99, 170, 0.3);\n}\n.style_module_copilot__25135ae0:hover .style_module_minimizeWrapper__25135ae0 {\n display: block;\n}\n.style_module_chatPopover__25135ae0 {\n position: fixed;\n right: 90px;\n bottom: 5vh;\n z-index: 999;\n display: flex;\n flex-direction: column;\n width: 70vw;\n min-width: 1100px;\n height: 90vh;\n overflow: hidden;\n box-shadow: 4px 4px 10px rgba(55, 99, 170, 0.3), -2px -2px 16px rgba(55, 99, 170, 0.3);\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;\n}\n.style_module_chatPopover__25135ae0.style_module_c2System__25135ae0 {\n width: calc(100vw - 180px);\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 {\n position: relative;\n z-index: 99;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n padding-right: 16px;\n padding-left: 16px;\n background: linear-gradient(81.62deg, #2870ea 8.72%, var(--chat-blue) 85.01%);\n box-shadow: 1px 1px 8px #1b4aef5c;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_title__25135ae0 {\n color: #fff;\n font-weight: 700;\n font-size: 16px;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 {\n position: absolute;\n left: 16px;\n display: flex;\n align-items: center;\n color: #fff;\n font-size: 16px;\n column-gap: 20px;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_close__25135ae0 {\n font-size: 18px;\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_transfer__25135ae0 {\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_header__25135ae0 .style_module_leftSection__25135ae0 .style_module_fullscreen__25135ae0 {\n font-size: 20px;\n cursor: pointer;\n}\n.style_module_chatPopover__25135ae0 .style_module_chat__25135ae0 {\n height: calc(90vh - 40px);\n}\n.style_module_chatPopover__25135ae0.style_module_fullscreen__25135ae0 {\n bottom: 0;\n left: 60px;\n width: calc(100vw - 150px);\n height: 100vh;\n}\n.style_module_chatPopover__25135ae0.style_module_fullscreen__25135ae0 .style_module_chat__25135ae0 {\n height: calc(100vh - 50px);\n}\n.style_module_rightArrow__25135ae0 {\n position: fixed;\n right: 69px;\n bottom: 232px;\n z-index: 999;\n color: var(--chat-blue);\n font-size: 30px;\n}\n",{});var la=w((function(n,t){var o,r,c=n.token,d=n.agentIds,s=n.noInput,u=n.isDeveloper,m=n.integrateSystem,_=n.apiUrl,v=n.onReportMsgEvent,g=n.onOpenChatPage,y=p(!1),x=y[0],b=y[1],w=p(!1),N=w[0],S=w[1],C=p(),T=C[0],E=C[1],L=h();I(t,(function(){return{sendCopilotMsg:M}})),f((function(){c&&en(c)}),[c]),f((function(){_&&localStorage.setItem("SUPERSONIC_CHAT_API_URL",_)}),[_]);var M=function(e){var n;null===(n=null==L?void 0:L.current)||void 0===n||n.sendCopilotMsg(e),A(!0)},A=function(e){b(e)},k=G(ia.copilot,((o={})[ia.copilotMinimized]=N,o)),z=G(ia.chatPopover,((r={})[ia.c2System]="c2"===m,r));return i(l,{children:[i("div",e({className:k,onMouseEnter:function(){S(!1)},onClick:function(){A(!x)}},{children:[a(rn,{type:"icon-copilot-fill"}),a("div",e({className:ia.minimizeWrapper,onClick:function(e){e.stopPropagation(),A(!1),S(!0)}},{children:a("div",e({className:ia.minimize},{children:"-"}))}))]})),i("div",e({className:ia.copilotContent,style:{display:x?"block":"none"}},{children:[i("div",e({className:z},{children:[i("div",e({className:ia.header},{children:[i("div",e({className:ia.leftSection},{children:[a(ce,{className:ia.close,onClick:function(){A(!1)}}),g&&a(rn,{type:"icon-weibiaoti-",className:ia.transfer,onClick:function(){null==g||g(null==T?void 0:T.id)}})]})),a("div",e({className:ia.title},{children:"Copilot"}))]})),a("div",e({className:ia.chat},{children:a(aa,{chatVisible:x,agentIds:d,noInput:s,isDeveloper:u,integrateSystem:m,isCopilot:!0,onCurrentAgentChange:E,onReportMsgEvent:v,ref:L})}))]})),a(me,{className:ia.rightArrow})]}))]})}));export{aa as Chat,St as ChatItem,vt as ChatMsg,la as Copilot,oa as ShowCase,Qt as getAllConversations,Pt as saveConversation,Ln as searchRecommend,en as setToken};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { getToken } from '../utils/utils';
|
|
|
5
5
|
// 创建axios实例
|
|
6
6
|
const axiosInstance: AxiosInstance = axios.create({
|
|
7
7
|
// 设置基本URL,所有请求都会使用这个URL作为前缀
|
|
8
|
-
baseURL: 'https://
|
|
8
|
+
baseURL: 'https://supersonic-test.aisteel.com:9082',
|
|
9
9
|
// 设置请求超时时间(毫秒)
|
|
10
10
|
timeout: 120000,
|
|
11
11
|
// 设置请求头
|