@chatbi-v/xcml 2.1.0 → 2.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.cjs +16 -16
- package/dist/index.css +7 -4
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +14 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";var Jr=Object.create;var $e=Object.defineProperty;var Gr=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var Yr=Object.getPrototypeOf,Zr=Object.prototype.hasOwnProperty;var Qr=(t,e)=>{for(var n in e)$e(t,n,{get:e[n],enumerable:!0})},Dt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ur(e))!Zr.call(t,o)&&o!==n&&$e(t,o,{get:()=>e[o],enumerable:!(r=Gr(e,o))||r.enumerable});return t};var T=(t,e,n)=>(n=t!=null?Jr(Yr(t)):{},Dt(e||!t||!t.__esModule?$e(n,"default",{value:t,enumerable:!0}):n,t)),en=t=>Dt($e({},"__esModule",{value:!0}),t);var to={};Qr(to,{AntVChartLoader:()=>_e,COMMON_PROPS:()=>zt,DefaultEmptyPlaceholder:()=>Rt,DefaultErrorPlaceholder:()=>Xt,ThemeProvider:()=>xn,XCMLCardWrapper:()=>Fe,XCMLChart:()=>Xn,XCMLEventBus:()=>Ue,XCMLMarkdown:()=>et,XCML_SCHEMAS:()=>pe,buildConfig:()=>Tt,chartSchema:()=>me,cleanPropsBySchema:()=>Pt,columnChartSchema:()=>Me,columnStrategy:()=>St,createAntVRenderers:()=>Fn,createBasicRenderers:()=>Dn,createExtendedRenderers:()=>eo,createRenderersWithAliases:()=>se,deepMerge:()=>Xe,dualAxesChartSchema:()=>ke,dualAxesStrategy:()=>Mt,extractBaseStyles:()=>rn,funnelChartSchema:()=>Pe,funnelStrategy:()=>Lt,getChartStrategy:()=>kt,getTheme:()=>vt,lineChartSchema:()=>Ne,lineStrategy:()=>wt,mergePropsAndBody:()=>yt,normalizeNodeData:()=>ut,normalizeTagName:()=>Ye,parse:()=>Ze.parse,parseArrayProp:()=>ie,parseInlineData:()=>Ht,parseXCML:()=>dn,pieChartSchema:()=>Le,pieStrategy:()=>Nt,preprocessXCML:()=>gt,renderXCML:()=>nn,strategies:()=>dr,stringify:()=>Ze.stringify,stringifyToXCML:()=>cn,themeDark:()=>nr,themeLight:()=>rt,themeMap:()=>or,toXCMLNodeFromElement:()=>ye,toXCMLTag:()=>Te,toXTag:()=>Vt,useTheme:()=>Re,useXCMLComponent:()=>pt,useXCMLNode:()=>mt,validateDataSchema:()=>ln,validateXCMLNode:()=>on,withXCMLCard:()=>S,xTagPlugin:()=>yn,xcmlBus:()=>ue});module.exports=en(to);var Ge=require("yaml");var Ie={tag:"x-metric",title:"\u6307\u6807\u5361\u7247",description:"\u7528\u4E8E\u5C55\u793A\u5355\u4E00\u6838\u5FC3\u6570\u503C\u53CA\u5176\u8D8B\u52BF\u6216\u5907\u6CE8\u4FE1\u606F\uFF0C\u652F\u6301\u591A\u79CD\u5E03\u5C40\u548C\u6837\u5F0F\u53D8\u4F53\u3002",props:[{name:"title",type:"string",description:"\u6307\u6807\u540D\u79F0/\u6807\u9898",category:"required",required:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53\u6837\u5F0F",category:"style",options:["card","plain","compact"],default:"card"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u65B9\u5411",category:"layout",options:["horizontal","vertical"],default:"vertical"},{name:"icon",type:"string",description:"\u88C5\u9970\u56FE\u6807 (Emoji)",category:"style"},{name:"precision",type:"number",description:"\u6570\u503C\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",category:"style",default:0}],body:[{name:"value",type:"string",description:"\u6307\u6807\u6570\u503C",category:"required",required:!0},{name:"trend",type:"enum",description:"\u8D8B\u52BF\u65B9\u5411",category:"optional",options:["up","down","none"]},{name:"trendValue",type:"string",description:"\u8D8B\u52BF\u503C",category:"optional"},{name:"note",type:"string",description:"\u6307\u6807\u5907\u6CE8",category:"optional"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F",category:"optional"}],example:{props:{title:"\u6708\u5EA6\u51C0\u9500\u552E\u989D",variant:"card",layout:"vertical",precision:0,icon:"\u{1F4B0}"},body:{value:"1280000",trend:"up",trendValue:"+12.5%",note:"\u8F83\u4E0A\u6708\u589E\u957F 12.5%"},contentProp:"value"}};var Ee={tag:"xcml:table",title:"\u53EF\u89C6\u5316\u6570\u636E\u8868\u683C",description:"\u62A5\u8868\u7EA7\u6570\u636E\u8868\u683C\uFF0C\u652F\u6301\u8FDB\u5EA6\u6761\u3001\u8D8B\u52BF\u56FE\u7B49\u53EF\u89C6\u5316\u5217\u6E32\u67D3\uFF0C\u5168\u91CF\u5C55\u793A\u4E0D\u5206\u9875\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898",category:"style"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8FB9\u6846",category:"style",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"},{name:"size",type:"enum",description:"\u8868\u683C\u5C3A\u5BF8",category:"layout",options:["small","middle","large"],default:"middle"},{name:"summary",type:"boolean",description:"\u662F\u5426\u663E\u793A\u5408\u8BA1\u884C",category:"optional",default:!1}],body:[{name:"columns",type:"array",description:"\u5217\u5B9A\u4E49",category:"required",required:!0,items:[{name:"column",type:"object",description:"\u5217\u914D\u7F6E\u5BF9\u8C61",category:"required",properties:[{name:"title",type:"string",description:"\u5217\u6807\u9898",category:"required"},{name:"key",type:"string",description:"\u6570\u636E\u5B57\u6BB5\u952E\u540D",category:"required"},{name:"type",type:"enum",description:"\u6E32\u67D3\u7C7B\u578B",category:"style",options:["text","progress","trend","badge","image","link"]},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"width",type:"number",description:"\u5217\u5BBD",category:"layout"}]}]},{name:"rows",type:"array",description:"\u884C\u6570\u636E",category:"required",required:!0,items:[{name:"row",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61",category:"required"}]}],example:{props:{title:"\u5404\u533A\u57DF\u9500\u552E\u8FBE\u6210\u62A5\u8868",bordered:!1,size:"middle",summary:!0},body:{columns:[{title:"\u533A\u57DF",key:"region",align:"left"},{title:"\u9500\u552E\u989D",key:"sales",align:"right",type:"text"},{title:"\u76EE\u6807\u8FBE\u6210\u7387",key:"rate",align:"center",type:"progress"},{title:"\u8FD1\u671F\u8D8B\u52BF",key:"trend",align:"center",type:"trend"},{title:"\u72B6\u6001",key:"status",align:"center",type:"badge"}],rows:[{region:"\u534E\u4E1C\u533A",sales:"\xA51,250,000",rate:.92,trend:[10,20,15,30,40],status:"normal"},{region:"\u534E\u5317\u533A",sales:"\xA5980,000",rate:.78,trend:[30,20,25,10,15],status:"warning"},{region:"\u534E\u5357\u533A",sales:"\xA51,560,000",rate:1.12,trend:[20,30,40,50,60],status:"success"},{region:"\u897F\u90E8\u533A",sales:"\xA5420,000",rate:.45,trend:[10,8,5,12,10],status:"error"}]}}};var je={tag:"xcml:list",title:"\u7F51\u683C/\u5217\u8868\u5E03\u5C40",description:"\u901A\u7528\u5E03\u5C40\u5BB9\u5668\uFF0C\u652F\u6301 Grid \u548C List \u4E24\u79CD\u6A21\u5F0F\uFF0C\u9002\u5408\u6392\u7248\u591A\u4E2A\u5361\u7247\u3002",props:[{name:"title",type:"string",description:"\u5217\u8868\u6807\u9898"},{name:"header",type:"string",description:"\u5217\u8868\u9875\u7709\u6587\u672C"},{name:"footer",type:"string",description:"\u5217\u8868\u9875\u811A\u6587\u672C"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u6A21\u5F0F",options:["grid","list"],default:"grid"},{name:"columns",type:"number",description:"\u7F51\u683C\u5217\u6570 (Grid\u6A21\u5F0F\u6709\u6548)",default:3},{name:"gap",type:"number",description:"\u95F4\u8DDD",default:16},{name:"type",type:"enum",description:"\u5217\u8868\u9879\u9ED8\u8BA4\u7C7B\u578B",options:["text","metric"],default:"text"},{name:"stripe",type:"boolean",description:"\u662F\u5426\u5F00\u542F\u6591\u9A6C\u7EB9",default:!1}],body:[{name:"items",type:"array",description:"\u5217\u8868\u9879\u96C6\u5408",required:!0}],example:{props:{title:"\u7EDF\u8BA1\u6307\u6807",header:"\u6700\u8FD1\u4E00\u4E2A\u6708\u6570\u636E",footer:"\u6570\u636E\u6765\u6E90\uFF1A\u6570\u636E\u5E93",layout:"grid",columns:3,gap:16},body:{items:[{title:"\u7528\u6237\u589E\u957F",value:"+12%",type:"metric"},{title:"\u6D3B\u8DC3\u5EA6",value:"85%",type:"metric"},{title:"\u7559\u5B58\u7387",value:"42%",type:"metric"}]}}};var Be={tag:"xcml:card",title:"\u901A\u7528\u5361\u7247",description:"\u57FA\u7840\u5BB9\u5668\u5361\u7247\uFF0C\u652F\u6301\u6807\u9898\u3001\u63CF\u8FF0\u548C\u60AC\u6D6E\u6548\u679C\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898",category:"optional"},{name:"type",type:"enum",description:"\u5361\u7247\u7C7B\u578B",category:"style",options:["inner","default"],default:"default"},{name:"hoverable",type:"boolean",description:"\u662F\u5426\u652F\u6301\u60AC\u505C\u6548\u679C",category:"interaction",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"}],body:[{name:"description",type:"string",description:"\u5361\u7247\u63CF\u8FF0/\u6B63\u6587 (\u517C\u5BB9\u65E7\u5C5E\u6027)",category:"optional"},{name:"content",type:"string",description:"\u5361\u7247\u4E3B\u8981\u5185\u5BB9 (\u652F\u6301 Markdown)",category:"required",required:!0}],example:{props:{type:"default",hoverable:!0,variant:"card",title:"\u63D0\u793A\u4FE1\u606F",theme:"light"},body:{description:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u793A\u4F8B",content:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u5BB9\u5668\uFF0C\u53EF\u4EE5\u7528\u6765\u5305\u88F9\u7B80\u5355\u7684\u6587\u672C\u6216\u4F5C\u4E3A\u5176\u4ED6\u7EC4\u4EF6\u7684\u5360\u4F4D\u3002"},contentProp:"content"}};var De={tag:"xcml:toc",title:"\u6587\u6863\u76EE\u5F55",description:"\u81EA\u52A8\u63D0\u53D6\u6587\u6863\u4E2D\u7684 H2-H6 \u6807\u9898\u751F\u6210\u53EF\u8DF3\u8F6C\u7684\u76EE\u5F55\u3002",props:[{name:"title",type:"string",description:"\u76EE\u5F55\u6807\u9898",default:"\u76EE\u5F55"}],example:{props:{title:"\u5185\u5BB9\u5927\u7EB2"}}};var Ne={tag:"x-line-chart",title:"\u6298\u7EBF\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u8FDE\u7EED\u65F6\u95F4\u8DE8\u5EA6\u4E0B\u7684\u6570\u636E\u8D8B\u52BF\u3002",props:[],body:[{name:"data",type:"array",description:"\u6298\u7EBF\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"x\u8F74\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"y\u8F74\u5B57\u6BB5",default:"value",required:!0},{name:"seriesField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",default:"type"}],example:{props:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF"},body:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF",xField:"category",yField:"value",seriesField:"type",data:[{category:"A",value:10,type:"T1"},{category:"B",value:20,type:"T1"}]}}};var Me={tag:"x-column-chart",title:"\u67F1\u72B6\u56FE",description:"\u7528\u4E8E\u6BD4\u8F83\u4E0D\u540C\u5206\u7C7B\u4E4B\u95F4\u7684\u6570\u636E\u5DEE\u5F02\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5 (\u5206\u7C7B)",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5 (\u6570\u503C)",category:"required",required:!0},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u5206\u7EC4)",category:"optional"},{name:"colorField",type:"string",description:"\u989C\u8272\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"stack",type:"any",description:"\u662F\u5426\u5806\u53E0",category:"layout"},{name:"group",type:"any",description:"\u662F\u5426\u5206\u7EC4\u663E\u793A",category:"layout"},{name:"percent",type:"boolean",description:"\u662F\u5426\u767E\u5206\u6BD4\u5C55\u793A",category:"layout"},{name:"conversionTag",type:"object",description:"\u8F6C\u5316\u7387\u914D\u7F6E",category:"style"},{name:"markBackground",type:"object",description:"\u5143\u7D20\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{title:"\u5404\u533A\u57DF\u5E74\u5EA6\u9500\u552E\u5206\u6790"},body:{xField:"region",yField:"sales",seriesField:"year",stack:!0,label:{text:"sales",position:"inside"},data:[{region:"\u534E\u4E1C",year:"2022",sales:4500},{region:"\u534E\u4E1C",year:"2023",sales:5200},{region:"\u534E\u5317",year:"2022",sales:3800},{region:"\u534E\u5317",year:"2023",sales:4100},{region:"\u534E\u5357",year:"2022",sales:4200},{region:"\u534E\u5357",year:"2023",sales:4800}]}}};var Le={tag:"x-pie-chart",title:"\u997C\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u5206\u7C7B\u6570\u636E\u7684\u5360\u6BD4\u60C5\u51B5\u3002",props:[],body:[{name:"colorField",type:"string",description:"\u5206\u7C7B\u5B57\u6BB5",category:"required",required:!0},{name:"angleField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"radius",type:"number",description:"\u534A\u5F84",category:"layout"},{name:"innerRadius",type:"number",description:"\u5185\u534A\u5F84 (\u73AF\u56FE)",category:"layout"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["outside","inside"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"connector",type:"any",description:"\u8FDE\u63A5\u7EBF\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style",properties:[{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]},{name:"title",type:"any",description:"\u6807\u9898",category:"style"},{name:"layout",type:"object",description:"\u5E03\u5C40",category:"style"},{name:"itemMarker",type:"any",description:"\u6807\u8BB0\u5F62\u72B6",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{},body:{colorField:"type",angleField:"value",data:[{type:"A",value:40},{type:"B",value:60}]}}};var ke={tag:"x-dual-axes-chart",title:"\u53CC\u8F74\u56FE",description:"\u7528\u4E8E\u5728\u540C\u4E00\u56FE\u8868\u4E2D\u5C55\u793A\u4E24\u4E2A\u4E0D\u540C\u91CF\u7EB2\u7684\u6570\u636E\u7CFB\u5217\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"children",type:"array",description:"\u5B50\u56FE\u5C42\u914D\u7F6E\u6570\u7EC4",category:"required",required:!0,transform:(t,e)=>Array.isArray(t)?t.map(n=>{!n.xField&&e.xField&&(n.xField=e.xField);let r=n.xField||"x",o=n.scale||{},a=o[r]||{};return(n.type==="interval"||!a.type)&&(a.type="band"),{...n,scale:{...o,[r]:a}}}):t,items:[{name:"properties",type:"object",description:"\u5B50\u56FE\u5C42\u914D\u7F6E",category:"required",properties:[{name:"type",type:"enum",description:"\u56FE\u5C42\u7C7B\u578B",category:"required",options:["interval","line","area","point"],required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u522B\u540D)",category:"optional"},{name:"shapeField",type:"string",description:"\u5F62\u72B6\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"group",type:"boolean",description:"\u662F\u5426\u5206\u7EC4",category:"layout"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"data",type:"array",description:"\u5B50\u56FE\u5C42\u72EC\u7ACB\u6570\u636E\u6E90",category:"required"},{name:"axis",type:"object",description:"\u8BE5\u56FE\u5C42\u7684\u8F74\u914D\u7F6E",category:"style",properties:[{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]}]}]},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","middle","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{xField:"month",children:[{type:"interval",yField:"sales",label:{position:"middle"}},{type:"line",yField:"rate",label:{position:"top"},style:{stroke:"#5AD8A6",lineWidth:2}}],axis:{y:[{title:{text:"\u9500\u552E\u989D"}},{title:{text:"\u5229\u6DA6\u7387"},position:"right"}]},data:[{month:"1\u6708",sales:450,rate:.12},{month:"2\u6708",sales:520,rate:.15},{month:"3\u6708",sales:480,rate:.14},{month:"4\u6708",sales:610,rate:.18},{month:"5\u6708",sales:580,rate:.16}]},body:{xField:"time",yField:["value","count"],data:[{time:"2021-01",value:10,count:5},{time:"2021-02",value:20,count:10}]}}};var Pe={tag:"x-funnel-chart",title:"\u6F0F\u6597\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u4E1A\u52A1\u6D41\u7A0B\u4E2D\u5404\u9636\u6BB5\u7684\u6570\u636E\u8F6C\u5316\u60C5\u51B5\u3002",props:[],body:[{name:"data",type:"array",description:"\u6F0F\u6597\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"\u7C7B\u522B\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",default:"value",required:!0}],example:{props:{},body:{xField:"category",yField:"value",data:[{category:"A",value:100},{category:"B",value:80}]}}};var Wt={line:Ne,column:Me,pie:Le,"dual-axes":ke,funnel:Pe};function qt(t,e){let n=new Map;return Object.entries(t).forEach(([r,o])=>{(o[e]||[]).forEach(i=>{if(["type","data","xField","yField","colorField","seriesField","title","label","axis","legend","tooltip","scale","interaction","theme"].includes(i.name))return;let d=n.get(i.name);d?d.types.push(r):n.set(i.name,{def:i,types:[r]})})}),Array.from(n.values()).map(({def:r,types:o})=>({...r,visibleIf:a=>o.includes(a.type)?r.visibleIf?r.visibleIf(a):!0:!1}))}var me={tag:"xcml:chart",title:"AntV \u901A\u7528\u56FE\u8868",description:"\u5168\u529F\u80FD\u56FE\u8868\u7EC4\u4EF6\u5BB9\u5668\uFF0C\u652F\u6301\u901A\u8FC7 type \u52A8\u6001\u5207\u6362\u6298\u7EBF\u56FE\u3001\u67F1\u72B6\u56FE\u3001\u997C\u56FE\u7B49\u3002",props:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",category:"required",required:!0,options:["line","column","pie","dual-axes","funnel"],default:"line"},...qt(Wt,"props")],body:[{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u989C\u8272/\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5",category:"optional"},{name:"title",type:"object",description:"\u56FE\u8868\u6807\u9898",category:"style"},{name:"label",type:"object",description:"\u6570\u636E\u6807\u7B7E",category:"style"},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style"},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u63D0\u793A\u4FE1\u606F",category:"interaction"},{name:"scale",type:"object",description:"\u5EA6\u91CF\u914D\u7F6E",category:"optional"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"theme",type:"string",description:"\u56FE\u8868\u4E3B\u9898",category:"style"},...qt(Wt,"body")],example:{props:{type:"line",theme:"light"},body:{xField:"year",yField:"value",seriesField:"category",data:[{year:"1991",value:3,category:"A"},{year:"1992",value:4,category:"A"},{year:"1993",value:3.5,category:"A"},{year:"1994",value:5,category:"A"},{year:"1995",value:4.9,category:"A"},{year:"1996",value:6,category:"A"},{year:"1997",value:7,category:"A"},{year:"1998",value:9,category:"A"},{year:"1999",value:13,category:"A"},{year:"1991",value:3,category:"B"},{year:"1992",value:4,category:"B"},{year:"1993",value:3.5,category:"B"},{year:"1994",value:5,category:"B"},{year:"1995",value:4.9,category:"B"},{year:"1996",value:6,category:"B"},{year:"1997",value:7,category:"B"},{year:"1998",value:9,category:"B"},{year:"1999",value:13,category:"B"}]}}};var We={tag:"xcml:insight-card",title:"\u6D1E\u5BDF\u5361\u7247 (Pro)",description:"\u5168\u91CF\u5C55\u793A\u7684\u6D1E\u5BDF\u5361\u7247\uFF0C\u652F\u6301\u5F15\u7528\u6765\u6E90\u4E0E\u884C\u52A8\u5EFA\u8BAE\u3002",props:[{name:"title",type:"string",description:"\u6D1E\u5BDF\u6807\u9898"},{name:"sentiment",type:"enum",description:"\u60C5\u611F\u503E\u5411",options:["positive","negative","neutral","insight","warning","success","error"],default:"insight"},{name:"icon",type:"string",description:"\u56FE\u6807 (Emoji \u6216 AntD Icon \u540D\u79F0)"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"actions",type:"array",description:"\u5EFA\u8BAE\u884C\u52A8\u5217\u8868"},{name:"citations",type:"array",description:"\u5F15\u7528\u6765\u6E90\u5217\u8868"},{name:"highlights",type:"array",description:"\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u5217\u8868"},{name:"content",type:"string",description:"\u6D1E\u5BDF\u6B63\u6587\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"}],example:{props:{title:"\u5E93\u5B58\u9884\u8B66\uFF1A\u70ED\u95E8\u5546\u54C1\u7F3A\u8D27\u98CE\u9669",sentiment:"warning"},body:{highlights:["3 \u5929\u5185\u552E\u7F44","\u7ACB\u5373\u542F\u52A8\u8865\u8D27"],citations:["\u5E93\u5B58\u7BA1\u7406\u7CFB\u7EDF","\u9500\u552E\u9884\u6D4B\u6A21\u578B"],actions:["\u751F\u6210\u8865\u8D27\u5355","\u6682\u505C\u5E7F\u544A\u6295\u653E"],content:"\u6839\u636E\u5F53\u524D\u9500\u552E\u901F\u7387\uFF0CiPhone 15 Pro Max \u5C06\u5728 3 \u5929\u5185\u552E\u7F44\u3002\u5EFA\u8BAE\u7ACB\u5373\u542F\u52A8\u8865\u8D27\u6D41\u7A0B\uFF0C\u5E76\u8C03\u6574\u5E7F\u544A\u6295\u653E\u7B56\u7565\u4EE5\u907F\u514D\u8D85\u5356\u3002"},contentProp:"content"}};var qe={tag:"xcml:interactive-summary",title:"\u4EA4\u4E92\u5F0F\u6C47\u603B",description:"\u5E26\u64CD\u4F5C\u6309\u94AE\u7684\u6570\u503C\u6C47\u603B\u5361\u7247\uFF0C\u652F\u6301\u5B9E\u65F6\u8C03\u6574\u6570\u503C\u5E76\u89E6\u53D1\u4E1A\u52A1\u56DE\u8C03\u3002",props:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",default:"\u8C03\u6574\u76EE\u6807"},{name:"value",type:"number",description:"\u521D\u59CB\u6570\u503C",default:0},{name:"step",type:"number",description:"\u8C03\u6574\u6B65\u957F",default:1},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"actionId",type:"string",description:"\u89E6\u53D1\u56DE\u8C03\u7684\u4E8B\u4EF6 ID",default:"update_target"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"content",type:"string",description:"\u6C47\u603B\u6587\u672C\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"},{name:"highlightKeywords",type:"array",description:"\u6587\u672C\u4E2D\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u6570\u7EC4"},{name:"trendData",type:"array",itemType:"number",description:"\u80CC\u666F\u8D8B\u52BF\u56FE\u6570\u636E"}],example:{props:{label:"\u5B63\u5EA6\u9500\u552E\u76EE\u6807",value:5e3,unit:"k",step:100,actionId:"set_sales_target"},body:{trendData:[10,20,15,30,40,35,50],content:"\u6839\u636E\u5F53\u524D\u4E1A\u52A1\u589E\u957F\uFF0C\u5EFA\u8BAE\u5C06\u76EE\u6807\u8BBE\u5B9A\u5728 5000k \u4EE5\u4E0A\u3002"},contentProp:"content"}};var ze={tag:"x-metric-card",title:"\u590D\u5408\u6307\u6807\u5361",description:"\u589E\u5F3A\u578B\u6307\u6807\u5C55\u793A\uFF0C\u652F\u6301\u6570\u503C\u52A8\u753B\u3001\u5355\u4F4D\u3001\u524D\u7F00\u4EE5\u53CA\u540C\u6BD4/\u73AF\u6BD4\u8D8B\u52BF\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898"},{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0 (title \u7684\u522B\u540D)"},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"prefix",type:"string",description:"\u6570\u503C\u524D\u7F00"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F"},{name:"precision",type:"number",description:"\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",default:2},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"value",type:"number",description:"\u6838\u5FC3\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"yoy",type:"number",description:"\u540C\u6BD4\u589E\u957F\u7387 (%)"}],example:{props:{label:"\u6D3B\u8DC3\u7528\u6237",unit:"\u4EBA"},body:{value:84200,wow:12.5},contentProp:"value"}};var Ve={tag:"xcml:mini-kpi-strip",title:"\u8FF7\u4F60\u6307\u6807\u6761",description:"\u7D27\u51D1\u7684\u6A2A\u5411\u6307\u6807\u6392\u5217\uFF0C\u652F\u6301\u8FF7\u4F60\u8D8B\u52BF\u56FE\uFF08Sparkline\uFF09\u548C\u73AF\u6BD4\u5C55\u793A\u3002",props:[],body:[{name:"items",type:"array",description:"\u6307\u6807\u9879\u5217\u8868",items:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",required:!0},{name:"value",type:"string",description:"\u6307\u6807\u5F53\u524D\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"trendData",type:"array",itemType:"number",description:"\u8FF7\u4F60\u8D8B\u52BF\u56FE\u6570\u636E\u70B9\u6570\u7EC4"}]}],example:{body:{items:[{label:"\u8425\u6536",value:"\xA51.2M",wow:12,trendData:[10,20,15,30,40]},{label:"\u7528\u6237",value:"85.2K",wow:-5,trendData:[50,40,45,35,30]},{label:"\u8F6C\u5316\u7387",value:"3.2%",wow:2,trendData:[2,3,2.5,3.1,3.2]},{label:"\u6D3B\u8DC3\u5EA6",value:"92%",wow:0,trendData:[90,91,92,90,92]}]}}};var He={tag:"xcml:poster-card",title:"\u6570\u636E\u6D77\u62A5",description:"\u7F8E\u89C2\u7684\u6570\u636E\u53EF\u89C6\u5316\u6D77\u62A5\uFF0C\u652F\u6301\u591A\u79CD\u56FE\u8868\u7EC4\u5408\u3001\u4E8C\u7EF4\u7801\u5C55\u793A\u53CA\u4E00\u952E\u4E0B\u8F7D\u56FE\u7247\u3002",props:[{name:"title",type:"string",description:"\u6D77\u62A5\u6807\u9898",default:"\u6570\u636E\u6D77\u62A5"},{name:"subTitle",type:"string",description:"\u6D77\u62A5\u526F\u6807\u9898",default:"Data Insight Poster"},{name:"themeColor",type:"string",description:"\u6D77\u62A5\u4E3B\u9898\u8272"},{name:"backgroundImage",type:"string",description:"\u80CC\u666F\u56FE\u7247 URL"},{name:"qrCode",type:"string",description:"\u4E8C\u7EF4\u7801\u5185\u5BB9",default:"https://ant.design"},{name:"author",type:"string",description:"\u4F5C\u8005",default:"ChatBI"},{name:"date",type:"string",description:"\u65E5\u671F"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"charts",type:"array",description:"\u5305\u542B\u5728\u6D77\u62A5\u4E2D\u7684\u56FE\u8868\u5217\u8868",items:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",options:["column","line","pie"],required:!0},{name:"title",type:"string",description:"\u56FE\u8868\u6807\u9898"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6570\u7EC4",required:!0,items:[{name:"label",type:"string",description:"\u7EF4\u5EA6\u540D\u79F0",required:!0},{name:"value",type:"number",description:"\u6307\u6807\u6570\u503C",required:!0}]}]}],example:{props:{title:"\u53CC\u5341\u4E00\u9500\u552E\u6218\u62A5",subTitle:"2023 \u6838\u5FC3\u6307\u6807\u56DE\u987E",author:"\u6570\u636E\u5206\u6790\u56E2\u961F"},body:{charts:[{type:"pie",title:"\u5404\u6E20\u9053\u5360\u6BD4",data:[{label:"\u76F4\u64AD",value:45},{label:"\u641C\u7D22",value:30},{label:"\u5176\u4ED6",value:25}]},{type:"column",title:"\u8FD1 7 \u65E5\u8D8B\u52BF",data:[{label:"11.01",value:120},{label:"11.02",value:150},{label:"11.03",value:200}]}]}}};var Ke={tag:"xcml:snapshot-table",title:"\u5FEB\u7167\u8868\u683C",description:"\u8F7B\u91CF\u7EA7\u6570\u636E\u5FEB\u7167\uFF0C\u652F\u6301 CSV \u5BFC\u51FA\u548C\u6EDA\u52A8\u67E5\u770B\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898\u3002\u6CE8\u610F\uFF1A\u5982\u679C SnapshotTable \u88AB\u5305\u88F9\u5728 Card \u4E2D\u4E14 Card \u5DF2\u8BBE\u7F6E\u6807\u9898\uFF0C\u6B64\u6807\u9898\u5C06\u81EA\u52A8\u9690\u85CF\u4EE5\u907F\u514D\u91CD\u590D\u3002"},{name:"description",type:"string",description:"\u8868\u683C\u63CF\u8FF0\uFF0C\u5C55\u793A\u5728\u6807\u9898\u4E0B\u65B9\u6216\u7EC4\u4EF6\u9876\u90E8\u3002"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8868\u683C\u5185\u90E8\u8FB9\u6846",default:!0}],body:[{name:"columns",type:"array",description:"\u8868\u683C\u5217\u5B9A\u4E49",items:[{name:"title",type:"string",description:"\u5217\u6807\u9898",required:!0},{name:"key",type:"string",description:"\u6570\u636E\u5BF9\u5E94\u5B57\u6BB5",required:!0},{name:"width",type:"number",description:"\u5217\u5BBD"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",options:["left","center","right"]}]},{name:"rows",type:"array",description:"\u8868\u683C\u884C\u6570\u636E",items:[{name:"properties",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61\uFF0C\u952E\u503C\u9700\u5BF9\u5E94 columns \u4E2D\u7684 key"}]}],example:{props:{title:"\u5B9E\u65F6\u5E93\u5B58\u5FEB\u7167"},body:{columns:[{title:"\u5546\u54C1\u540D",key:"name"},{title:"\u5E93\u5B58\u91CF",key:"stock"},{title:"\u9884\u8B66\u7EBF",key:"threshold"}],rows:[{name:"iPhone 15",stock:120,threshold:50},{name:"iPad Air",stock:45,threshold:30},{name:"MacBook Pro",stock:12,threshold:20}]}}};var Je={tag:"xcml:thought-chain",title:"\u601D\u7EF4\u94FE (Timeline)",description:"\u5168\u5C55\u5F00\u7684\u65F6\u95F4\u8F74\u5F0F\u601D\u7EF4\u94FE\uFF0C\u5C55\u793A\u6267\u884C\u8017\u65F6\u4E0E\u8BE6\u7EC6\u7ED3\u679C\u3002",props:[{name:"title",type:"string",description:"\u601D\u7EF4\u94FE\u6807\u9898",default:"\u5206\u6790\u8FC7\u7A0B"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"steps",type:"array",description:"\u6267\u884C\u6B65\u9AA4\u5217\u8868",items:[{name:"tool",type:"string",description:"\u4F7F\u7528\u7684\u5DE5\u5177\u540D\u79F0"},{name:"action",type:"string",description:"\u6267\u884C\u7684\u64CD\u4F5C\u63CF\u8FF0"},{name:"status",type:"enum",description:"\u6267\u884C\u72B6\u6001",options:["success","running","pending","error"]},{name:"duration",type:"string",description:"\u8017\u65F6\u63CF\u8FF0"},{name:"thought",type:"string",description:"\u601D\u8003\u8FC7\u7A0B/\u65E5\u5FD7"},{name:"result",type:"string",description:"\u6267\u884C\u7ED3\u679C\u6458\u8981"},{name:"error",type:"string",description:"\u9519\u8BEF\u4FE1\u606F"}]}],example:{props:{title:"\u667A\u80FD\u5206\u6790\u6267\u884C\u8DEF\u5F84"},body:{steps:[{tool:"SQL Generator",action:"\u751F\u6210\u67E5\u8BE2\u8BED\u53E5",duration:"120ms",status:"success",thought:"\u6839\u636E\u7528\u6237\u610F\u56FE\uFF0C\u9700\u8981\u67E5\u8BE2 2023 \u5E74\u540E\u7684\u9500\u552E\u6570\u636E\u3002",result:'SELECT * FROM sales WHERE date > "2023-01-01"'},{tool:"Data Query",action:"\u6267\u884C\u6570\u636E\u5E93\u67E5\u8BE2",duration:"1.2s",status:"success",thought:"\u6B63\u5728\u8FDE\u63A5\u751F\u4EA7\u5E93\u6267\u884C\u67E5\u8BE2...",result:"Total rows: 1250"},{tool:"Analysis",action:"\u8BA1\u7B97\u540C\u6BD4\u589E\u957F\u7387",duration:"45ms",status:"success",thought:"\u5BF9\u6BD4\u53BB\u5E74\u540C\u671F\u6570\u636E\u8FDB\u884C\u8BA1\u7B97\u3002",result:"YoY Growth: +15.2%"}]}}};var zt=[{name:"theme",type:"enum",description:"\u7EC4\u4EF6\u89C6\u89C9\u4E3B\u9898\u98CE\u683C",category:"style",options:["light","dark","ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyber"],default:void 0}],tn={"xcml:metric":Ie,"xcml:table":Ee,"xcml:chart":me,"xcml:list":je,"xcml:thought-chain":Je,"xcml:insight-card":We,"xcml:metric-card":ze,"xcml:card":Be,"xcml:toc":De,"xcml:poster-card":He,"xcml:mini-kpi-strip":Ve,"xcml:interactive-summary":qe,"xcml:snapshot-table":Ke},pe=Object.fromEntries(Object.entries(tn).map(([t,e])=>[t,{...e,props:[...e.props||[],...zt]}]));var Ze=require("yaml");function rn(t){let{theme:e,variant:n,size:r,className:o,style:a}=t;return{theme:e,variant:n,size:r,className:o,style:a}}function mt(t,e){let n=t.props||{},r=t.body!==void 0?t.body:t.data,o=(t.props||{})["data-xcml-raw"];if(o)try{r=decodeURIComponent(escape(atob(o)))}catch(s){console.warn("[XCML] Failed to decode data-xcml-raw:",s)}if(typeof r=="string"){let s=r.trim();if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{r=JSON.parse(s)}catch{}}let a={};if(e&&((e.props||[]).forEach(s=>{s.default!==void 0&&(a[s.name]=s.default)}),(e.body||[]).forEach(s=>{s.default!==void 0&&(a[s.name]=s.default)})),r!=null)if(typeof r=="object"&&!Array.isArray(r))Object.assign(a,r),Array.isArray(r.data)&&(a.data=r.data);else if(Array.isArray(r)){let s=(e?.body||[]).find(d=>d.type==="array")?.name||"data";a[s]=r}else{let s=e?.example?.contentProp||(e?.body||[]).find(d=>d.name==="content"||d.name==="value")?.name||"content";a[s]=r}return Object.assign(a,n),["theme","variant","layout","size"].forEach(s=>{a[s]===void 0&&n[s]!==void 0&&(a[s]=n[s])}),a}var ie=t=>{if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();if(!e)return[];if(e.startsWith("["))try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/'/g,'"'))}catch{}}return e.split(/[,,]/).map(n=>n.trim()).filter(Boolean)}return[]};function se(t,e={}){let n={};return Object.entries(t).forEach(([r,o])=>{n[`xcml:${r}`]=o,e[r]&&e[r].forEach(a=>{n[`xcml:${a}`]=o})}),n}var nn=(t,e="xcml-node")=>{if(!t||!t.type||!pe[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function on(t,e){let n=[],r=t.props||{};if(e.props.forEach(o=>{o.required&&(r[o.name]===void 0||r[o.name]===null||r[o.name]==="")&&n.push(`\u5C5E\u6027 '${o.name}' (${o.description}) \u662F\u5FC5\u586B\u9879`)}),e.props.forEach(o=>{let a=r[o.name];a!=null&&(o.type==="number"&&isNaN(Number(a))&&n.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u6570\u5B57\u7C7B\u578B`),o.type==="boolean"&&typeof a!="boolean"&&a!=="true"&&a!=="false"&&n.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u5E03\u5C14\u7C7B\u578B`),o.type==="enum"&&o.options&&!o.options.includes(a)&&n.push(`\u5C5E\u6027 '${o.name}' \u7684\u503C '${a}' \u4E0D\u5728\u53EF\u9009\u8303\u56F4\u5185: ${o.options.join(", ")}`))}),e.body&&e.body.length>0){let o=t.body!==void 0?t.body:t.data;e.body.forEach(a=>{a.required&&(o==null||o===""?n.push("\u6807\u7B7E\u4F53\u5185\u5BB9 (Body Data) \u662F\u5FC5\u586B\u9879"):typeof o=="object"&&!Array.isArray(o)&&(o[a.name]===void 0||o[a.name]===null||o[a.name]==="")&&n.push(`\u6807\u7B7E\u4F53\u5185\u5BB9\u5E94\u5305\u542B '${a.name}' (${a.description}) \u5B57\u6BB5`))})}return{valid:n.length===0,errors:n}}function pt(t,e){let{node:n,streamStatus:r}=t,o=mt(n,e),a=n?.streamStatus||r||o.streamStatus,i=a==="loading"||n?.body?.["data-xcml-loading"]==="true"||n?.data?.["data-xcml-loading"]==="true"||n?.props?.["data-xcml-loading"]==="true"||o?.["data-xcml-loading"]==="true"||t.loading,s={theme:o.theme,variant:o.variant,size:o.size,className:t.className,style:t.style,loading:i,streamStatus:a,error:t.error};return{merged:o,baseProps:s,isLoading:i,streamStatus:a}}function Ye(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Vt(t){return`x-${Ye(t)}`}function Te(t){return`xcml:${Ye(t)}`}var Ue=class{constructor(){this.listeners={}}on(e,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(n)}emit(e,n){(this.listeners[e]||[]).forEach(r=>r(n))}refresh(e){this.emit("refresh",{id:e})}update(e,n){this.emit("update",{id:e,payload:n})}resize(e){this.emit("resize",{id:e})}export(e,n){this.emit("export",{id:e,type:n})}},ue=new Ue,an=/\/\/(.*)$/gm,sn=/\/\*[\s\S]*?\*\//g;function Ht(t,e="json"){let n=t.trim();if(!n)return null;if((e==="json"||e==="jsonc")&&!(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]")))return n;try{if(e==="json"||e==="jsonc"){let r=e==="jsonc"?n.replace(an,"").replace(sn,""):n;try{return JSON.parse(r)}catch(o){try{let a=(0,Ge.parse)(r);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return(0,Ge.parse)(n);if(e==="csv"||e==="tsv"){let r=e==="csv"?",":" ",o=n.split(/\r?\n/).filter(i=>i.trim());if(o.length===0)return[];let a=o[0].split(r).map(i=>i.trim());return o.slice(1).map(i=>{let s=i.split(r),d={};return a.forEach((m,p)=>{let c=s[p]?.trim();c==="true"?c=!0:c==="false"?c=!1:c!==""&&!isNaN(Number(c))&&(c=Number(c)),d[m]=c}),d})}return e==="ndjson"?n.split(/\r?\n/).filter(Boolean).map(r=>JSON.parse(r)):JSON.parse(n)}catch(r){throw r}}function ln(t,e){return e!=null}function ut(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let n=Te(t),r=pe[n];if(!r)return e;let o={...e};return[...r.props||[],...r.body||[]].forEach(i=>{let s=o[i.name];if((i.type==="object"||i.type==="array")&&typeof s=="string")try{let d=s.trim();if(d.startsWith("{")||d.startsWith("[")){let m=d,p=0;for(;typeof m=="string"&&p<2;){let c=JSON.parse(m);if(c===null||typeof c!="object")if(typeof c=="string"&&(c.startsWith("{")||c.startsWith("[")))m=c;else break;else{m=c;break}p++}o[i.name]=m}}catch{}}),o}function yt(t,e,n,r={}){let o=Te(t),a=pe[o],i={},s={},{preferBody:d=!1}=r,m=Kt(n),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(h=>h.name==="content"||h.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(y=>{/^\d+$/.test(y)||(s[y]=p[y])});let c={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:n};let l=new Set((a.props||[]).map(y=>y.name)),u=new Set((a.body||[]).map(y=>y.name));for(let[y,h]of Object.entries(c))/^\d+$/.test(y)||(d?l.has(y)||u.has(y)?s[y]=h:y in e?i[y]=h:s[y]=h:l.has(y)?i[y]=h:u.has(y)?s[y]=h:y in e?i[y]=h:s[y]=h);let b=s;if(Array.isArray(m))if(Object.keys(s).length===0)b=m;else{let y=(a.body||[]).find(h=>h.type==="array")?.name||"data";s[y]=m,b=s}return{props:ut(o,i),body:ut(o,b)}}function Kt(t){if(Array.isArray(t))return t;if(t&&typeof t=="object"){let e=Object.keys(t).filter(n=>/^\d+$/.test(n)).sort((n,r)=>Number(n)-Number(r));if(e.length>0&&e.length===Object.keys(t).length&&e.every((n,r)=>Number(n)===r))return e.map(n=>t[n])}return t}function cn(t){let e=Te(t.tag||t.type||"unknown"),n=Vt(e),r={...t.props||{}},o=Kt(t.body),{body:a}=yt(e,r,o,{preferBody:!0}),i=[],s=a,d=Object.keys(a||{});d.length===1&&d[0]==="data"&&Array.isArray(a.data)&&(s=a.data);let m=i.length>0?" "+i.join(" "):"",p=JSON.stringify(s,null,2);return`<${n}${m}>
|
|
1
|
+
"use strict";var tn=Object.create;var je=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var on=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var sn=(t,e)=>{for(var r in e)je(t,r,{get:e[r],enumerable:!0})},Kt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nn(e))!an.call(t,o)&&o!==r&&je(t,o,{get:()=>e[o],enumerable:!(n=rn(e,o))||n.enumerable});return t};var F=(t,e,r)=>(r=t!=null?tn(on(t)):{},Kt(e||!t||!t.__esModule?je(r,"default",{value:t,enumerable:!0}):r,t)),ln=t=>Kt(je({},"__esModule",{value:!0}),t);var lo={};sn(lo,{AntVChartLoader:()=>$e,COMMON_PROPS:()=>Ut,DefaultEmptyPlaceholder:()=>Et,DefaultErrorPlaceholder:()=>$t,ThemeProvider:()=>Ln,XCMLCardWrapper:()=>Oe,XCMLChart:()=>In,XCMLEventBus:()=>Qe,XCMLLayoutProvider:()=>wt,XCMLMarkdown:()=>nt,XCML_SCHEMAS:()=>fe,buildConfig:()=>Ot,chartSchema:()=>ge,cleanPropsBySchema:()=>_t,columnChartSchema:()=>Pe,columnStrategy:()=>Rt,createAntVRenderers:()=>jn,createBasicRenderers:()=>Jn,createExtendedRenderers:()=>so,createRenderersWithAliases:()=>me,deepMerge:()=>_e,dualAxesChartSchema:()=>Te,dualAxesStrategy:()=>Xt,extractBaseStyles:()=>dn,funnelChartSchema:()=>Xe,funnelStrategy:()=>Ft,getChartStrategy:()=>At,getTheme:()=>kt,lineChartSchema:()=>ke,lineStrategy:()=>Pt,mergePropsAndBody:()=>ht,normalizeNodeData:()=>ft,normalizeTagName:()=>et,parse:()=>tt.parse,parseArrayProp:()=>de,parseInlineData:()=>Zt,parseXCML:()=>hn,pieChartSchema:()=>Re,pieStrategy:()=>Tt,preprocessXCML:()=>bt,renderXCML:()=>mn,strategies:()=>hr,stringify:()=>tt.stringify,stringifyToXCML:()=>fn,themeDark:()=>dr,themeLight:()=>at,themeMap:()=>mr,toXCMLNodeFromElement:()=>be,toXCMLTag:()=>Fe,toXTag:()=>Yt,useTheme:()=>Ae,useXCMLComponent:()=>gt,useXCMLLayout:()=>St,useXCMLNode:()=>yt,validateDataSchema:()=>gn,validateXCMLNode:()=>pn,withXCMLCard:()=>w,xTagPlugin:()=>vn,xcmlBus:()=>he});module.exports=ln(lo);var Ze=require("yaml");var Be={tag:"x-metric",title:"\u6307\u6807\u5361\u7247",description:"\u7528\u4E8E\u5C55\u793A\u5355\u4E00\u6838\u5FC3\u6570\u503C\u53CA\u5176\u8D8B\u52BF\u6216\u5907\u6CE8\u4FE1\u606F\uFF0C\u652F\u6301\u591A\u79CD\u5E03\u5C40\u548C\u6837\u5F0F\u53D8\u4F53\u3002",props:[{name:"title",type:"string",description:"\u6307\u6807\u540D\u79F0/\u6807\u9898",category:"required",required:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53\u6837\u5F0F",category:"style",options:["card","plain","compact"],default:"card"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u65B9\u5411",category:"layout",options:["horizontal","vertical"],default:"vertical"},{name:"icon",type:"string",description:"\u88C5\u9970\u56FE\u6807 (Emoji)",category:"style"},{name:"precision",type:"number",description:"\u6570\u503C\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",category:"style",default:0}],body:[{name:"value",type:"string",description:"\u6307\u6807\u6570\u503C",category:"required",required:!0},{name:"trend",type:"enum",description:"\u8D8B\u52BF\u65B9\u5411",category:"optional",options:["up","down","none"]},{name:"trendValue",type:"string",description:"\u8D8B\u52BF\u503C",category:"optional"},{name:"note",type:"string",description:"\u6307\u6807\u5907\u6CE8",category:"optional"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F",category:"optional"}],example:{props:{title:"\u6708\u5EA6\u51C0\u9500\u552E\u989D",variant:"card",layout:"vertical",precision:0,icon:"\u{1F4B0}"},body:{value:"1280000",trend:"up",trendValue:"+12.5%",note:"\u8F83\u4E0A\u6708\u589E\u957F 12.5%"},contentProp:"value"}};var De={tag:"xcml:table",title:"\u53EF\u89C6\u5316\u6570\u636E\u8868\u683C",description:"\u62A5\u8868\u7EA7\u6570\u636E\u8868\u683C\uFF0C\u652F\u6301\u8FDB\u5EA6\u6761\u3001\u8D8B\u52BF\u56FE\u7B49\u53EF\u89C6\u5316\u5217\u6E32\u67D3\uFF0C\u5168\u91CF\u5C55\u793A\u4E0D\u5206\u9875\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898",category:"style"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8FB9\u6846",category:"style",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"},{name:"size",type:"enum",description:"\u8868\u683C\u5C3A\u5BF8",category:"layout",options:["small","middle","large"],default:"middle"},{name:"summary",type:"boolean",description:"\u662F\u5426\u663E\u793A\u5408\u8BA1\u884C",category:"optional",default:!1}],body:[{name:"columns",type:"array",description:"\u5217\u5B9A\u4E49",category:"required",required:!0,items:[{name:"column",type:"object",description:"\u5217\u914D\u7F6E\u5BF9\u8C61",category:"required",properties:[{name:"title",type:"string",description:"\u5217\u6807\u9898",category:"required"},{name:"key",type:"string",description:"\u6570\u636E\u5B57\u6BB5\u952E\u540D",category:"required"},{name:"type",type:"enum",description:"\u6E32\u67D3\u7C7B\u578B",category:"style",options:["text","progress","trend","badge","image","link"]},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"width",type:"number",description:"\u5217\u5BBD",category:"layout"}]}]},{name:"rows",type:"array",description:"\u884C\u6570\u636E",category:"required",required:!0,items:[{name:"row",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61",category:"required"}]}],example:{props:{title:"\u5404\u533A\u57DF\u9500\u552E\u8FBE\u6210\u62A5\u8868",bordered:!1,size:"middle",summary:!0},body:{columns:[{title:"\u533A\u57DF",key:"region",align:"left"},{title:"\u9500\u552E\u989D",key:"sales",align:"right",type:"text"},{title:"\u76EE\u6807\u8FBE\u6210\u7387",key:"rate",align:"center",type:"progress"},{title:"\u8FD1\u671F\u8D8B\u52BF",key:"trend",align:"center",type:"trend"},{title:"\u72B6\u6001",key:"status",align:"center",type:"badge"}],rows:[{region:"\u534E\u4E1C\u533A",sales:"\xA51,250,000",rate:.92,trend:[10,20,15,30,40],status:"normal"},{region:"\u534E\u5317\u533A",sales:"\xA5980,000",rate:.78,trend:[30,20,25,10,15],status:"warning"},{region:"\u534E\u5357\u533A",sales:"\xA51,560,000",rate:1.12,trend:[20,30,40,50,60],status:"success"},{region:"\u897F\u90E8\u533A",sales:"\xA5420,000",rate:.45,trend:[10,8,5,12,10],status:"error"}]}}};var We={tag:"xcml:list",title:"\u7F51\u683C/\u5217\u8868\u5E03\u5C40",description:"\u901A\u7528\u5E03\u5C40\u5BB9\u5668\uFF0C\u652F\u6301 Grid \u548C List \u4E24\u79CD\u6A21\u5F0F\uFF0C\u9002\u5408\u6392\u7248\u591A\u4E2A\u5361\u7247\u3002",props:[{name:"title",type:"string",description:"\u5217\u8868\u6807\u9898"},{name:"header",type:"string",description:"\u5217\u8868\u9875\u7709\u6587\u672C"},{name:"footer",type:"string",description:"\u5217\u8868\u9875\u811A\u6587\u672C"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u6A21\u5F0F",options:["grid","list"],default:"grid"},{name:"columns",type:"number",description:"\u7F51\u683C\u5217\u6570 (Grid\u6A21\u5F0F\u6709\u6548)",default:3},{name:"gap",type:"number",description:"\u95F4\u8DDD",default:16},{name:"type",type:"enum",description:"\u5217\u8868\u9879\u9ED8\u8BA4\u7C7B\u578B",options:["text","metric"],default:"text"},{name:"stripe",type:"boolean",description:"\u662F\u5426\u5F00\u542F\u6591\u9A6C\u7EB9",default:!1}],body:[{name:"items",type:"array",description:"\u5217\u8868\u9879\u96C6\u5408",required:!0}],example:{props:{title:"\u7EDF\u8BA1\u6307\u6807",header:"\u6700\u8FD1\u4E00\u4E2A\u6708\u6570\u636E",footer:"\u6570\u636E\u6765\u6E90\uFF1A\u6570\u636E\u5E93",layout:"grid",columns:3,gap:16},body:{items:[{title:"\u7528\u6237\u589E\u957F",value:"+12%",type:"metric"},{title:"\u6D3B\u8DC3\u5EA6",value:"85%",type:"metric"},{title:"\u7559\u5B58\u7387",value:"42%",type:"metric"}]}}};var qe={tag:"xcml:card",title:"\u901A\u7528\u5361\u7247",description:"\u57FA\u7840\u5BB9\u5668\u5361\u7247\uFF0C\u652F\u6301\u6807\u9898\u3001\u63CF\u8FF0\u548C\u60AC\u6D6E\u6548\u679C\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898",category:"optional"},{name:"type",type:"enum",description:"\u5361\u7247\u7C7B\u578B",category:"style",options:["inner","default"],default:"default"},{name:"hoverable",type:"boolean",description:"\u662F\u5426\u652F\u6301\u60AC\u505C\u6548\u679C",category:"interaction",default:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",category:"style",options:["card","plain"],default:"card"}],body:[{name:"description",type:"string",description:"\u5361\u7247\u63CF\u8FF0/\u6B63\u6587 (\u517C\u5BB9\u65E7\u5C5E\u6027)",category:"optional"},{name:"content",type:"string",description:"\u5361\u7247\u4E3B\u8981\u5185\u5BB9 (\u652F\u6301 Markdown)",category:"required",required:!0}],example:{props:{type:"default",hoverable:!0,variant:"card",title:"\u63D0\u793A\u4FE1\u606F",theme:"light"},body:{description:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u793A\u4F8B",content:"\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u5361\u7247\u5BB9\u5668\uFF0C\u53EF\u4EE5\u7528\u6765\u5305\u88F9\u7B80\u5355\u7684\u6587\u672C\u6216\u4F5C\u4E3A\u5176\u4ED6\u7EC4\u4EF6\u7684\u5360\u4F4D\u3002"},contentProp:"content"}};var ze={tag:"xcml:toc",title:"\u6587\u6863\u76EE\u5F55",description:"\u81EA\u52A8\u63D0\u53D6\u6587\u6863\u4E2D\u7684 H2-H6 \u6807\u9898\u751F\u6210\u53EF\u8DF3\u8F6C\u7684\u76EE\u5F55\u3002",props:[{name:"title",type:"string",description:"\u76EE\u5F55\u6807\u9898",default:"\u76EE\u5F55"}],example:{props:{title:"\u5185\u5BB9\u5927\u7EB2"}}};var ke={tag:"x-line-chart",title:"\u6298\u7EBF\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u8FDE\u7EED\u65F6\u95F4\u8DE8\u5EA6\u4E0B\u7684\u6570\u636E\u8D8B\u52BF\u3002",props:[],body:[{name:"data",type:"array",description:"\u6298\u7EBF\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"x\u8F74\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"y\u8F74\u5B57\u6BB5",default:"value",required:!0},{name:"seriesField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",default:"type"}],example:{props:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF"},body:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF",xField:"category",yField:"value",seriesField:"type",data:[{category:"A",value:10,type:"T1"},{category:"B",value:20,type:"T1"}]}}};var Pe={tag:"x-column-chart",title:"\u67F1\u72B6\u56FE",description:"\u7528\u4E8E\u6BD4\u8F83\u4E0D\u540C\u5206\u7C7B\u4E4B\u95F4\u7684\u6570\u636E\u5DEE\u5F02\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5 (\u5206\u7C7B)",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5 (\u6570\u503C)",category:"required",required:!0},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u5206\u7EC4)",category:"optional"},{name:"colorField",type:"string",description:"\u989C\u8272\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"stack",type:"any",description:"\u662F\u5426\u5806\u53E0",category:"layout"},{name:"group",type:"any",description:"\u662F\u5426\u5206\u7EC4\u663E\u793A",category:"layout"},{name:"percent",type:"boolean",description:"\u662F\u5426\u767E\u5206\u6BD4\u5C55\u793A",category:"layout"},{name:"conversionTag",type:"object",description:"\u8F6C\u5316\u7387\u914D\u7F6E",category:"style"},{name:"markBackground",type:"object",description:"\u5143\u7D20\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{title:"\u5404\u533A\u57DF\u5E74\u5EA6\u9500\u552E\u5206\u6790"},body:{xField:"region",yField:"sales",seriesField:"year",stack:!0,label:{text:"sales",position:"inside"},data:[{region:"\u534E\u4E1C",year:"2022",sales:4500},{region:"\u534E\u4E1C",year:"2023",sales:5200},{region:"\u534E\u5317",year:"2022",sales:3800},{region:"\u534E\u5317",year:"2023",sales:4100},{region:"\u534E\u5357",year:"2022",sales:4200},{region:"\u534E\u5357",year:"2023",sales:4800}]}}};var Re={tag:"x-pie-chart",title:"\u997C\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u5206\u7C7B\u6570\u636E\u7684\u5360\u6BD4\u60C5\u51B5\u3002",props:[],body:[{name:"colorField",type:"string",description:"\u5206\u7C7B\u5B57\u6BB5",category:"required",required:!0},{name:"angleField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"radius",type:"number",description:"\u534A\u5F84",category:"layout"},{name:"innerRadius",type:"number",description:"\u5185\u534A\u5F84 (\u73AF\u56FE)",category:"layout"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["outside","inside"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"connector",type:"any",description:"\u8FDE\u63A5\u7EBF\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style",properties:[{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]},{name:"title",type:"any",description:"\u6807\u9898",category:"style"},{name:"layout",type:"object",description:"\u5E03\u5C40",category:"style"},{name:"itemMarker",type:"any",description:"\u6807\u8BB0\u5F62\u72B6",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{},body:{colorField:"type",angleField:"value",data:[{type:"A",value:40},{type:"B",value:60}]}}};var Te={tag:"x-dual-axes-chart",title:"\u53CC\u8F74\u56FE",description:"\u7528\u4E8E\u5728\u540C\u4E00\u56FE\u8868\u4E2D\u5C55\u793A\u4E24\u4E2A\u4E0D\u540C\u91CF\u7EB2\u7684\u6570\u636E\u7CFB\u5217\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"children",type:"array",description:"\u5B50\u56FE\u5C42\u914D\u7F6E\u6570\u7EC4",category:"required",required:!0,transform:(t,e)=>Array.isArray(t)?t.map(r=>{!r.xField&&e.xField&&(r.xField=e.xField);let n=r.xField||"x",o=r.scale||{},a=o[n]||{};return(r.type==="interval"||!a.type)&&(a.type="band"),{...r,scale:{...o,[n]:a}}}):t,items:[{name:"properties",type:"object",description:"\u5B50\u56FE\u5C42\u914D\u7F6E",category:"required",properties:[{name:"type",type:"enum",description:"\u56FE\u5C42\u7C7B\u578B",category:"required",options:["interval","line","area","point"],required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u522B\u540D)",category:"optional"},{name:"shapeField",type:"string",description:"\u5F62\u72B6\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"group",type:"boolean",description:"\u662F\u5426\u5206\u7EC4",category:"layout"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"data",type:"array",description:"\u5B50\u56FE\u5C42\u72EC\u7ACB\u6570\u636E\u6E90",category:"required"},{name:"axis",type:"object",description:"\u8BE5\u56FE\u5C42\u7684\u8F74\u914D\u7F6E",category:"style",properties:[{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]}]}]},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","middle","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{xField:"month",children:[{type:"interval",yField:"sales",label:{position:"middle"}},{type:"line",yField:"rate",label:{position:"top"},style:{stroke:"#5AD8A6",lineWidth:2}}],axis:{y:[{title:{text:"\u9500\u552E\u989D"}},{title:{text:"\u5229\u6DA6\u7387"},position:"right"}]},data:[{month:"1\u6708",sales:450,rate:.12},{month:"2\u6708",sales:520,rate:.15},{month:"3\u6708",sales:480,rate:.14},{month:"4\u6708",sales:610,rate:.18},{month:"5\u6708",sales:580,rate:.16}]},body:{xField:"time",yField:["value","count"],data:[{time:"2021-01",value:10,count:5},{time:"2021-02",value:20,count:10}]}}};var Xe={tag:"x-funnel-chart",title:"\u6F0F\u6597\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u4E1A\u52A1\u6D41\u7A0B\u4E2D\u5404\u9636\u6BB5\u7684\u6570\u636E\u8F6C\u5316\u60C5\u51B5\u3002",props:[],body:[{name:"data",type:"array",description:"\u6F0F\u6597\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"\u7C7B\u522B\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",default:"value",required:!0}],example:{props:{},body:{xField:"category",yField:"value",data:[{category:"A",value:100},{category:"B",value:80}]}}};var Jt={line:ke,column:Pe,pie:Re,"dual-axes":Te,funnel:Xe};function Gt(t,e){let r=new Map;return Object.entries(t).forEach(([n,o])=>{(o[e]||[]).forEach(s=>{if(["type","data","xField","yField","colorField","seriesField","title","label","axis","legend","tooltip","scale","interaction","theme"].includes(s.name))return;let d=r.get(s.name);d?d.types.push(n):r.set(s.name,{def:s,types:[n]})})}),Array.from(r.values()).map(({def:n,types:o})=>({...n,visibleIf:a=>o.includes(a.type)?n.visibleIf?n.visibleIf(a):!0:!1}))}var ge={tag:"xcml:chart",title:"AntV \u901A\u7528\u56FE\u8868",description:"\u5168\u529F\u80FD\u56FE\u8868\u7EC4\u4EF6\u5BB9\u5668\uFF0C\u652F\u6301\u901A\u8FC7 type \u52A8\u6001\u5207\u6362\u6298\u7EBF\u56FE\u3001\u67F1\u72B6\u56FE\u3001\u997C\u56FE\u7B49\u3002",props:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",category:"required",required:!0,options:["line","column","pie","dual-axes","funnel"],default:"line"},...Gt(Jt,"props")],body:[{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u989C\u8272/\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5",category:"optional"},{name:"title",type:"object",description:"\u56FE\u8868\u6807\u9898",category:"style"},{name:"label",type:"object",description:"\u6570\u636E\u6807\u7B7E",category:"style"},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style"},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u63D0\u793A\u4FE1\u606F",category:"interaction"},{name:"scale",type:"object",description:"\u5EA6\u91CF\u914D\u7F6E",category:"optional"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"theme",type:"string",description:"\u56FE\u8868\u4E3B\u9898",category:"style"},...Gt(Jt,"body")],example:{props:{type:"line",theme:"light"},body:{xField:"year",yField:"value",seriesField:"category",data:[{year:"1991",value:3,category:"A"},{year:"1992",value:4,category:"A"},{year:"1993",value:3.5,category:"A"},{year:"1994",value:5,category:"A"},{year:"1995",value:4.9,category:"A"},{year:"1996",value:6,category:"A"},{year:"1997",value:7,category:"A"},{year:"1998",value:9,category:"A"},{year:"1999",value:13,category:"A"},{year:"1991",value:3,category:"B"},{year:"1992",value:4,category:"B"},{year:"1993",value:3.5,category:"B"},{year:"1994",value:5,category:"B"},{year:"1995",value:4.9,category:"B"},{year:"1996",value:6,category:"B"},{year:"1997",value:7,category:"B"},{year:"1998",value:9,category:"B"},{year:"1999",value:13,category:"B"}]}}};var Ve={tag:"xcml:insight-card",title:"\u6D1E\u5BDF\u5361\u7247 (Pro)",description:"\u5168\u91CF\u5C55\u793A\u7684\u6D1E\u5BDF\u5361\u7247\uFF0C\u652F\u6301\u5F15\u7528\u6765\u6E90\u4E0E\u884C\u52A8\u5EFA\u8BAE\u3002",props:[{name:"title",type:"string",description:"\u6D1E\u5BDF\u6807\u9898"},{name:"sentiment",type:"enum",description:"\u60C5\u611F\u503E\u5411",options:["positive","negative","neutral","insight","warning","success","error"],default:"insight"},{name:"icon",type:"string",description:"\u56FE\u6807 (Emoji \u6216 AntD Icon \u540D\u79F0)"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"actions",type:"array",description:"\u5EFA\u8BAE\u884C\u52A8\u5217\u8868"},{name:"citations",type:"array",description:"\u5F15\u7528\u6765\u6E90\u5217\u8868"},{name:"highlights",type:"array",description:"\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u5217\u8868"},{name:"content",type:"string",description:"\u6D1E\u5BDF\u6B63\u6587\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"}],example:{props:{title:"\u5E93\u5B58\u9884\u8B66\uFF1A\u70ED\u95E8\u5546\u54C1\u7F3A\u8D27\u98CE\u9669",sentiment:"warning"},body:{highlights:["3 \u5929\u5185\u552E\u7F44","\u7ACB\u5373\u542F\u52A8\u8865\u8D27"],citations:["\u5E93\u5B58\u7BA1\u7406\u7CFB\u7EDF","\u9500\u552E\u9884\u6D4B\u6A21\u578B"],actions:["\u751F\u6210\u8865\u8D27\u5355","\u6682\u505C\u5E7F\u544A\u6295\u653E"],content:"\u6839\u636E\u5F53\u524D\u9500\u552E\u901F\u7387\uFF0CiPhone 15 Pro Max \u5C06\u5728 3 \u5929\u5185\u552E\u7F44\u3002\u5EFA\u8BAE\u7ACB\u5373\u542F\u52A8\u8865\u8D27\u6D41\u7A0B\uFF0C\u5E76\u8C03\u6574\u5E7F\u544A\u6295\u653E\u7B56\u7565\u4EE5\u907F\u514D\u8D85\u5356\u3002"},contentProp:"content"}};var He={tag:"xcml:interactive-summary",title:"\u4EA4\u4E92\u5F0F\u6C47\u603B",description:"\u5E26\u64CD\u4F5C\u6309\u94AE\u7684\u6570\u503C\u6C47\u603B\u5361\u7247\uFF0C\u652F\u6301\u5B9E\u65F6\u8C03\u6574\u6570\u503C\u5E76\u89E6\u53D1\u4E1A\u52A1\u56DE\u8C03\u3002",props:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",default:"\u8C03\u6574\u76EE\u6807"},{name:"value",type:"number",description:"\u521D\u59CB\u6570\u503C",default:0},{name:"step",type:"number",description:"\u8C03\u6574\u6B65\u957F",default:1},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"actionId",type:"string",description:"\u89E6\u53D1\u56DE\u8C03\u7684\u4E8B\u4EF6 ID",default:"update_target"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"content",type:"string",description:"\u6C47\u603B\u6587\u672C\u5185\u5BB9 (\u652F\u6301\u4ECE Body \u4F20\u5165)"},{name:"highlightKeywords",type:"array",description:"\u6587\u672C\u4E2D\u9700\u8981\u9AD8\u4EAE\u7684\u5173\u952E\u8BCD\u6570\u7EC4"},{name:"trendData",type:"array",itemType:"number",description:"\u80CC\u666F\u8D8B\u52BF\u56FE\u6570\u636E"}],example:{props:{label:"\u5B63\u5EA6\u9500\u552E\u76EE\u6807",value:5e3,unit:"k",step:100,actionId:"set_sales_target"},body:{trendData:[10,20,15,30,40,35,50],content:"\u6839\u636E\u5F53\u524D\u4E1A\u52A1\u589E\u957F\uFF0C\u5EFA\u8BAE\u5C06\u76EE\u6807\u8BBE\u5B9A\u5728 5000k \u4EE5\u4E0A\u3002"},contentProp:"content"}};var Ke={tag:"x-metric-card",title:"\u590D\u5408\u6307\u6807\u5361",description:"\u589E\u5F3A\u578B\u6307\u6807\u5C55\u793A\uFF0C\u652F\u6301\u6570\u503C\u52A8\u753B\u3001\u5355\u4F4D\u3001\u524D\u7F00\u4EE5\u53CA\u540C\u6BD4/\u73AF\u6BD4\u8D8B\u52BF\u3002",props:[{name:"title",type:"string",description:"\u5361\u7247\u6807\u9898"},{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0 (title \u7684\u522B\u540D)"},{name:"unit",type:"string",description:"\u6570\u503C\u5355\u4F4D"},{name:"prefix",type:"string",description:"\u6570\u503C\u524D\u7F00"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F"},{name:"precision",type:"number",description:"\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",default:2},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"value",type:"number",description:"\u6838\u5FC3\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"yoy",type:"number",description:"\u540C\u6BD4\u589E\u957F\u7387 (%)"}],example:{props:{label:"\u6D3B\u8DC3\u7528\u6237",unit:"\u4EBA"},body:{value:84200,wow:12.5},contentProp:"value"}};var Je={tag:"xcml:mini-kpi-strip",title:"\u8FF7\u4F60\u6307\u6807\u6761",description:"\u7D27\u51D1\u7684\u6A2A\u5411\u6307\u6807\u6392\u5217\uFF0C\u652F\u6301\u8FF7\u4F60\u8D8B\u52BF\u56FE\uFF08Sparkline\uFF09\u548C\u73AF\u6BD4\u5C55\u793A\u3002",props:[],body:[{name:"items",type:"array",description:"\u6307\u6807\u9879\u5217\u8868",items:[{name:"label",type:"string",description:"\u6307\u6807\u540D\u79F0",required:!0},{name:"value",type:"string",description:"\u6307\u6807\u5F53\u524D\u6570\u503C",required:!0},{name:"wow",type:"number",description:"\u73AF\u6BD4\u589E\u957F\u7387 (%)"},{name:"trendData",type:"array",itemType:"number",description:"\u8FF7\u4F60\u8D8B\u52BF\u56FE\u6570\u636E\u70B9\u6570\u7EC4"}]}],example:{body:{items:[{label:"\u8425\u6536",value:"\xA51.2M",wow:12,trendData:[10,20,15,30,40]},{label:"\u7528\u6237",value:"85.2K",wow:-5,trendData:[50,40,45,35,30]},{label:"\u8F6C\u5316\u7387",value:"3.2%",wow:2,trendData:[2,3,2.5,3.1,3.2]},{label:"\u6D3B\u8DC3\u5EA6",value:"92%",wow:0,trendData:[90,91,92,90,92]}]}}};var Ge={tag:"xcml:poster-card",title:"\u6570\u636E\u6D77\u62A5",description:"\u7F8E\u89C2\u7684\u6570\u636E\u53EF\u89C6\u5316\u6D77\u62A5\uFF0C\u652F\u6301\u591A\u79CD\u56FE\u8868\u7EC4\u5408\u3001\u4E8C\u7EF4\u7801\u5C55\u793A\u53CA\u4E00\u952E\u4E0B\u8F7D\u56FE\u7247\u3002",props:[{name:"title",type:"string",description:"\u6D77\u62A5\u6807\u9898",default:"\u6570\u636E\u6D77\u62A5"},{name:"subTitle",type:"string",description:"\u6D77\u62A5\u526F\u6807\u9898",default:"Data Insight Poster"},{name:"themeColor",type:"string",description:"\u6D77\u62A5\u4E3B\u9898\u8272"},{name:"backgroundImage",type:"string",description:"\u80CC\u666F\u56FE\u7247 URL"},{name:"qrCode",type:"string",description:"\u4E8C\u7EF4\u7801\u5185\u5BB9",default:"https://ant.design"},{name:"author",type:"string",description:"\u4F5C\u8005",default:"ChatBI"},{name:"date",type:"string",description:"\u65E5\u671F"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"charts",type:"array",description:"\u5305\u542B\u5728\u6D77\u62A5\u4E2D\u7684\u56FE\u8868\u5217\u8868",items:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",options:["column","line","pie"],required:!0},{name:"title",type:"string",description:"\u56FE\u8868\u6807\u9898"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6570\u7EC4",required:!0,items:[{name:"label",type:"string",description:"\u7EF4\u5EA6\u540D\u79F0",required:!0},{name:"value",type:"number",description:"\u6307\u6807\u6570\u503C",required:!0}]}]}],example:{props:{title:"\u53CC\u5341\u4E00\u9500\u552E\u6218\u62A5",subTitle:"2023 \u6838\u5FC3\u6307\u6807\u56DE\u987E",author:"\u6570\u636E\u5206\u6790\u56E2\u961F"},body:{charts:[{type:"pie",title:"\u5404\u6E20\u9053\u5360\u6BD4",data:[{label:"\u76F4\u64AD",value:45},{label:"\u641C\u7D22",value:30},{label:"\u5176\u4ED6",value:25}]},{type:"column",title:"\u8FD1 7 \u65E5\u8D8B\u52BF",data:[{label:"11.01",value:120},{label:"11.02",value:150},{label:"11.03",value:200}]}]}}};var Ue={tag:"xcml:snapshot-table",title:"\u5FEB\u7167\u8868\u683C",description:"\u8F7B\u91CF\u7EA7\u6570\u636E\u5FEB\u7167\uFF0C\u652F\u6301 CSV \u5BFC\u51FA\u548C\u6EDA\u52A8\u67E5\u770B\u3002",props:[{name:"title",type:"string",description:"\u8868\u683C\u6807\u9898\u3002\u6CE8\u610F\uFF1A\u5982\u679C SnapshotTable \u88AB\u5305\u88F9\u5728 Card \u4E2D\u4E14 Card \u5DF2\u8BBE\u7F6E\u6807\u9898\uFF0C\u6B64\u6807\u9898\u5C06\u81EA\u52A8\u9690\u85CF\u4EE5\u907F\u514D\u91CD\u590D\u3002"},{name:"description",type:"string",description:"\u8868\u683C\u63CF\u8FF0\uFF0C\u5C55\u793A\u5728\u6807\u9898\u4E0B\u65B9\u6216\u7EC4\u4EF6\u9876\u90E8\u3002"},{name:"bordered",type:"boolean",description:"\u662F\u5426\u663E\u793A\u8868\u683C\u5185\u90E8\u8FB9\u6846",default:!0}],body:[{name:"columns",type:"array",description:"\u8868\u683C\u5217\u5B9A\u4E49",items:[{name:"title",type:"string",description:"\u5217\u6807\u9898",required:!0},{name:"key",type:"string",description:"\u6570\u636E\u5BF9\u5E94\u5B57\u6BB5",required:!0},{name:"width",type:"number",description:"\u5217\u5BBD"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",options:["left","center","right"]}]},{name:"rows",type:"array",description:"\u8868\u683C\u884C\u6570\u636E",items:[{name:"properties",type:"object",description:"\u884C\u6570\u636E\u5BF9\u8C61\uFF0C\u952E\u503C\u9700\u5BF9\u5E94 columns \u4E2D\u7684 key"}]}],example:{props:{title:"\u5B9E\u65F6\u5E93\u5B58\u5FEB\u7167"},body:{columns:[{title:"\u5546\u54C1\u540D",key:"name"},{title:"\u5E93\u5B58\u91CF",key:"stock"},{title:"\u9884\u8B66\u7EBF",key:"threshold"}],rows:[{name:"iPhone 15",stock:120,threshold:50},{name:"iPad Air",stock:45,threshold:30},{name:"MacBook Pro",stock:12,threshold:20}]}}};var Ye={tag:"xcml:thought-chain",title:"\u601D\u7EF4\u94FE (Timeline)",description:"\u5168\u5C55\u5F00\u7684\u65F6\u95F4\u8F74\u5F0F\u601D\u7EF4\u94FE\uFF0C\u5C55\u793A\u6267\u884C\u8017\u65F6\u4E0E\u8BE6\u7EC6\u7ED3\u679C\u3002",props:[{name:"title",type:"string",description:"\u601D\u7EF4\u94FE\u6807\u9898",default:"\u5206\u6790\u8FC7\u7A0B"},{name:"variant",type:"string",description:"\u5C55\u793A\u53D8\u4F53 (card, plain)",default:"card"}],body:[{name:"steps",type:"array",description:"\u6267\u884C\u6B65\u9AA4\u5217\u8868",items:[{name:"tool",type:"string",description:"\u4F7F\u7528\u7684\u5DE5\u5177\u540D\u79F0"},{name:"action",type:"string",description:"\u6267\u884C\u7684\u64CD\u4F5C\u63CF\u8FF0"},{name:"status",type:"enum",description:"\u6267\u884C\u72B6\u6001",options:["success","running","pending","error"]},{name:"duration",type:"string",description:"\u8017\u65F6\u63CF\u8FF0"},{name:"thought",type:"string",description:"\u601D\u8003\u8FC7\u7A0B/\u65E5\u5FD7"},{name:"result",type:"string",description:"\u6267\u884C\u7ED3\u679C\u6458\u8981"},{name:"error",type:"string",description:"\u9519\u8BEF\u4FE1\u606F"}]}],example:{props:{title:"\u667A\u80FD\u5206\u6790\u6267\u884C\u8DEF\u5F84"},body:{steps:[{tool:"SQL Generator",action:"\u751F\u6210\u67E5\u8BE2\u8BED\u53E5",duration:"120ms",status:"success",thought:"\u6839\u636E\u7528\u6237\u610F\u56FE\uFF0C\u9700\u8981\u67E5\u8BE2 2023 \u5E74\u540E\u7684\u9500\u552E\u6570\u636E\u3002",result:'SELECT * FROM sales WHERE date > "2023-01-01"'},{tool:"Data Query",action:"\u6267\u884C\u6570\u636E\u5E93\u67E5\u8BE2",duration:"1.2s",status:"success",thought:"\u6B63\u5728\u8FDE\u63A5\u751F\u4EA7\u5E93\u6267\u884C\u67E5\u8BE2...",result:"Total rows: 1250"},{tool:"Analysis",action:"\u8BA1\u7B97\u540C\u6BD4\u589E\u957F\u7387",duration:"45ms",status:"success",thought:"\u5BF9\u6BD4\u53BB\u5E74\u540C\u671F\u6570\u636E\u8FDB\u884C\u8BA1\u7B97\u3002",result:"YoY Growth: +15.2%"}]}}};var Ut=[{name:"theme",type:"enum",description:"\u7EC4\u4EF6\u89C6\u89C9\u4E3B\u9898\u98CE\u683C",category:"style",options:["light","dark","ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyber"],default:void 0}],cn={"xcml:metric":Be,"xcml:table":De,"xcml:chart":ge,"xcml:list":We,"xcml:thought-chain":Ye,"xcml:insight-card":Ve,"xcml:metric-card":Ke,"xcml:card":qe,"xcml:toc":ze,"xcml:poster-card":Ge,"xcml:mini-kpi-strip":Je,"xcml:interactive-summary":He,"xcml:snapshot-table":Ue},fe=Object.fromEntries(Object.entries(cn).map(([t,e])=>[t,{...e,props:[...e.props||[],...Ut]}]));var tt=require("yaml");function dn(t){let{theme:e,variant:r,size:n,className:o,style:a}=t;return{theme:e,variant:r,size:n,className:o,style:a}}function yt(t,e){let r=t.props||{},n=t.body!==void 0?t.body:t.data,o=(t.props||{})["data-xcml-raw"];if(o)try{n=decodeURIComponent(escape(atob(o)))}catch(l){console.warn("[XCML] Failed to decode data-xcml-raw:",l)}if(typeof n=="string"){let l=n.trim();if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{n=JSON.parse(l)}catch{}}let a={};if(e&&((e.props||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)}),(e.body||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)})),n!=null)if(typeof n=="object"&&!Array.isArray(n))Object.assign(a,n),Array.isArray(n.data)&&(a.data=n.data);else if(Array.isArray(n)){let l=(e?.body||[]).find(d=>d.type==="array")?.name||"data";a[l]=n}else{let l=e?.example?.contentProp||(e?.body||[]).find(d=>d.name==="content"||d.name==="value")?.name||"content";a[l]=n}return Object.assign(a,r),["theme","variant","layout","size"].forEach(l=>{a[l]===void 0&&r[l]!==void 0&&(a[l]=r[l])}),a}var de=t=>{if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();if(!e)return[];if(e.startsWith("["))try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/'/g,'"'))}catch{}}return e.split(/[,,]/).map(r=>r.trim()).filter(Boolean)}return[]};function me(t,e={}){let r={};return Object.entries(t).forEach(([n,o])=>{r[`xcml:${n}`]=o,e[n]&&e[n].forEach(a=>{r[`xcml:${a}`]=o})}),r}var mn=(t,e="xcml-node")=>{if(!t||!t.type||!fe[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function pn(t,e){let r=[],n=t.props||{};if(e.props.forEach(o=>{o.required&&(n[o.name]===void 0||n[o.name]===null||n[o.name]==="")&&r.push(`\u5C5E\u6027 '${o.name}' (${o.description}) \u662F\u5FC5\u586B\u9879`)}),e.props.forEach(o=>{let a=n[o.name];a!=null&&(o.type==="number"&&isNaN(Number(a))&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u6570\u5B57\u7C7B\u578B`),o.type==="boolean"&&typeof a!="boolean"&&a!=="true"&&a!=="false"&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u5E03\u5C14\u7C7B\u578B`),o.type==="enum"&&o.options&&!o.options.includes(a)&&r.push(`\u5C5E\u6027 '${o.name}' \u7684\u503C '${a}' \u4E0D\u5728\u53EF\u9009\u8303\u56F4\u5185: ${o.options.join(", ")}`))}),e.body&&e.body.length>0){let o=t.body!==void 0?t.body:t.data;e.body.forEach(a=>{a.required&&(o==null||o===""?r.push("\u6807\u7B7E\u4F53\u5185\u5BB9 (Body Data) \u662F\u5FC5\u586B\u9879"):typeof o=="object"&&!Array.isArray(o)&&(o[a.name]===void 0||o[a.name]===null||o[a.name]==="")&&r.push(`\u6807\u7B7E\u4F53\u5185\u5BB9\u5E94\u5305\u542B '${a.name}' (${a.description}) \u5B57\u6BB5`))})}return{valid:r.length===0,errors:r}}function gt(t,e){let{node:r,streamStatus:n}=t,o=yt(r,e),a=r?.streamStatus||n||o.streamStatus,s=a==="loading"||r?.body?.["data-xcml-loading"]==="true"||r?.data?.["data-xcml-loading"]==="true"||r?.props?.["data-xcml-loading"]==="true"||o?.["data-xcml-loading"]==="true"||t.loading,l={theme:o.theme,variant:o.variant,size:o.size,className:t.className,style:t.style,loading:s,streamStatus:a,error:t.error};return{merged:o,baseProps:l,isLoading:s,streamStatus:a}}function et(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Yt(t){return`x-${et(t)}`}function Fe(t){return`xcml:${et(t)}`}var Qe=class{constructor(){this.listeners={}}on(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r)}emit(e,r){(this.listeners[e]||[]).forEach(n=>n(r))}refresh(e){this.emit("refresh",{id:e})}update(e,r){this.emit("update",{id:e,payload:r})}resize(e){this.emit("resize",{id:e})}export(e,r){this.emit("export",{id:e,type:r})}},he=new Qe,un=/\/\/(.*)$/gm,yn=/\/\*[\s\S]*?\*\//g;function Zt(t,e="json"){let r=t.trim();if(!r)return null;if((e==="json"||e==="jsonc")&&!(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")))return r;try{if(e==="json"||e==="jsonc"){let n=e==="jsonc"?r.replace(un,"").replace(yn,""):r;try{return JSON.parse(n)}catch(o){try{let a=(0,Ze.parse)(n);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return(0,Ze.parse)(r);if(e==="csv"||e==="tsv"){let n=e==="csv"?",":" ",o=r.split(/\r?\n/).filter(s=>s.trim());if(o.length===0)return[];let a=o[0].split(n).map(s=>s.trim());return o.slice(1).map(s=>{let l=s.split(n),d={};return a.forEach((m,p)=>{let c=l[p]?.trim();c==="true"?c=!0:c==="false"?c=!1:c!==""&&!isNaN(Number(c))&&(c=Number(c)),d[m]=c}),d})}return e==="ndjson"?r.split(/\r?\n/).filter(Boolean).map(n=>JSON.parse(n)):JSON.parse(r)}catch(n){throw n}}function gn(t,e){return e!=null}function ft(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let r=Fe(t),n=fe[r];if(!n)return e;let o={...e};return[...n.props||[],...n.body||[]].forEach(s=>{let l=o[s.name];if((s.type==="object"||s.type==="array")&&typeof l=="string")try{let d=l.trim();if(d.startsWith("{")||d.startsWith("[")){let m=d,p=0;for(;typeof m=="string"&&p<2;){let c=JSON.parse(m);if(c===null||typeof c!="object")if(typeof c=="string"&&(c.startsWith("{")||c.startsWith("[")))m=c;else break;else{m=c;break}p++}o[s.name]=m}}catch{}}),o}function ht(t,e,r,n={}){let o=Fe(t),a=fe[o],s={},l={},{preferBody:d=!1}=n,m=Qt(r),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(x=>x.name==="content"||x.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(y=>{/^\d+$/.test(y)||(l[y]=p[y])});let c={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:r};let i=new Set((a.props||[]).map(y=>y.name)),u=new Set((a.body||[]).map(y=>y.name));for(let[y,x]of Object.entries(c))/^\d+$/.test(y)||(d?i.has(y)||u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x:i.has(y)?s[y]=x:u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x);let f=l;if(Array.isArray(m))if(Object.keys(l).length===0)f=m;else{let y=(a.body||[]).find(x=>x.type==="array")?.name||"data";l[y]=m,f=l}return{props:ft(o,s),body:ft(o,f)}}function Qt(t){if(Array.isArray(t))return t;if(t&&typeof t=="object"){let e=Object.keys(t).filter(r=>/^\d+$/.test(r)).sort((r,n)=>Number(r)-Number(n));if(e.length>0&&e.length===Object.keys(t).length&&e.every((r,n)=>Number(r)===n))return e.map(r=>t[r])}return t}function fn(t){let e=Fe(t.tag||t.type||"unknown"),r=Yt(e),n={...t.props||{}},o=Qt(t.body),{body:a}=ht(e,n,o,{preferBody:!0}),s=[],l=a,d=Object.keys(a||{});d.length===1&&d[0]==="data"&&Array.isArray(a.data)&&(l=a.data);let m=s.length>0?" "+s.join(" "):"",p=JSON.stringify(l,null,2);return`<${r}${m}>
|
|
2
2
|
${p}
|
|
3
|
-
</${
|
|
3
|
+
</${r}>`}function hn(t){if(!t)return null;let e=t.trim();if(!e.startsWith("<"))try{let i=(0,Ze.parse)(e);if(i&&(i.tag||i.type))return{tag:i.tag||i.type,props:i.props||{},body:i.body||i.data||i.dataProps||{}}}catch{}let r=e.match(/^<((?:xcml:|x-)[^\s/>]+)\s*([\s\S]*?)(\/?>)([\s\S]*?)$/);if(!r)return null;let[,n,o,a]=r,s=a==="/>",l={},d=/([a-zA-Z0-9-]+)\s*=\s*(?:'([^']*)'|"([^"]*)"|`([^`]*)`|((?:(?!\s|\/|>).)+))/g,m;for(;(m=d.exec(o))!==null;){let i=m[1],u=m[2]||m[3]||m[4]||m[5];l[i]=u}let p="";if(!s){let i=`</${n}>`,u=e.lastIndexOf(i);if(u!==-1){let f=-1,y=null;for(let x=0;x<e.length;x++){let g=e[x];if((g==="'"||g==='"'||g==="`")&&(y?y===g&&(y=null):y=g),g===">"&&!y){f=x;break}}f!==-1&&(p=e.slice(f+1,u).trim())}}let c=be(n,l,p);return{tag:c.type,props:c.props,body:c.body}}function be(t,e,r){let n=et(t),o=Fe(n),a=e["data-format"]||"json",s;try{s=Zt(r,a)}catch{if(n==="list")try{s=bn(r)}catch{}!s&&r.trim()&&(s=r.trim()),s||(s=null)}let l={...e};for(let p in l){let c=l[p];if(typeof c=="string"){let i=c.trim();for(;i.length>=2&&(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")||i.startsWith("`")&&i.endsWith("`"));)i=i.slice(1,-1).trim();if(i==="true")l[p]=!0;else if(i==="false")l[p]=!1;else if(/^-?\d+(\.\d+)?$/.test(i)){let u=Number(i);isNaN(u)||(l[p]=u)}else if(i.startsWith("[")||i.startsWith("{"))try{l[p]=JSON.parse(i)}catch{try{l[p]=JSON.parse(i.replace(/'/g,'"'))}catch{l[p]=i}}else l[p]=i}}let{props:d,body:m}=ht(o,l,s);return{type:o,props:d,body:m,__source:r}}function bn(t){let r=t.split(/\r?\n/).filter(n=>n.trim()).map(n=>{let o=n.match(/^\s*[-*+]\s*\[([ x-])\]\s*(.*)$/);if(o){let s=o[1],l=o[2].trim(),d="todo";return s==="x"?d="done":s==="-"&&(d="doing"),{title:l,status:d}}let a=n.match(/^\s*[-*+]\s*(.*)$/);return a?{title:a[1].trim(),status:"normal"}:null}).filter(Boolean);return r.length>0?{items:r}:null}function xn(t){if(!t.startsWith("<x-")&&!t.startsWith("<xcml:"))return t;let e=t.match(/^(<(?:x-|xcml:)[^\s/>]+)\s*([\s\S]*?)(\/?>)$/);if(!e)return t;let[,r,n,o]=e;if(!n)return t;let a=/([a-zA-Z0-9-]+)\s*=\s*([\[\{])/g,s=0,l="",d;for(;(d=a.exec(n))!==null;){let m=d[1],p=d[2],c=p==="["?"]":"}",i=d.index,u=i+d[0].length-1;if((n.slice(0,i).match(/['"]/g)||[]).length%2!==0)continue;let x=0,g=-1;for(let b=u;b<n.length;b++)if(n[b]===p?x++:n[b]===c&&x--,x===0){g=b;break}if(g!==-1){let b=n[u-1];if(b==="'"||b==='"')continue;let h=n.slice(u,g+1);l+=n.slice(s,i),l+=`${m}='${h}'`,s=g+1,a.lastIndex=s}}return l+=n.slice(s),`${r} ${l}${o}`}function bt(t,e){if(!t)return"";let r=t.match(/<(xcml:|xcml|xcm|xc|x)$/);r&&(t=t.slice(0,r.index));let n=t.replace(/<(\/?)xcml:([a-zA-Z0-9-]+)/g,"<$1x-$2"),o=e?new Set(e):null,a=[],s=0,l=n.length;for(;s<l;){let d=n[s];if(d!=="<"&&d!=="`"){let m=n.indexOf("<",s+1),p=n.indexOf("`",s+1),c=-1;if(m!==-1&&p!==-1?c=Math.min(m,p):m!==-1?c=m:p!==-1&&(c=p),c===-1){a.push(n.slice(s));break}a.push(n.slice(s,c)),s=c;continue}if(n.startsWith("```",s)){let m=n.indexOf("```",s+3);if(m===-1){a.push(n.slice(s));break}a.push(n.slice(s,m+3)),s=m+3;continue}if(d==="`"){let m=n.indexOf("`",s+1);if(m===-1){a.push(n.slice(s));break}a.push(n.slice(s,m+1)),s=m+1;continue}if(d==="<"){let m=-1,p=null;for(let c=s+1;c<l;c++){let i=n[c];if((i==="'"||i==='"'||i==="`")&&(p?p===i&&(p=null):p=i),i===">"&&!p){m=c;break}}if(m===-1){if(s+1<l&&/[a-zA-Z\/]/.test(n[s+1])){let c=s+(n[s+1]==="/"?2:1);for(;c<l&&/[a-zA-Z0-9-]/.test(n[c]);)c++;let i=n.slice(s+(n[s+1]==="/"?2:1),c);if(i.startsWith("x-")){if(o&&!o.has(i))break;n[s+1]!=="/"?a.push(`
|
|
4
4
|
|
|
5
|
-
<${
|
|
5
|
+
<${i} data-xcml-loading="true"></${i}>
|
|
6
6
|
|
|
7
7
|
`):a.push(`
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${n.slice(s).trim()}>
|
|
10
10
|
|
|
11
|
-
`);break}}a.push(d),
|
|
11
|
+
`);break}}a.push(d),s++;continue}else{let c=n[s+1]==="/",i=s+(c?2:1),u=i;for(;u<m&&/[a-zA-Z0-9-]/.test(n[u]);)u++;let f=n.slice(i,u);if(f.startsWith("x-")){if(o&&!o.has(f)){let g=`</${f}>`,b=n.indexOf(g,s);s=b!==-1?b+g.length:m+1;continue}let y=n.slice(s,m+1);c||(y=xn(y.replace(/\r?\n/g," ")));let x=y.replace(/\s+/g," ");if(c||x.endsWith("/>")){a.push(`
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${x}
|
|
14
14
|
|
|
15
|
-
`),
|
|
15
|
+
`),s=m+1;continue}else{let g=`</${f}>`,b=n.indexOf(g,m+1);if(b===-1){let h=x;h.includes("data-xcml-loading")||(h=h.replace(">",' data-xcml-loading="true">')),a.push(`
|
|
16
16
|
|
|
17
|
-
${
|
|
18
|
-
</${
|
|
17
|
+
${h}
|
|
18
|
+
</${f}>
|
|
19
19
|
|
|
20
|
-
`);break}else{let
|
|
20
|
+
`);break}else{let h=n.slice(m+1,b),M=h.trim(),O=h;(M.startsWith("{")||M.startsWith("["))&&(O=h.replace(/\\/g,"\\\\"));let E=x,N=O;if(M){let P=btoa(unescape(encodeURIComponent(h)));E=x.replace(">",` data-xcml-raw="${P}">`),N=""}a.push(`
|
|
21
21
|
|
|
22
|
-
${
|
|
23
|
-
${
|
|
22
|
+
${E}
|
|
23
|
+
${N}
|
|
24
24
|
${g}
|
|
25
25
|
|
|
26
|
-
`),
|
|
26
|
+
`),s=b+g.length;continue}}}}}a.push(d),s++}return a.join("").replace(/\n{3,}/g,`
|
|
27
27
|
|
|
28
|
-
`).trim()}var
|
|
29
|
-
`+
|
|
30
|
-
`:""}</${e}>`},[e,n]);return(0,R.jsxs)("div",{className:(0,Qe.twMerge)("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",r),onMouseEnter:()=>o&&i(!0),onMouseLeave:()=>o&&i(!1),children:[t,a&&o&&(0,R.jsx)(ge.Tooltip,{title:"\u67E5\u770B\u6E90\u7801",children:(0,R.jsx)(ge.Button,{icon:(0,R.jsx)(Qt.CodeOutlined,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:m})}),(0,R.jsx)(ge.Modal,{open:s,onCancel:()=>d(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:(0,R.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:p})})]})}var bt=new WeakMap;function xt(t){if(!t)return"";if(bt.has(t))return bt.get(t);let e=[],n=o=>{o?.forEach(a=>{a&&(a.type==="text"&&typeof a.data=="string"&&e.push(a.data),Array.isArray(a.children)&&n(a.children))})};n(t);let r=e.join("");return bt.set(t,r),r}var hn=j.default.memo(({code:t,theme:e,id:n})=>{let r=j.default.useRef(null);return j.default.useEffect(()=>{!r.current||!t||import("mermaid").then(o=>{o.default.initialize({startOnLoad:!0,theme:e==="dark"?"dark":"default",securityLevel:"loose"});let a=n||`mermaid-${Math.random().toString(36).slice(2)}`;o.default.render(a,t).then(({svg:i})=>{r.current&&(r.current.innerHTML=i)})})},[t,e,n]),(0,R.jsx)("div",{ref:r,className:"mermaid w-full flex justify-center my-4"})});var Y=T(require("react"),1),kn=T(require("@ant-design/plots"),1),_t=require("@chatbi-v/ui-shell");var J=require("react"),tr=require("@chatbi-v/ui-shell"),Ct=require("@chatbi-v/ui-shell"),tt=require("react/jsx-runtime"),bn={theme:"light",setTheme:()=>null},rr=(0,J.createContext)(bn);function xn({children:t,defaultTheme:e="sunset",theme:n,primaryColor:r="#ea580c",storageKey:o="xcml-ui-theme",scoped:a=!0,className:i,style:s,...d}){let[m,p]=(0,J.useState)(()=>localStorage.getItem(o)||e),c=n??m,l=(0,J.useRef)(null);(0,J.useEffect)(()=>{let y=a?l.current:window.document.documentElement;if(!y)return;if(r.startsWith("#")){let g=r.replace(/^#/,""),f=parseInt(g.substring(0,2),16),x=parseInt(g.substring(2,4),16),I=parseInt(g.substring(4,6),16);y.style.setProperty("--primary-rgb",`${f}, ${x}, ${I}`);let _=f/255,M=x/255,A=I/255,w=Math.max(_,M,A),B=Math.min(_,M,A),D=0,ee=0,W=(w+B)/2;if(w!==B){let V=w-B;switch(ee=W>.5?V/(2-w-B):V/(w+B),w){case _:D=(M-A)/V+(M<A?6:0);break;case M:D=(A-_)/V+2;break;case A:D=(_-M)/V+4;break}D/=6}let O=`${Math.round(D*360)} ${Math.round(ee*100)}% ${Math.round(W*100)}%`;y.style.setProperty("--primary",O)}else y.style.setProperty("--primary",r);y.classList.remove("light","dark"),y.removeAttribute("data-theme");let h=["ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyan"];if(c==="system"){let g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(g);return}if(c==="dark"){y.classList.add("dark");return}if(c==="light"){y.classList.add("light");return}if(h.includes(c)){y.setAttribute("data-theme",c);return}},[c,a]);let u={theme:c,setTheme:y=>{localStorage.setItem(o,y),p(y)}},b=(0,J.useMemo)(()=>({algorithm:c==="dark"||c==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ct.theme.darkAlgorithm:Ct.theme.defaultAlgorithm,token:{colorPrimary:r,colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#e11d48",colorInfo:"#0ea5e9",borderRadius:8,fontFamily:'"Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'}}),[c,r]);return(0,tt.jsx)(rr.Provider,{value:u,...d,children:(0,tt.jsx)(tr.XProvider,{theme:b,children:(0,tt.jsx)("div",{ref:l,className:`xcml-scope text-inherit bg-inherit ${i||""}`,style:s,children:t})})})}var Re=()=>{let t=(0,J.useContext)(rr);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var Cn={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},vn={label:{style:{fill:"rgba(255, 255, 255, 0.65)",fontSize:12}},title:{style:{fill:"rgba(255, 255, 255, 0.85)",fontSize:12}},grid:{line:{style:{stroke:"rgba(255, 255, 255, 0.15)",lineWidth:1,lineDash:[4,4]}}}},rt={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Cn},tooltip:{style:{backgroundColor:"rgba(255, 255, 255, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.12)",color:"#1e293b",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(226, 232, 240, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{itemStates:{active:{labelStyle:{fontWeight:600,fill:"#8b5cf6"}}}}}}},nr={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:vn},tooltip:{style:{backgroundColor:"rgba(30, 41, 59, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.3)",color:"#f1f5f9",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(51, 65, 85, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{labelStyle:{fill:"rgba(255, 255, 255, 0.65)"}}}}},or={light:rt,dark:nr,default:rt};function vt(t){return or[t||"default"]||rt}var ar=T(require("react"),1);var wn=ar.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),wt={type:"line",schema:Ne,getComponent:()=>wn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};var ir=T(require("react"),1);var Sn=ir.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),St={type:"column",schema:Me,getComponent:()=>Sn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e.scale?typeof e.scale=="object"&&!e.scale.x&&(e.scale.x={type:"band"}):e.scale={x:{type:"band"}},e}};var sr=T(require("react"),1);var Nn=sr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),Nt={type:"pie",schema:Le,getComponent:()=>Nn,transformProps:t=>{let e={...t};if(delete e.xField,delete e.yField,delete e.seriesField,!e.angleField){let n=(e.data||[])[0]||{},r=Object.keys(n).find(o=>typeof n[o]=="number");r&&(e.angleField=r)}if(!e.colorField){let n=(e.data||[])[0]||{},r=Object.keys(n).find(o=>typeof n[o]=="string");r&&(e.colorField=r)}return e}};var lr=T(require("react"),1);var Mn=lr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),Mt={type:"dual-axes",schema:ke,getComponent:()=>Mn,transformProps:t=>{let e={...t};typeof e.width=="number"&&e.width<50&&delete e.width;let n=e.data||[],r=n.length>0?Object.keys(n[0]):[],o=!1;if(e.children&&e.children.length>0&&(o=e.children.every(s=>s.data&&s.data.length>0||r.length===0?!0:s.yField&&r.includes(s.yField)),!o&&r.length>0&&(e.children=[])),(!e.children||e.children.length===0)&&(Array.isArray(e.yField)&&e.yField.length>=2&&(r.length===0||e.yField.every(d=>r.includes(d)))&&(e.children=[{type:"interval",yField:e.yField[0]},{type:"line",yField:e.yField[1],style:{lineWidth:2}}]),(!e.children||e.children.length===0)&&n.length>0)){let s=e.xField,d=r.filter(m=>m!==s&&typeof n[0][m]=="number");d.length>=2?e.children=[{type:"interval",yField:d[0]},{type:"line",yField:d[1],style:{lineWidth:2}}]:d.length===1&&(e.children=[{type:"interval",yField:d[0]}])}let a=Array.isArray(e.data)&&e.data.length>0,i=Array.isArray(e.children)&&e.children.some(s=>s.data&&Array.isArray(s.data)&&s.data.length>0);if(!a&&i){let{data:s,...d}=e;return d}return e}};var cr=T(require("react"),1);var Ln=cr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Lt={type:"funnel",schema:Pe,getComponent:()=>Ln,transformProps:t=>{let e={...t};!e.xField&&e.categoryField&&(e.xField=e.categoryField),!e.yField&&e.valueField&&(e.yField=e.valueField);let n=e.data||[];if(n.length>0){let o=n[0],a=Object.keys(o);e.xField||(e.xField=a.find(i=>typeof o[i]=="string")||"type"),e.yField||(e.yField=a.find(i=>typeof o[i]=="number")||"value"),e.colorField&&!(e.colorField in o)&&(e.xField&&e.xField in o?e.colorField=e.xField:delete e.colorField),e.seriesField&&!(e.seriesField in o)&&delete e.seriesField}e.axis&&delete e.axis;let r=["light","dark","academy"];return e.theme&&!r.includes(e.theme)&&delete e.theme,typeof e.width=="number"&&e.width<100&&delete e.width,e}};var dr={line:wt,column:St,pie:Nt,"dual-axes":Mt,funnel:Lt};function kt(t){return t&&dr[t.toLowerCase()]||null}var mr=T(require("react"),1),le=require("@chatbi-v/ui-shell"),fe=require("react/jsx-runtime");function Xe(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;let n=Array.isArray(t)?[...t]:{...t};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let o=e[r],a=n[r];typeof o=="object"&&o!==null&&typeof a=="object"&&a!==null&&!mr.default.isValidElement(o)?n[r]=Xe(a,o):n[r]=o}return n}function Pt(t,e){if(!e)return t;let n={...t},r=[...e.props||[],...e.body||[]];return r.length===0?t:(r.forEach(o=>{let a=o.name;if(o.visibleIf&&!o.visibleIf(n)){delete n[a];return}if(o.default!==void 0&&n[a]===void 0?n[a]=o.default:o.default!==void 0&&typeof o.default=="object"&&o.default!==null&&(n[a]=Xe(o.default,n[a])),o.transform){let i=n[a];n[a]=o.transform(i,n)}}),n)}function Tt(t){let{type:e,data:n,theme:r,title:o,__native__:a,...i}=t,s={data:n||[],height:t.height||300,theme:r||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},d=Xe(Xe(s,i),a||{});return d.seriesField&&!d.colorField&&(d.colorField=d.seriesField),d.__native__={...d},d}var Rt=()=>(0,fe.jsx)("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:(0,fe.jsx)(le.Empty,{image:le.Empty.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),Xt=({error:t,reset:e})=>(0,fe.jsx)("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:(0,fe.jsx)(le.Result,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[(0,fe.jsx)(le.Button,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});var ur=T(require("react"),1),yr=require("@chatbi-v/ui-shell");var Ft=require("clsx"),pr=require("tailwind-merge");var U=require("react/jsx-runtime"),Fe=({title:t,icon:e,children:n,source:r,summary:o,variant:a="card",theme:i,hoverable:s=!0,className:d,domNode:m,streamStatus:p,node:c,label:l,value:u,footer:b,precision:y,layout:h,note:g,trend:f,trendValue:x,unit:I,prefix:_,wow:M,yoy:A,sentiment:w,highlights:B,citations:D,actions:ee,steps:W,columns:O,rows:V,charts:E,data:Et,subTitle:Se,themeColor:dt,backgroundImage:jt,qrCode:Bt,author:ro,date:no,...zr})=>{let{theme:Vr}=Re(),de=a==="plain",Hr=i??c?.props?.theme??c?.data?.theme??Vr,Kr=(0,pr.twMerge)((0,Ft.clsx)("xcml-card not-prose max-w-full min-w-0 group",de?"p-1":"rounded-md border border-border/80 bg-card shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-150 ease-out hover:ease-in-out",d,s&&!de?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return(0,U.jsxs)("div",{className:Kr,"data-theme":Hr,...zr,children:[t&&(0,U.jsxs)("div",{className:"relative mb-3",children:[!de&&(0,U.jsx)("div",{className:"absolute -top-3 -inset-x-4 h-1 bg-gradient-to-r from-primary via-primary/60 to-primary/20 opacity-0 transition-all duration-150 group-hover:opacity-100 rounded-full scale-x-95 group-hover:scale-x-100"}),(0,U.jsx)("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:(0,U.jsxs)("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!de&&(0,U.jsx)("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!de&&e&&(0,U.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-md bg-primary/10 text-primary border border-primary/20 shadow-sm",children:e}),t]})})]}),(0,U.jsx)("div",{className:(0,Ft.clsx)("xcml-card-body",!de&&"mt-0.5"),children:n})]})};var Ae=require("react/jsx-runtime");function S(t,e={}){let{schema:n,getTitle:r,getIcon:o,getVariant:a,renderLoading:i,skeleton:s=!0}=e,d=ur.default.forwardRef((p,c)=>{let{merged:l,baseProps:u,isLoading:b,streamStatus:y}=pt(p,n);l.delta!==void 0&&l.trendValue===void 0&&(l.trendValue=l.delta);let{className:h,...g}=p,f=r?r(l):l.title,x;f&&(typeof f=="string"?x=f:typeof f=="object"&&(Array.isArray(f)?x=void 0:x=f.text||f.content||JSON.stringify(f)));let I=o?o(l):l.icon,_=a?a(l):u.variant||"card",M=l.hoverable!==void 0?l.hoverable:!0,A={title:x,icon:I,variant:_,hoverable:M,className:h,node:p.node,streamStatus:y,...g};return b?(0,Ae.jsx)(Fe,{...A,children:i?i(l):s?(0,Ae.jsx)(yr.Skeleton,{active:!0,paragraph:{rows:typeof s=="object"?s.rows:2}}):null}):(0,Ae.jsx)(Fe,{...A,children:(0,Ae.jsx)(t,{...l,ref:c})})}),m=t.displayName||t.name||"Component";return d.displayName=`withXCMLCard(${m})`,d}var H=require("react/jsx-runtime"),fr=require("react"),Pn=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),gr={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},Tn=t=>{if(!t)return null;let e=gr[t.toLowerCase()]||gr[t],n=kn;if(e&&e in n)return n[e];let r=Pn(t);return r&&r in n?n[r]:t in n?n[t]:null},At=class extends Y.default.Component{constructor(n){super(n);this.reset=()=>{this.setState({hasError:!1,error:null})};this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error(`AntV Chart Error (${this.props.type}):`,n,r)}render(){return this.state.hasError&&this.state.error?this.props.errorPlaceholder?this.props.errorPlaceholder(this.state.error,this.reset):(0,H.jsx)(Xt,{error:this.state.error,reset:this.reset}):this.props.children}},Rn=(0,Y.forwardRef)((t,e)=>{let{type:n="line",node:r,theme:o,...a}=t,{theme:i}=Re(),s=(0,Y.useMemo)(()=>kt(n),[n]),d=(0,Y.useMemo)(()=>s?.getComponent()||Tn(n),[s,n]),m=(0,Y.useMemo)(()=>{let u=t.theme||o||i||"light",y=["dark","black","midnight","slate","crimson"].includes(u)?"dark":"light",h=vt(y),g=t.data,f={...t,theme:h,data:g},x=Pt(f,s?.schema||me),I=s?.transformProps?s.transformProps(x):x;return Tt(I)},[t,o,i,s]);if(!d)return(0,H.jsxs)("div",{className:"w-full p-4 border border-dashed border-amber-200 text-amber-600 rounded bg-amber-50/50 text-xs",children:["\u672A\u627E\u5230\u56FE\u8868\u7C7B\u578B: ",n]});let p=m.data&&Array.isArray(m.data)&&m.data.length>0,c=Array.isArray(m.children)&&m.children.some(u=>u.data&&Array.isArray(u.data)&&u.data.length>0);return p||c?(0,H.jsx)(At,{type:n,errorPlaceholder:m.errorPlaceholder,children:(0,H.jsx)(Y.Suspense,{fallback:(0,H.jsx)(_t.Skeleton,{active:!0}),children:(0,H.jsx)("div",{className:"",children:(0,fr.createElement)(d,{...m,ref:e,key:n})})})}):(0,H.jsx)(Rt,{})}),_e=S(Rn,{schema:me,renderLoading:t=>{let e=t.height||300;return(0,H.jsx)("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:(0,H.jsx)(_t.Skeleton.Image,{active:!0})})}}),Xn=t=>{let{node:e,...n}=t;if(e)return(0,H.jsx)(_e,{node:e});let r={props:{},body:{...n,data:t.data}};return(0,H.jsx)(_e,{node:r})};var hr=require("react/jsx-runtime");function Fn(t){let e=t?.theme;return se({chart:(r,o)=>(0,hr.jsx)(_e,{node:r,theme:e,className:r.props?.className},o)})}var Ot=require("react");var nt=require("@ant-design/icons");var L=require("react/jsx-runtime"),br=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),An=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return null;let n=Math.min(...t),o=Math.max(...t)-n||1,a=80,i=32,s=t.map((c,l)=>({x:l/(t.length-1)*a,y:i-(c-n)/o*(i-8)-4})),d=s.reduce((c,l,u,b)=>{if(u===0)return`M ${l.x},${l.y}`;let y=b[u-1],h=(y.x+l.x)/2;return`${c} C ${h},${y.y} ${h},${l.y} ${l.x},${l.y}`},""),m=`${d} L ${a},${i} L 0,${i} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return(0,L.jsx)("div",{className:`relative group/sparkline ${e}`,children:(0,L.jsxs)("svg",{width:a,height:i,className:"overflow-visible",children:[(0,L.jsx)("defs",{children:(0,L.jsxs)("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,L.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),(0,L.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),(0,L.jsx)("path",{d:m,fill:`url(#${p})`}),(0,L.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),(0,L.jsx)("circle",{cx:s[s.length-1].x,cy:s[s.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},_n=t=>{let{precision:e=0,layout:n="vertical",footer:r,value:o,note:a,trend:i,trendValue:s}=t,d=(0,Ot.useMemo)(()=>{if(s==null)return null;if(typeof s=="number"){let b=Math.abs(s)>=1e4?br(s,1):s.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return i==="up"&&!String(s).startsWith("+")?`+${b}`:i==="down"&&!String(s).startsWith("-")?`-${b}`:b}return String(s)},[s,e,i]),m=(0,Ot.useMemo)(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?br(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),p=i==="up",c=i==="down",l=Array.isArray(i);return(0,L.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,L.jsxs)("div",{className:`flex ${n==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[(0,L.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,L.jsxs)("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[(0,L.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),d&&(0,L.jsxs)("div",{className:`flex items-center text-xs font-semibold px-2 py-0.5 rounded-md border shadow-sm transition-all duration-150 ${p?"bg-success/5 text-success border-success/20":c?"bg-destructive/5 text-destructive border-destructive/20":"bg-muted/5 text-muted-foreground border-muted/20"}`,children:[p&&(0,L.jsx)(nt.ArrowUpOutlined,{className:"mr-1 text-xs"}),c&&(0,L.jsx)(nt.ArrowDownOutlined,{className:"mr-1 text-xs"}),(0,L.jsx)("span",{className:"tabular-nums",children:d})]})]}),a&&(0,L.jsx)("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),l&&(0,L.jsx)("div",{className:"shrink-0 mb-1",children:(0,L.jsx)(An,{data:i,className:p?"text-success":c?"text-destructive":"text-primary"})})]}),r&&(0,L.jsxs)("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[(0,L.jsx)("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:r}),(0,L.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},xr=S(_n,{schema:Ie,skeleton:{rows:1}});var Z=require("react/jsx-runtime"),On=t=>{let{description:e,content:n,node:r}=t,o=!!e,a=!!r?.__source&&!(r?.body||r?.data),i=o&&e!==n,s=n||(o&&!i?"":e)||(a?r.__source:"");return(0,Z.jsxs)("div",{className:"flex flex-col gap-4",children:[i&&(0,Z.jsx)("div",{className:"text-foreground/80 text-sm font-medium leading-relaxed border-l-2 border-primary/30 pl-3 py-1 bg-primary/5 rounded-r-sm",children:(0,Z.jsx)(et,{content:e})}),(0,Z.jsx)("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:s?(0,Z.jsx)(et,{content:s}):!i&&(0,Z.jsx)("div",{className:"text-muted-foreground/50 text-xs italic flex items-center gap-2 py-4 justify-center border border-dashed border-border/50 rounded-md",children:(0,Z.jsx)("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},Cr=S(On,{schema:Be,skeleton:{rows:2}});var he=require("@ant-design/icons");var X=require("react/jsx-runtime"),$n=({item:t,layout:e,index:n,stripe:r})=>{let{title:o,desc:a,value:i,status:s,type:d="text"}=t;return d==="metric"?(0,X.jsxs)("div",{className:`bg-muted/30 rounded-lg p-card-half border border-border hover:border-primary/20 transition-colors group ${r?"bg-muted/50":""}`,children:[(0,X.jsx)("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),(0,X.jsx)("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:i}),a&&(0,X.jsx)("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):(0,X.jsxs)("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card-hover hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${r?"bg-muted/60":""}`,children:[(0,X.jsxs)("div",{className:"mt-1",children:[s==="done"&&(0,X.jsx)(he.CheckCircleOutlined,{className:"text-success"}),s==="doing"&&(0,X.jsx)(he.MinusCircleOutlined,{className:"text-primary animate-pulse"}),s==="todo"&&(0,X.jsx)(he.BorderOutlined,{className:"text-muted-foreground/30"}),!s&&(0,X.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:n+1})]}),(0,X.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,X.jsx)("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&(0,X.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},In=t=>{let{header:e,footer:n,layout:r="grid",columns:o=3,items:a=[],type:i="text",stripe:s=!1}=t,d=r==="grid",p={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4",5:"grid-cols-2 md:grid-cols-5",6:"grid-cols-3 md:grid-cols-6"}[o]||"grid-cols-1 md:grid-cols-3";return(0,X.jsxs)(X.Fragment,{children:[e&&(0,X.jsx)("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),(0,X.jsxs)("div",{className:d?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((c,l)=>(0,X.jsx)($n,{item:{type:i,...c},layout:r,index:l,stripe:s&&l%2===1},l)),a.length===0&&(0,X.jsx)("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),n&&(0,X.jsx)("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:n})]})},vr=S(In,{schema:je,skeleton:{rows:3}});var wr=T(require("react"),1);var be=require("react/jsx-runtime"),En=()=>{let{items:t}=Ut(),e=wr.default.useMemo(()=>t.filter(o=>o.level>1),[t]),n=(o,a)=>{o.preventDefault();let i=document.getElementById(a);i&&i.scrollIntoView({behavior:"smooth"})},r=o=>{switch(o){case 2:return"pl-4";case 3:return"pl-8";case 4:return"pl-12";case 5:return"pl-16";case 6:return"pl-20";default:return"pl-4"}};return(0,be.jsx)("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?(0,be.jsx)("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):(0,be.jsx)("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>(0,be.jsx)("li",{className:`mb-2 text-sm leading-relaxed relative ${r(o.level)}`,children:(0,be.jsx)("a",{href:`#${o.id}`,onClick:a=>n(a,o.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:o.title})},o.id))})})},Sr=S(En,{schema:De,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});var Nr=require("react");var K=require("@chatbi-v/ui-shell"),$t=require("@ant-design/icons");var v=require("react/jsx-runtime"),jn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return(0,v.jsx)("span",{className:"text-muted-foreground/30",children:"-"});let n=Math.min(...t),o=Math.max(...t)-n||1,a=60,i=24,s=t.map((m,p)=>({x:p/(t.length-1)*a,y:i-(m-n)/o*(i-4)-2})),d=s.reduce((m,p,c,l)=>{if(c===0)return`M ${p.x},${p.y}`;let u=l[c-1],b=(u.x+p.x)/2;return`${m} C ${b},${u.y} ${b},${p.y} ${p.x},${p.y}`},"");return(0,v.jsx)("div",{className:e||"text-primary",children:(0,v.jsxs)("svg",{width:a,height:i,className:"overflow-visible",children:[(0,v.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,v.jsx)("circle",{cx:s[s.length-1].x,cy:s[s.length-1].y,r:"2",fill:"currentColor"})]})})},Bn=t=>{let{bordered:e=!0,size:n="middle",summary:r=!1,columns:o=[],rows:a=[],dataSource:i=[]}=t,s=i.length>0?i:a,d=o.length>0&&s.length>0,m=(0,Nr.useMemo)(()=>o.map(c=>({title:(0,v.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,v.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:c.title}),c.desc&&(0,v.jsx)(K.Tooltip,{title:c.desc,children:(0,v.jsx)($t.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:c.key,key:c.key,align:c.align||"left",flex:1,render:l=>{switch(c.type){case"progress":{let u=typeof l=="string"?parseFloat(l):l,b=u<=1?u*100:u,y="normal";return b>=100?y="success":b<60&&(y="exception"),(0,v.jsx)("div",{className:"flex items-center gap-2 min-w-24",children:(0,v.jsx)(K.Progress,{percent:Math.round(b),size:"small",status:y,showInfo:!0,strokeColor:b>=100?"var(--success)":b<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return(0,v.jsx)(jn,{data:Array.isArray(l)?l:[]});case"badge":{let u="default",b=String(l).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(b)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(b)?u="error":["warning","warn","\u8B66\u544A"].includes(b)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(b)&&(u="processing"),(0,v.jsx)(K.Badge,{status:u,text:(0,v.jsx)("span",{className:"text-xs",children:l})})}case"image":return(0,v.jsx)("img",{src:l,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return(0,v.jsxs)("span",{className:"font-mono text-foreground/90 font-medium",children:[c.prefix,l?.toLocaleString?.()??l,c.suffix]});default:return(0,v.jsxs)("span",{className:"text-foreground/90",children:[c.prefix,l,c.suffix]})}}})),[o]);return(0,v.jsxs)("div",{className:"w-full xcml-table-container",children:[(0,v.jsx)(K.Table,{dataSource:s,columns:m,pagination:!1,size:n==="large"?"middle":"small",bordered:e,className:"xcml-custom-table [&_.ant-table]:!bg-transparent [&_.ant-table]:text-sm [&_.ant-table-thead_tr_th]:!bg-muted/40 [&_.ant-table-thead_tr_th]:border-b [&_.ant-table-thead_tr_th]:border-border/60 [&_.ant-table-thead_tr_th]:!py-3 [&_.ant-table-thead_tr_th]:!px-4 [&_.ant-table-tbody_tr_td]:border-b [&_.ant-table-tbody_tr_td]:border-border/30 [&_.ant-table-tbody_tr_td]:!py-2.5 [&_.ant-table-tbody_tr_td]:!px-4 [&_.ant-table-tbody_tr_td]:transition-all [&_.ant-table-tbody_tr_td]:duration-150 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:rounded-md [&_.ant-table-container]:overflow-hidden",scroll:{x:"max-content"},rowKey:(c,l)=>l?.toString()??"",summary:r?c=>!r||!d?null:(0,v.jsx)(K.Table.Summary,{fixed:!0,children:(0,v.jsx)(K.Table.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((l,u)=>{if(u===0)return(0,v.jsx)(K.Table.Summary.Cell,{index:0,children:(0,v.jsx)("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(l.type==="number"||["amount","value","sales","total"].includes(l.key)))return(0,v.jsx)(K.Table.Summary.Cell,{index:u},`summary-${l.key}`);let y=c.reduce((h,g)=>{let f=g[l.key],x=typeof f=="string"?parseFloat(f.replace(/[^0-9.-]/g,"")):f;return h+(typeof x=="number"&&!isNaN(x)?x:0)},0);return(0,v.jsx)(K.Table.Summary.Cell,{index:u,align:l.align,children:(0,v.jsxs)("span",{className:"text-primary font-mono",children:[l.prefix,Number.isInteger(y)?y:y.toFixed(2),l.suffix]})},`summary-${l.key}`)})})}):void 0,locale:{emptyText:(0,v.jsxs)("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[(0,v.jsx)("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:(0,v.jsx)($t.InfoCircleOutlined,{className:"text-xl opacity-20"})}),(0,v.jsx)("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!r&&d&&(0,v.jsxs)("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",s.length," rows"]})]})},Mr=S(Bn,{schema:Ee,skeleton:{rows:4}});var xe=require("react/jsx-runtime");function Dn(t){let e=t?.theme?{"data-theme":t.theme}:{};return se({metric:(r,o)=>(0,xe.jsx)(xr,{node:r,...e},o),card:(r,o)=>(0,xe.jsx)(Cr,{node:r,...e},o),list:(r,o)=>(0,xe.jsx)(vr,{node:r,...e},o),toc:(r,o)=>(0,xe.jsx)(Sr,{node:r,...e},o),table:(r,o)=>(0,xe.jsx)(Mr,{node:r,...e},o)})}var Ce=require("@ant-design/icons"),kr=T(require("react-countup"),1);var G=require("react/jsx-runtime"),Lr=(t,e)=>{if(t==null)return null;let n=t>0,r=t===0,o=n?"text-success bg-success/5":r?"text-muted-foreground/40":"text-destructive bg-destructive/5",a=n?Ce.ArrowUpOutlined:r?Ce.MinusOutlined:Ce.ArrowDownOutlined;return(0,G.jsxs)("div",{className:`flex items-center px-2 py-0.5 rounded-full ${o} text-xs font-bold border border-current/10 transition-all shadow-sm`,children:[(0,G.jsx)("span",{className:"opacity-70 mr-1",children:e}),(0,G.jsx)(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},Wn=t=>{let{value:e,wow:n,yoy:r,unit:o="",prefix:a="",footer:i,precision:s}=t;return(0,G.jsxs)("div",{className:"flex flex-col",children:[(0,G.jsxs)("div",{className:"text-metric-lg font-black my-2 bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground to-foreground/70 group-hover:from-primary group-hover:to-pink-500 transition-all duration-500 tracking-tighter",children:[(0,G.jsx)("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),(0,G.jsx)(kr.default,{end:Number(e)||0,decimals:s,separator:",",duration:2.5}),(0,G.jsx)("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),(0,G.jsxs)("div",{className:"flex space-x-2 mt-2",children:[Lr(n,"\u73AF\u6BD4"),Lr(r,"\u540C\u6BD4")]}),i&&(0,G.jsx)("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:i})]})},Pr=S(Wn,{schema:ze,getTitle:t=>t.title||t.label,skeleton:{rows:2}});var Tr=require("react");var ot=require("@chatbi-v/ui-shell"),Rr=require("@ant-design/plots");var z=require("react/jsx-runtime"),qn=({item:t})=>{let[e,n]=(0,Tr.useState)(!1),{label:r,value:o,wow:a,trendData:i=[]}=t,d={data:i.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return(0,z.jsxs)("div",{className:"p-3 border border-border/60 rounded-lg hover:shadow-card hover:border-primary/30 transition-all relative bg-muted/40 text-card-foreground min-h-[6rem] flex flex-col justify-between group overflow-hidden",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,z.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),(0,z.jsxs)("div",{className:"relative z-10",children:[(0,z.jsx)("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:r}),(0,z.jsxs)("div",{className:"flex items-end justify-between flex-wrap",children:[(0,z.jsx)("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&(0,z.jsx)("div",{className:`w-2 h-2 rounded-full ${a>0?"bg-success":a<0?"bg-destructive":"bg-muted"} shadow-[0_0_6px_rgba(var(--primary),0.2)]`,title:`\u73AF\u6BD4: ${a}%`})]})]}),i.length>0&&(0,z.jsx)("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:(0,z.jsx)(Rr.Line,{...d})})]})},zn=t=>{let{items:e=[]}=t,n=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return(0,z.jsx)(ot.Row,{gutter:[16,16],children:e.map((r,o)=>(0,z.jsx)(ot.Col,{span:n,children:(0,z.jsx)(qn,{item:r})},o))})},Xr=S(zn,{schema:Ve,skeleton:{rows:2}});var at=require("react"),Q=require("@chatbi-v/ui-shell"),Fr=require("react-csv"),ve=require("@ant-design/icons");var N=require("react/jsx-runtime"),Vn=t=>{let{title:e,description:n,bordered:r=!0,columns:o=[],rows:a=[],dataSource:i=[]}=t,s=i.length>0?i:a,d=(0,at.useMemo)(()=>s.map((l,u)=>({...l,__xcml_row_key:l.__xcml_key||l.id||`row-${u}`})),[s]),m=(0,at.useMemo)(()=>o.map(l=>({...l,dataIndex:l.key||l.dataIndex,title:(0,N.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,N.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:l.title}),l.desc&&(0,N.jsx)(Q.Tooltip,{title:l.desc,children:(0,N.jsx)(ve.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:l.align||"left",width:l.width,flex:1,render:u=>{if(u==null||u==="")return(0,N.jsx)("span",{className:"text-muted-foreground/30 italic",children:"-"});let b=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return(0,N.jsx)("div",{className:`whitespace-normal break-words ${b?"font-mono":""}`,children:b?u.toLocaleString():u})}})),[o]),p=(0,at.useMemo)(()=>o.map(l=>({label:l.title,key:l.key||l.dataIndex})),[o]),c=d.length>0;return(0,N.jsxs)("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(n||c)&&(0,N.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,N.jsxs)("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&(0,N.jsxs)("div",{className:"flex items-center gap-2",children:[(0,N.jsx)("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary shadow-sm border border-primary/10",children:(0,N.jsx)(ve.TableOutlined,{className:"text-sm"})}),(0,N.jsx)("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),n&&(0,N.jsx)("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:n})]}),c&&(0,N.jsx)(Fr.CSVLink,{data:d,headers:p,filename:`${e||"snapshot"}.csv`,children:(0,N.jsx)(Q.Button,{size:"small",icon:(0,N.jsx)(ve.DownloadOutlined,{}),className:"flex items-center gap-1.5 text-xs h-8 px-3 rounded-md border-border/60 hover:border-primary/50 hover:text-primary bg-card/50 transition-all duration-150",children:"\u5BFC\u51FA CSV"})})]}),(0,N.jsxs)("div",{className:"relative group",children:[(0,N.jsx)(Q.Table,{columns:m,dataSource:d,rowKey:"__xcml_row_key",pagination:d.length>10?{pageSize:10,size:"small",showSizeChanger:!1,className:"mt-4 px-2"}:!1,scroll:{x:"max-content"},className:"xcml-custom-snapshot-table [&_.ant-table]:!bg-transparent [&_.ant-table]:!text-xs [&_.ant-table-thead_tr_th]:!bg-muted/30 [&_.ant-table-thead_tr_th]:!border-b [&_.ant-table-thead_tr_th]:!border-border/60 [&_.ant-table-thead_tr_th]:!py-2.5 [&_.ant-table-thead_tr_th]:!px-3 [&_.ant-table-thead_tr_th]:!text-foreground/70 [&_.ant-table-tbody_tr_td]:!border-b [&_.ant-table-tbody_tr_td]:!border-border/30 [&_.ant-table-tbody_tr_td]:!py-2 [&_.ant-table-tbody_tr_td]:!px-3 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:!rounded-md [&_.ant-table-container]:!overflow-hidden [&_.ant-table-bordered_.ant-table-container]:!border-border/50 [&_.ant-pagination-item-active]:!border-primary [&_.ant-pagination-item-active]:!bg-primary/5 [&_.ant-pagination-item-active_a]:!text-primary",bordered:r,size:"small",locale:{emptyText:(0,N.jsx)(Q.Empty,{image:Q.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,N.jsx)("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),(0,N.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l from-background/50 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity"})]}),c&&(0,N.jsxs)("div",{className:"flex items-center justify-between px-1 mt-1",children:[(0,N.jsxs)("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[(0,N.jsx)("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",d.length," \u6761\u8BB0\u5F55"]}),(0,N.jsxs)("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},Ar=S(Vn,{schema:Ke,skeleton:{rows:5}});var Or=T(require("react"),1),ce=require("@chatbi-v/ui-shell"),It=require("clsx"),$r=require("tailwind-merge"),Ir=T(require("react-highlight-words"),1),P=require("@ant-design/icons");var C=require("react/jsx-runtime"),_r={positive:{icon:(0,C.jsx)(P.RiseOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:(0,C.jsx)(P.FallOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:(0,C.jsx)(P.WarningOutlined,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:(0,C.jsx)(P.CloseCircleOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:(0,C.jsx)(P.CheckCircleOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:(0,C.jsx)(P.BulbOutlined,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:(0,C.jsx)(P.InfoCircleOutlined,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},Hn=t=>{let{content:e="",highlights:n=[],sentiment:r="insight",citations:o=[],actions:a=[]}=t,i=ie(n),s=ie(o),d=ie(a),m=_r[r]||_r.insight,p=l=>{ue.emit("action_click",{action:l,source:"insight_card"})},c=l=>{ue.emit("feedback",{type:l,source:"insight_card",content:e})};return(0,C.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,C.jsxs)("div",{className:(0,$r.twMerge)("relative overflow-hidden rounded-2xl border transition-all duration-300",m.bg,m.border,"p-5 shadow-sm hover:shadow-md"),children:[(0,C.jsx)("div",{className:"absolute -right-4 -top-4 w-24 h-24 blur-3xl opacity-20 bg-current pointer-events-none"}),(0,C.jsxs)("div",{className:"relative flex gap-4",children:[(0,C.jsx)("div",{className:(0,It.clsx)("flex items-center justify-center w-10 h-10 rounded-xl shadow-sm border shrink-0","bg-background/80 backdrop-blur-sm",m.color,m.border),children:Or.default.cloneElement(m.icon,{className:"text-lg"})}),(0,C.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("span",{className:(0,It.clsx)("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[(0,C.jsx)(ce.Tooltip,{title:"\u6709\u5E2E\u52A9",children:(0,C.jsx)(ce.Button,{type:"text",size:"small",icon:(0,C.jsx)(P.LikeOutlined,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("up")})}),(0,C.jsx)(ce.Tooltip,{title:"\u65E0\u5E2E\u52A9",children:(0,C.jsx)(ce.Button,{type:"text",size:"small",icon:(0,C.jsx)(P.DislikeOutlined,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("down")})})]})]}),(0,C.jsx)("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:(0,C.jsx)(Ir.default,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:i,autoEscape:!0,textToHighlight:e})}),s.length>0&&(0,C.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:s.map((l,u)=>(0,C.jsxs)("button",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/20 border border-border/50 text-xs text-muted-foreground hover:text-primary hover:border-primary/30 transition-all cursor-pointer",children:[(0,C.jsx)(P.LinkOutlined,{className:"text-xs"}),l]},u))})]})]})]}),d.length>0&&(0,C.jsxs)("div",{className:"space-y-3 px-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-xs font-bold text-foreground/40 uppercase tracking-widest",children:[(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-border/50"}),(0,C.jsx)(P.ThunderboltOutlined,{className:"text-amber-500"}),(0,C.jsx)("span",{children:"\u4E0B\u4E00\u6B65\u884C\u52A8\u5EFA\u8BAE"}),(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-border/50"})]}),(0,C.jsx)("div",{className:"flex flex-wrap gap-2.5",children:d.map((l,u)=>(0,C.jsx)(ce.Button,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(l),children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"text-xs font-semibold text-foreground/80 group-hover:text-primary transition-colors",children:l}),(0,C.jsx)(P.ThunderboltOutlined,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},Er=S(Hn,{schema:We,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>(0,C.jsx)(P.BulbOutlined,{}),getVariant:()=>"plain",skeleton:{rows:4}});var st=require("react"),te=require("@chatbi-v/ui-shell"),lt=require("@ant-design/icons"),jr=T(require("html2canvas"),1),we=require("@ant-design/plots");var k=require("react/jsx-runtime"),it=[{label:"\u79D1\u6280\u84DD",value:"#1890ff",bg:"#f0f5ff"},{label:"\u6D3B\u529B\u6A59",value:"#fa8c16",bg:"#fff7e6"},{label:"\u6E05\u65B0\u7EFF",value:"#52c41a",bg:"#f6ffed"},{label:"\u6697\u591C\u7D2B",value:"#722ed1",bg:"#f9f0ff"},{label:"\u5546\u52A1\u7070",value:"#595959",bg:"#f5f5f5"}],Kn=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:n="Data Insight Poster",charts:r=[],qrCode:o="https://ant.design",author:a="ChatBI",date:i=new Date().toLocaleDateString(),backgroundImage:s,themeColor:d}=t,m=typeof s=="string"?s.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=(0,st.useRef)(null),[c,l]=(0,st.useState)(it[0]),u=d||c.value,b=d?`${d}10`:c.bg,y=async()=>{if(p.current)try{let f=(await(0,jr.default)(p.current,{useCORS:!0,scale:2,backgroundColor:c.bg})).toDataURL("image/png"),x=document.createElement("a");x.href=f,x.download=`poster-${Date.now()}.png`,x.click()}catch(g){console.error("Poster generation failed",g)}},h=(g,f)=>{let x={data:g.data,height:200,autoFit:!0};return g.type==="column"||g.type==="bar"?(0,k.jsx)(we.Column,{...x,xField:"label",yField:"value"},f):g.type==="line"?(0,k.jsx)(we.Line,{...x,xField:"label",yField:"value"},f):g.type==="pie"?(0,k.jsx)(we.Pie,{...x,angleField:"value",colorField:"label"},f):null};return(0,k.jsxs)("div",{className:"flex flex-col",children:[(0,k.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,k.jsx)(te.Space,{children:(0,k.jsx)(te.Select,{value:c.value,onChange:g=>l(it.find(f=>f.value===g)||it[0]),options:it,className:"w-32",suffixIcon:(0,k.jsx)(lt.BgColorsOutlined,{})})}),(0,k.jsx)(te.Button,{type:"primary",icon:(0,k.jsx)(lt.DownloadOutlined,{}),onClick:y,children:"\u751F\u6210\u6D77\u62A5"})]}),(0,k.jsx)("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:(0,k.jsxs)("div",{ref:p,className:"p-8 w-full mx-auto transition-colors duration-300 flex flex-col shrink-0 bg-cover bg-center text-zinc-800 min-h-full",style:{backgroundColor:b,backgroundImage:m?`url(${m})`:void 0},children:[(0,k.jsxs)("div",{className:"mb-6 text-center",children:[(0,k.jsx)("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),(0,k.jsx)("p",{className:"text-sm opacity-70",children:n})]}),(0,k.jsx)("div",{className:"space-y-6 mb-8",children:r.map((g,f)=>(0,k.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[(0,k.jsx)("h4",{className:"font-medium mb-2 text-center",children:g.title}),h(g,f)]},f))}),(0,k.jsxs)("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[(0,k.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,k.jsxs)("p",{children:["Created by ",a]}),(0,k.jsx)("p",{children:i})]}),(0,k.jsx)("div",{className:"bg-white p-1 rounded",children:(0,k.jsx)(te.QRCode,{value:o,size:64,bordered:!1})})]})]})})]})},Br=S(Kn,{schema:He,skeleton:{rows:4}});var ct=require("@chatbi-v/ui-shell"),re=require("@ant-design/icons");var F=require("react/jsx-runtime"),{Text:Jn}=ct.Typography,Gn=t=>{switch(t){case"success":return(0,F.jsx)(re.CheckCircleFilled,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return(0,F.jsx)(re.CloseCircleFilled,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return(0,F.jsx)(re.LoadingOutlined,{className:"text-primary bg-card rounded-full relative z-10"});default:return(0,F.jsx)(re.ClockCircleFilled,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},Un=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},Yn=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},Zn=t=>{let{steps:e=[]}=t;return(0,F.jsxs)("div",{className:"relative pl-2 py-2",children:[(0,F.jsx)("div",{className:"absolute top-4 bottom-4 left-[15px] w-0.5 bg-gradient-to-b from-primary/10 via-primary/30 to-primary/10"}),e.map((n,r)=>(0,F.jsxs)("div",{className:"relative flex mb-6 last:mb-0 group",children:[(0,F.jsx)("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:Gn(n.status)}),(0,F.jsxs)("div",{className:"flex-1 min-w-0 bg-card rounded-xl p-3 border border-border/50 hover:border-primary/30 hover:shadow-md transition-all duration-300 group-hover:-translate-y-0.5",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-bold text-sm text-foreground",children:n.tool||`\u6B65\u9AA4 ${r+1}`}),(0,F.jsx)(Jn,{type:"secondary",className:"text-xs text-muted-foreground",children:n.action})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[n.duration&&(0,F.jsx)("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:n.duration}),(0,F.jsx)(ct.Tag,{color:Yn(n.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:Un(n.status)})]})]}),n.thought&&(0,F.jsx)("div",{className:"mb-2 text-xs text-muted-foreground italic border-l-2 border-primary/30 pl-2 py-1 bg-primary/5 rounded-r-md whitespace-pre-wrap leading-normal",children:n.thought}),n.result&&(0,F.jsx)("div",{className:"mt-2 text-xs",children:(0,F.jsx)("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:(0,F.jsx)("pre",{className:"m-0 whitespace-pre-wrap font-mono text-xs text-muted-foreground leading-relaxed",children:typeof n.result=="string"?n.result:JSON.stringify(n.result,null,2)})})}),n.error&&(0,F.jsxs)("div",{className:"mt-2 text-xs text-destructive bg-destructive/5 p-2 rounded-lg border border-destructive/20 whitespace-pre-wrap",children:["\u9519\u8BEF: ",n.error]})]})]},r))]})},Dr=S(Zn,{schema:Je,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});var Oe=require("react"),ne=require("@chatbi-v/ui-shell"),oe=require("@ant-design/icons");var Wr=T(require("react-highlight-words"),1);var $=require("react/jsx-runtime"),Qn=t=>{let{message:e}=ne.App.useApp(),{label:n="\u62A5\u544A\u6458\u8981",value:r=0,step:o=1,unit:a="",actionId:i="update_summary",content:s="",highlightKeywords:d=[]}=t,[m,p]=(0,Oe.useState)(Number(r)||0),[c,l]=(0,Oe.useState)(!1);(0,Oe.useEffect)(()=>{p(Number(r)||0)},[r]);let u=ie(d),b=h=>{p(h)};return(0,$.jsxs)("div",{className:"flex flex-col",children:[s&&(0,$.jsx)("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:(0,$.jsx)(Wr.default,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:s})}),(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:n}),(0,$.jsxs)("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,(0,$.jsx)("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),(0,$.jsxs)("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[(0,$.jsx)(ne.Button,{icon:(0,$.jsx)(oe.MinusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>b(m-Number(o)),disabled:c}),(0,$.jsx)(ne.InputNumber,{value:m,onChange:h=>b(Number(h)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:c}),(0,$.jsx)(ne.Button,{icon:(0,$.jsx)(oe.PlusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>b(m+Number(o)),disabled:c}),(0,$.jsx)("div",{className:"w-px h-4 bg-border/50 mx-1"}),(0,$.jsx)(ne.Button,{type:"primary",size:"small",shape:"round",icon:c?(0,$.jsx)(oe.LoadingOutlined,{}):(0,$.jsx)(oe.SaveOutlined,{}),onClick:async()=>{l(!0);try{ue.emit("action",{type:i,payload:{value:m,label:n,...t}}),await new Promise(h=>setTimeout(h,800)),e.success(`\u5DF2\u66F4\u65B0 ${n} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{l(!1)}},loading:c,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},qr=S(Qn,{schema:qe,getTitle:t=>t.label,skeleton:{rows:2}});var ae=require("react/jsx-runtime");function eo(t){let e=t?.theme?{"data-theme":t.theme}:{};return se({"metric-card":(o,a)=>(0,ae.jsx)(Pr,{node:o,...e},a),"mini-kpi-strip":(o,a)=>(0,ae.jsx)(Xr,{node:o,...e},a),"snapshot-table":(o,a)=>(0,ae.jsx)(Ar,{node:o,...e},a),"insight-card":(o,a)=>(0,ae.jsx)(Er,{node:o,...e},a),"poster-card":(o,a)=>(0,ae.jsx)(Br,{node:o,...e},a),"thought-chain":(o,a)=>(0,ae.jsx)(Dr,{node:o,...e},a),"interactive-summary":(o,a)=>(0,ae.jsx)(qr,{node:o,...e},a)},{})}0&&(module.exports={AntVChartLoader,COMMON_PROPS,DefaultEmptyPlaceholder,DefaultErrorPlaceholder,ThemeProvider,XCMLCardWrapper,XCMLChart,XCMLEventBus,XCMLMarkdown,XCML_SCHEMAS,buildConfig,chartSchema,cleanPropsBySchema,columnChartSchema,columnStrategy,createAntVRenderers,createBasicRenderers,createExtendedRenderers,createRenderersWithAliases,deepMerge,dualAxesChartSchema,dualAxesStrategy,extractBaseStyles,funnelChartSchema,funnelStrategy,getChartStrategy,getTheme,lineChartSchema,lineStrategy,mergePropsAndBody,normalizeNodeData,normalizeTagName,parse,parseArrayProp,parseInlineData,parseXCML,pieChartSchema,pieStrategy,preprocessXCML,renderXCML,strategies,stringify,stringifyToXCML,themeDark,themeLight,themeMap,toXCMLNodeFromElement,toXCMLTag,toXTag,useTheme,useXCMLComponent,useXCMLNode,validateDataSchema,validateXCMLNode,withXCMLCard,xTagPlugin,xcmlBus});
|
|
28
|
+
`).trim()}var $=F(require("react"),1),ar=require("@ant-design/x-markdown");var xe=require("@chatbi-v/ui-shell"),ir=require("@ant-design/icons");var z=F(require("react"),1),xt=require("react/jsx-runtime"),er=(0,z.createContext)([]),tr=(0,z.createContext)({register:()=>{},unregister:()=>{}}),Cn=()=>(0,z.useContext)(er),Ct=()=>(0,z.useContext)(tr),rr=()=>{let t=Cn(),{register:e,unregister:r}=Ct();return{items:t,register:e,unregister:r}},nr=({children:t})=>{let[e,r]=(0,z.useState)(new Map),n=z.default.useRef(0),o=(0,z.useCallback)(d=>{r(m=>{let p=new Map(m),c=p.get(d.id);return c&&c.title===d.title&&c.level===d.level?m:(p.set(d.id,{...d,index:c?c.index:n.current++}),p)})},[]),a=(0,z.useCallback)(d=>{r(m=>{let p=new Map(m);return p.delete(d)?p:m})},[]),s=z.default.useMemo(()=>Array.from(e.values()).sort((d,m)=>d.index-m.index),[e]),l=z.default.useMemo(()=>({register:o,unregister:a}),[o,a]);return(0,xt.jsx)(tr.Provider,{value:l,children:(0,xt.jsx)(er.Provider,{value:s,children:t})})};var U=require("react"),vt=require("react/jsx-runtime"),or=(0,U.createContext)({containerWidth:0}),wt=({children:t})=>{let[e,r]=(0,U.useState)(0),n=(0,U.useRef)(null),o=(0,U.useRef)(0),a=(0,U.useRef)(0);return(0,U.useEffect)(()=>{let s=n.current;if(!s)return;let l=c=>{for(let i of c){let u=i.borderBoxSize?.[0]?.inlineSize??i.contentRect.width,f=Math.floor(u);Math.abs(f-o.current)>=1&&(cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{o.current=f,r(f)}))}},d=new ResizeObserver(l);d.observe(s);let p=s.getBoundingClientRect().width;return o.current=Math.floor(p),r(Math.floor(p)),()=>{d.disconnect(),cancelAnimationFrame(a.current)}},[]),(0,vt.jsx)(or.Provider,{value:{containerWidth:e},children:(0,vt.jsx)("div",{ref:n,className:"xcml-layout-container w-full min-w-0 relative block","data-container-width":e,children:t})})},St=()=>(0,U.useContext)(or);function vn(t={}){let r=`(${(t.tags||["chart","table","metric","list","card","toc"]).join("|")})`,n=new RegExp(`<x-${r}([^>]*)>`,"i");return{level:"block",name:"x-tag",start(o){return o.indexOf("<x-")},tokenizer(o){let a=o.match(n);if(!a)return;let s=a[1],l=a[2]||"",d=a.index||0,m=new RegExp(`</x-${s}>`,"i"),p=o.slice(d+a[0].length),c=p.match(m);if(!c)return;let i=p.slice(0,c.index),u=o.slice(d,d+a[0].length+i.length+c[0].length),f=wn(l);return{type:"x-tag",raw:u,name:s,attrs:f,body:i}},renderer(o){let a=be(o.name,o.attrs,o.body);return{type:a.type,props:a.props,body:a.body}}}}function wn(t){let e={},r=/(\w[\w-]*)(=\"([^\"]*)\"|=\'([^\']*)\'|=([^\s"']+))?/g,n;for(;n=r.exec(t);){let o=n[1],a=n[3]??n[4]??n[5]??!0;e[o]=a}return e}var sr=require("clsx"),rt=require("tailwind-merge"),T=require("react/jsx-runtime");function nt(t){let{content:e,stream:r,renderers:n,className:o,style:a,openLinksInNewTab:s,dompurifyConfig:l,enableHoverSource:d=!1,theme:m,onContentChange:p,onComponentRender:c}=t;$.default.useEffect(()=>{e&&p&&p(e)},[e,p]);let i=$.default.useDeferredValue(e),u=$.default.useMemo(()=>{let g=n?Object.keys(n).map(b=>b.startsWith("xcml:")?`x-${b.slice(5)}`:b):[];return i?bt(i,g):""},[i,n]),f=$.default.useMemo(()=>new WeakMap,[]),y=$.default.useMemo(()=>{let g={};if(n){let h=new Set;Object.keys(n).forEach(M=>{let O=M.startsWith("xcml:"),E=M.startsWith("x-");if(O||E){let N=O?`x-${M.slice(5)}`:M;h.add(N);let P=n[M];g[N]=q=>{let{domNode:R,className:V,streamStatus:G,node:se,children:j,...B}=q,le=f.get(R);if(!le){let ce="",ut=B["data-xcml-raw"];if(ut)try{ce=decodeURIComponent(escape(atob(ut)))}catch(Ht){console.error("[XCML] Failed to decode raw body:",Ht),ce=Nt(R?.children||[])}else ce=Nt(R?.children||[]);let Vt=O?M.slice(5):M.slice(2);le=be(Vt,B,ce),f.set(R,le)}let D={...le};B["data-xcml-loading"]==="true"?D.streamStatus="loading":D.streamStatus=G;let zt=P(D,B.key??N);return(0,T.jsx)(Sn,{tag:N,node:D,className:V,enableHoverSource:d,onStatusChange:ce=>c?.(N,ce),children:zt})}}})}g.pre=h=>{let{domNode:M,streamStatus:O,node:E,...N}=h,P=(M?.children||[]).find(V=>V?.name==="code"),q=[P?.attribs?.class,P?.attribs?.classname,P?.attribs?.className].filter(Boolean).join(" ");if(/language-mermaid/.test(q)){let V=Nt(P?.children||[]),G=V.split("").reduce((j,B)=>(j=(j<<5)-j+B.charCodeAt(0),j&j),0),se=`m-${Math.abs(G)}`;return(0,T.jsx)(Mn,{id:se,code:V,theme:m},h.key)}return $.default.createElement("pre",N,h.children)},g.p=h=>{let{domNode:M,node:O,children:E,streamStatus:N,...P}=h;return M?.children?.some(R=>R.type==="tag"&&(["div","p","pre","blockquote","table","ul","ol","h1","h2","h3","h4","h5","h6","form","fieldset","address"].includes(R.name)||R.name&&R.name.startsWith("x-")))||O?.children?.some(R=>R.tagName==="div"||R.tagName&&R.tagName.startsWith("x-"))?(0,T.jsx)("div",{...P,className:(0,rt.twMerge)("mb-4 w-full",P.className),children:E}):(0,T.jsx)("p",{...P,children:E})};let b=$.default.memo(({level:h,children:M,domNode:O,streamStatus:E,node:N,...P})=>{let{register:q,unregister:R}=Ct(),V=$.default.useCallback(D=>typeof D=="string"?D:Array.isArray(D)?D.map(V).join(""):$.default.isValidElement(D)?V(D.props.children):"",[]),G=V(M),se=$.default.useMemo(()=>G.trim().toLowerCase().replace(/\s+/g,"-"),[G]),j=P.id||se||`h${h}-${Math.random().toString(36).slice(2,9)}`,B=$.default.useRef(null);$.default.useEffect(()=>{if(!q)return;let D={id:j,title:G,level:h};return(!B.current||B.current.id!==D.id||B.current.title!==D.title||B.current.level!==D.level)&&(B.current&&R?.(B.current.id),q(D),B.current=D),()=>{B.current&&(R?.(B.current.id),B.current=null)}},[j,G,h,q,R]);let le=`h${h}`;return(0,T.jsxs)(le,{id:j,className:"scroll-mt-20 group relative",...P,children:[M,d&&(0,T.jsx)("a",{href:`#${j}`,className:"ml-2 opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity no-underline",children:"#"})]})});return g.h1=h=>(0,T.jsx)(b,{level:1,...h}),g.h2=h=>(0,T.jsx)(b,{level:2,...h}),g.h3=h=>(0,T.jsx)(b,{level:3,...h}),g.h4=h=>(0,T.jsx)(b,{level:4,...h}),g.h5=h=>(0,T.jsx)(b,{level:5,...h}),g.h6=h=>(0,T.jsx)(b,{level:6,...h}),g},[n,d,m]);return(0,T.jsx)(wt,{children:(0,T.jsx)(nr,{children:(0,T.jsx)(ar.XMarkdown,{content:u,streaming:r?{hasNextChunk:!0}:void 0,components:y,className:(0,rt.twMerge)((0,sr.clsx)("prose w-full max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-code:text-foreground prose-th:text-foreground prose-td:text-foreground prose-a:text-primary prose-code:bg-muted/50 prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-pre:bg-muted/50 prose-pre:text-foreground",o)),style:a,openLinksInNewTab:s,dompurifyConfig:l})})})}function Sn({children:t,tag:e,node:r,className:n,enableHoverSource:o,onStatusChange:a}){let[s,l]=$.default.useState(!1),[d,m]=$.default.useState(!1);$.default.useEffect(()=>{if(a){let i=r?.streamStatus||"success";a(i)}},[r?.streamStatus,a]);let p=i=>{i.stopPropagation(),m(!0)},c=$.default.useMemo(()=>{let i=Object.entries(r.attributes||{}).map(([u,f])=>`${u}="${f}"`).join(" ");return`<${e}${i?" "+i:""}>${r.children?`
|
|
29
|
+
`+r.children+`
|
|
30
|
+
`:""}</${e}>`},[e,r]);return(0,T.jsxs)("div",{className:(0,rt.twMerge)("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",n),onMouseEnter:()=>o&&l(!0),onMouseLeave:()=>o&&l(!1),children:[t,s&&o&&(0,T.jsx)(xe.Tooltip,{title:"\u67E5\u770B\u6E90\u7801",children:(0,T.jsx)(xe.Button,{icon:(0,T.jsx)(ir.CodeOutlined,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:p})}),(0,T.jsx)(xe.Modal,{open:d,onCancel:()=>m(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:(0,T.jsx)("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:c})})]})}var Mt=new WeakMap;function Nt(t){if(!t)return"";if(Mt.has(t))return Mt.get(t);let e=[],r=o=>{o?.forEach(a=>{a&&(a.type==="text"&&typeof a.data=="string"&&e.push(a.data),Array.isArray(a.children)&&r(a.children))})};r(t);let n=e.join("");return Mt.set(t,n),n}var Mn=$.default.memo(({code:t,theme:e,id:r})=>{let n=$.default.useRef(null);return $.default.useEffect(()=>{!n.current||!t||import("mermaid").then(o=>{o.default.initialize({startOnLoad:!0,theme:e==="dark"?"dark":"default",securityLevel:"loose"});let a=r||`mermaid-${Math.random().toString(36).slice(2)}`;o.default.render(a,t).then(({svg:s})=>{n.current&&(n.current.innerHTML=s)})})},[t,e,r]),(0,T.jsx)("div",{ref:n,className:"mermaid w-full flex justify-center my-4"})});var W=F(require("react"),1),_n=F(require("@ant-design/plots"),1),Bt=require("@chatbi-v/ui-shell");var Y=require("react"),lr=require("@chatbi-v/ui-shell"),Lt=require("@chatbi-v/ui-shell"),ot=require("react/jsx-runtime"),Nn={theme:"light",setTheme:()=>null},cr=(0,Y.createContext)(Nn);function Ln({children:t,defaultTheme:e="sunset",theme:r,primaryColor:n="#ea580c",storageKey:o="xcml-ui-theme",scoped:a=!0,className:s,style:l,...d}){let[m,p]=(0,Y.useState)(()=>localStorage.getItem(o)||e),c=r??m,i=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let y=a?i.current:window.document.documentElement;if(!y)return;if(n.startsWith("#")){let g=n.replace(/^#/,""),b=parseInt(g.substring(0,2),16),h=parseInt(g.substring(2,4),16),M=parseInt(g.substring(4,6),16);y.style.setProperty("--primary-rgb",`${b}, ${h}, ${M}`);let O=b/255,E=h/255,N=M/255,P=Math.max(O,E,N),q=Math.min(O,E,N),R=0,V=0,G=(P+q)/2;if(P!==q){let j=P-q;switch(V=G>.5?j/(2-P-q):j/(P+q),P){case O:R=(E-N)/j+(E<N?6:0);break;case E:R=(N-O)/j+2;break;case N:R=(O-E)/j+4;break}R/=6}let se=`${Math.round(R*360)} ${Math.round(V*100)}% ${Math.round(G*100)}%`;y.style.setProperty("--primary",se)}else y.style.setProperty("--primary",n);y.classList.remove("light","dark"),y.removeAttribute("data-theme");let x=["ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyan"];if(c==="system"){let g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(g);return}if(c==="dark"){y.classList.add("dark");return}if(c==="light"){y.classList.add("light");return}if(x.includes(c)){y.setAttribute("data-theme",c);return}},[c,a]);let u={theme:c,setTheme:y=>{localStorage.setItem(o,y),p(y)}},f=(0,Y.useMemo)(()=>({algorithm:c==="dark"||c==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?Lt.theme.darkAlgorithm:Lt.theme.defaultAlgorithm,token:{colorPrimary:n,colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#e11d48",colorInfo:"#0ea5e9",borderRadius:8,fontFamily:'"Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'}}),[c,n]);return(0,ot.jsx)(cr.Provider,{value:u,...d,children:(0,ot.jsx)(lr.XProvider,{theme:f,children:(0,ot.jsx)("div",{ref:i,className:`xcml-scope text-inherit bg-inherit ${s||""}`,style:l,children:t})})})}var Ae=()=>{let t=(0,Y.useContext)(cr);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var kn={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},Pn={label:{style:{fill:"rgba(255, 255, 255, 0.65)",fontSize:12}},title:{style:{fill:"rgba(255, 255, 255, 0.85)",fontSize:12}},grid:{line:{style:{stroke:"rgba(255, 255, 255, 0.15)",lineWidth:1,lineDash:[4,4]}}}},at={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:kn},tooltip:{style:{backgroundColor:"rgba(255, 255, 255, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.12)",color:"#1e293b",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(226, 232, 240, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{itemStates:{active:{labelStyle:{fontWeight:600,fill:"#8b5cf6"}}}}}}},dr={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Pn},tooltip:{style:{backgroundColor:"rgba(30, 41, 59, 0.95)",boxShadow:"0 8px 24px -6px rgba(0, 0, 0, 0.3)",color:"#f1f5f9",borderRadius:"16px",padding:"12px 16px",border:"1px solid rgba(51, 65, 85, 0.8)",backdropFilter:"blur(4px)"}},legend:{common:{labelStyle:{fill:"rgba(255, 255, 255, 0.65)"}}}}},mr={light:at,dark:dr,default:at};function kt(t){return mr[t||"default"]||at}var pr=F(require("react"),1);var Rn=pr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Pt={type:"line",schema:ke,getComponent:()=>Rn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};var ur=F(require("react"),1);var Tn=ur.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Rt={type:"column",schema:Pe,getComponent:()=>Tn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e.scale?typeof e.scale=="object"&&!e.scale.x&&(e.scale.x={type:"band"}):e.scale={x:{type:"band"}},e}};var yr=F(require("react"),1);var Xn=yr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),Tt={type:"pie",schema:Re,getComponent:()=>Xn,transformProps:t=>{let e={...t};if(delete e.xField,delete e.yField,delete e.seriesField,!e.angleField){let r=(e.data||[])[0]||{},n=Object.keys(r).find(o=>typeof r[o]=="number");n&&(e.angleField=n)}if(!e.colorField){let r=(e.data||[])[0]||{},n=Object.keys(r).find(o=>typeof r[o]=="string");n&&(e.colorField=n)}return e}};var gr=F(require("react"),1);var Fn=gr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),Xt={type:"dual-axes",schema:Te,getComponent:()=>Fn,transformProps:t=>{let e={...t};typeof e.width=="number"&&e.width<50&&delete e.width;let r=e.data||[],n=r.length>0?Object.keys(r[0]):[],o=!1;if(e.children&&e.children.length>0&&(o=e.children.every(l=>l.data&&l.data.length>0||n.length===0?!0:l.yField&&n.includes(l.yField)),!o&&n.length>0&&(e.children=[])),(!e.children||e.children.length===0)&&(Array.isArray(e.yField)&&e.yField.length>=2&&(n.length===0||e.yField.every(d=>n.includes(d)))&&(e.children=[{type:"interval",yField:e.yField[0]},{type:"line",yField:e.yField[1],style:{lineWidth:2}}]),(!e.children||e.children.length===0)&&r.length>0)){let l=e.xField,d=n.filter(m=>m!==l&&typeof r[0][m]=="number");d.length>=2?e.children=[{type:"interval",yField:d[0]},{type:"line",yField:d[1],style:{lineWidth:2}}]:d.length===1&&(e.children=[{type:"interval",yField:d[0]}])}let a=Array.isArray(e.data)&&e.data.length>0,s=Array.isArray(e.children)&&e.children.some(l=>l.data&&Array.isArray(l.data)&&l.data.length>0);if(!a&&s){let{data:l,...d}=e;return d}return e}};var fr=F(require("react"),1);var An=fr.default.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Ft={type:"funnel",schema:Xe,getComponent:()=>An,transformProps:t=>{let e={...t};!e.xField&&e.categoryField&&(e.xField=e.categoryField),!e.yField&&e.valueField&&(e.yField=e.valueField);let r=e.data||[];if(r.length>0){let o=r[0],a=Object.keys(o);e.xField||(e.xField=a.find(s=>typeof o[s]=="string")||"type"),e.yField||(e.yField=a.find(s=>typeof o[s]=="number")||"value"),e.colorField&&!(e.colorField in o)&&(e.xField&&e.xField in o?e.colorField=e.xField:delete e.colorField),e.seriesField&&!(e.seriesField in o)&&delete e.seriesField}e.axis&&delete e.axis;let n=["light","dark","academy"];return e.theme&&!n.includes(e.theme)&&delete e.theme,typeof e.width=="number"&&e.width<100&&delete e.width,e}};var hr={line:Pt,column:Rt,pie:Tt,"dual-axes":Xt,funnel:Ft};function At(t){return t&&hr[t.toLowerCase()]||null}var br=F(require("react"),1),pe=require("@chatbi-v/ui-shell"),Ce=require("react/jsx-runtime");function _e(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;let r=Array.isArray(t)?[...t]:{...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],a=r[n];typeof o=="object"&&o!==null&&typeof a=="object"&&a!==null&&!br.default.isValidElement(o)?r[n]=_e(a,o):r[n]=o}return r}function _t(t,e){if(!e)return t;let r={...t},n=[...e.props||[],...e.body||[]];return n.length===0?t:(n.forEach(o=>{let a=o.name;if(o.visibleIf&&!o.visibleIf(r)){delete r[a];return}if(o.default!==void 0&&r[a]===void 0?r[a]=o.default:o.default!==void 0&&typeof o.default=="object"&&o.default!==null&&(r[a]=_e(o.default,r[a])),o.transform){let s=r[a];r[a]=o.transform(s,r)}}),r)}function Ot(t){let{type:e,data:r,theme:n,title:o,__native__:a,...s}=t,l={data:r||[],height:t.height||300,theme:n||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},d=_e(_e(l,s),a||{});return d.seriesField&&!d.colorField&&(d.colorField=d.seriesField),d.__native__={...d},d}var Et=()=>(0,Ce.jsx)("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:(0,Ce.jsx)(pe.Empty,{image:pe.Empty.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),$t=({error:t,reset:e})=>(0,Ce.jsx)("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:(0,Ce.jsx)(pe.Result,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[(0,Ce.jsx)(pe.Button,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});var Cr=F(require("react"),1),vr=require("@chatbi-v/ui-shell");var It=require("clsx"),xr=require("tailwind-merge");var Q=require("react/jsx-runtime"),Oe=({title:t,icon:e,children:r,source:n,summary:o,variant:a="card",theme:s,hoverable:l=!0,className:d,domNode:m,streamStatus:p,node:c,label:i,value:u,footer:f,precision:y,layout:x,note:g,trend:b,trendValue:h,unit:M,prefix:O,wow:E,yoy:N,sentiment:P,highlights:q,citations:R,actions:V,steps:G,columns:se,rows:j,charts:B,data:le,subTitle:D,themeColor:zt,backgroundImage:ce,qrCode:ut,author:Vt,date:Ht,...Yr})=>{let{theme:Zr}=Ae(),ye=a==="plain",Qr=s??c?.props?.theme??c?.data?.theme??Zr,en=(0,xr.twMerge)((0,It.clsx)("xcml-card not-prose max-w-full min-w-0 group",ye?"p-1":"rounded-md border border-border/80 bg-card shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-150 ease-out hover:ease-in-out",d,l&&!ye?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return(0,Q.jsxs)("div",{className:en,"data-theme":Qr,...Yr,children:[t&&(0,Q.jsxs)("div",{className:"relative mb-3",children:[!ye&&(0,Q.jsx)("div",{className:"absolute -top-3 -inset-x-4 h-1 bg-gradient-to-r from-primary via-primary/60 to-primary/20 opacity-0 transition-all duration-150 group-hover:opacity-100 rounded-full scale-x-95 group-hover:scale-x-100"}),(0,Q.jsx)("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:(0,Q.jsxs)("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!ye&&(0,Q.jsx)("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!ye&&e&&(0,Q.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-md bg-primary/10 text-primary border border-primary/20 shadow-sm",children:e}),t]})})]}),(0,Q.jsx)("div",{className:(0,It.clsx)("xcml-card-body",!ye&&"mt-0.5"),children:r})]})};var Ee=require("react/jsx-runtime");function w(t,e={}){let{schema:r,getTitle:n,getIcon:o,getVariant:a,renderLoading:s,skeleton:l=!0}=e,d=Cr.default.forwardRef((p,c)=>{let{merged:i,baseProps:u,isLoading:f,streamStatus:y}=gt(p,r);i.delta!==void 0&&i.trendValue===void 0&&(i.trendValue=i.delta);let{className:x,...g}=p,b=n?n(i):i.title,h;b&&(typeof b=="string"?h=b:typeof b=="object"&&(Array.isArray(b)?h=void 0:h=b.text||b.content||JSON.stringify(b)));let M=o?o(i):i.icon,O=a?a(i):u.variant||"card",E=i.hoverable!==void 0?i.hoverable:!0,N={title:h,icon:M,variant:O,hoverable:E,className:x,node:p.node,streamStatus:y,...g};return f?(0,Ee.jsx)(Oe,{...N,children:s?s(i):l?(0,Ee.jsx)(vr.Skeleton,{active:!0,paragraph:{rows:typeof l=="object"?l.rows:2}}):null}):(0,Ee.jsx)(Oe,{...N,children:(0,Ee.jsx)(t,{...i,ref:c})})}),m=t.displayName||t.name||"Component";return d.displayName=`withXCMLCard(${m})`,d}var K=require("react/jsx-runtime"),Sr=require("react"),On=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),wr={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},En=t=>{if(!t)return null;let e=wr[t.toLowerCase()]||wr[t],r=_n;if(e&&e in r)return r[e];let n=On(t);return n&&n in r?r[n]:t in r?r[t]:null},jt=class extends W.default.Component{constructor(r){super(r);this.reset=()=>{this.setState({hasError:!1,error:null})};this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error(`AntV Chart Error (${this.props.type}):`,r,n)}render(){return this.state.hasError&&this.state.error?this.props.errorPlaceholder?this.props.errorPlaceholder(this.state.error,this.reset):(0,K.jsx)($t,{error:this.state.error,reset:this.reset}):this.props.children}},$n=(0,W.forwardRef)((t,e)=>{let{type:r="line",node:n,theme:o,...a}=t,{theme:s}=Ae(),{containerWidth:l}=St(),d=(0,W.useRef)(null),m=(0,W.useRef)(null),p=(0,W.useMemo)(()=>At(r),[r]),c=(0,W.useMemo)(()=>p?.getComponent()||En(r),[p,r]),i=(0,W.useMemo)(()=>{let g=t.theme||o||s||"light",h=["dark","black","midnight","slate","crimson"].includes(g)?"dark":"light",M=kt(h),O=t.data,E={...t,theme:M,data:O},N=_t(E,p?.schema||ge),P=p?.transformProps?p.transformProps(N):N;return Ot(P)},[t,o,s,p]);(0,W.useEffect)(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch(g){console.warn("[Chart] Resize failed:",g)}},[l,i.autoFit]),(0,W.useEffect)(()=>{if(!d.current)return;let g=new ResizeObserver(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch{}});return g.observe(d.current),()=>{g.disconnect()}},[i.autoFit]);let u=(0,W.useCallback)(g=>{m.current=g,typeof e=="function"?e(g):e&&(e.current=g)},[e]);if(!c)return(0,K.jsxs)("div",{className:"w-full p-4 border border-dashed border-amber-200 text-amber-600 rounded bg-amber-50/50 text-xs",children:["\u672A\u627E\u5230\u56FE\u8868\u7C7B\u578B: ",r]});let f=i.data&&Array.isArray(i.data)&&i.data.length>0,y=Array.isArray(i.children)&&i.children.some(g=>g.data&&Array.isArray(g.data)&&g.data.length>0);return f||y?(0,K.jsx)(jt,{type:r,errorPlaceholder:i.errorPlaceholder,children:(0,K.jsx)(W.Suspense,{fallback:(0,K.jsx)(Bt.Skeleton,{active:!0}),children:(0,K.jsx)("div",{ref:d,className:"w-full h-full min-h-[100px]",children:(0,Sr.createElement)(c,{...i,ref:u,key:r})})})}):(0,K.jsx)(Et,{})}),$e=w($n,{schema:ge,renderLoading:t=>{let e=t.height||300;return(0,K.jsx)("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:(0,K.jsx)(Bt.Skeleton.Image,{active:!0})})}}),In=t=>{let{node:e,...r}=t;if(e)return(0,K.jsx)($e,{node:e});let n={props:{},body:{...r,data:t.data}};return(0,K.jsx)($e,{node:n})};var Mr=require("react/jsx-runtime");function jn(t){let e=t?.theme;return me({chart:(n,o)=>(0,Mr.jsx)($e,{node:n,theme:e,className:n.props?.className},o)})}var Dt=require("react");var it=require("@ant-design/icons");var L=require("react/jsx-runtime"),Nr=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),Bn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return null;let r=Math.min(...t),o=Math.max(...t)-r||1,a=80,s=32,l=t.map((c,i)=>({x:i/(t.length-1)*a,y:s-(c-r)/o*(s-8)-4})),d=l.reduce((c,i,u,f)=>{if(u===0)return`M ${i.x},${i.y}`;let y=f[u-1],x=(y.x+i.x)/2;return`${c} C ${x},${y.y} ${x},${i.y} ${i.x},${i.y}`},""),m=`${d} L ${a},${s} L 0,${s} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return(0,L.jsx)("div",{className:`relative group/sparkline ${e}`,children:(0,L.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,L.jsx)("defs",{children:(0,L.jsxs)("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,L.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),(0,L.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),(0,L.jsx)("path",{d:m,fill:`url(#${p})`}),(0,L.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),(0,L.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},Dn=t=>{let{precision:e=0,layout:r="vertical",footer:n,value:o,note:a,trend:s,trendValue:l}=t,d=(0,Dt.useMemo)(()=>{if(l==null)return null;if(typeof l=="number"){let f=Math.abs(l)>=1e4?Nr(l,1):l.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(l).startsWith("+")?`+${f}`:s==="down"&&!String(l).startsWith("-")?`-${f}`:f}return String(l)},[l,e,s]),m=(0,Dt.useMemo)(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?Nr(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),p=s==="up",c=s==="down",i=Array.isArray(s);return(0,L.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,L.jsxs)("div",{className:`flex ${r==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[(0,L.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,L.jsxs)("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[(0,L.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),d&&(0,L.jsxs)("div",{className:`flex items-center text-xs font-semibold px-2 py-0.5 rounded-md border shadow-sm transition-all duration-150 ${p?"bg-success/5 text-success border-success/20":c?"bg-destructive/5 text-destructive border-destructive/20":"bg-muted/5 text-muted-foreground border-muted/20"}`,children:[p&&(0,L.jsx)(it.ArrowUpOutlined,{className:"mr-1 text-xs"}),c&&(0,L.jsx)(it.ArrowDownOutlined,{className:"mr-1 text-xs"}),(0,L.jsx)("span",{className:"tabular-nums",children:d})]})]}),a&&(0,L.jsx)("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),i&&(0,L.jsx)("div",{className:"shrink-0 mb-1",children:(0,L.jsx)(Bn,{data:s,className:p?"text-success":c?"text-destructive":"text-primary"})})]}),n&&(0,L.jsxs)("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[(0,L.jsx)("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:n}),(0,L.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},Lr=w(Dn,{schema:Be,skeleton:{rows:1}});var ee=require("react/jsx-runtime"),Wn=t=>{let{description:e,content:r,node:n}=t,o=!!e,a=!!n?.__source&&!(n?.body||n?.data),s=o&&e!==r,l=r||(o&&!s?"":e)||(a?n.__source:"");return(0,ee.jsxs)("div",{className:"flex flex-col gap-4",children:[s&&(0,ee.jsx)("div",{className:"text-foreground/80 text-sm font-medium leading-relaxed border-l-2 border-primary/30 pl-3 py-1 bg-primary/5 rounded-r-sm",children:(0,ee.jsx)(nt,{content:e})}),(0,ee.jsx)("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:l?(0,ee.jsx)(nt,{content:l}):!s&&(0,ee.jsx)("div",{className:"text-muted-foreground/50 text-xs italic flex items-center gap-2 py-4 justify-center border border-dashed border-border/50 rounded-md",children:(0,ee.jsx)("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},kr=w(Wn,{schema:qe,skeleton:{rows:2}});var ve=require("@ant-design/icons");var A=require("react/jsx-runtime"),qn=({item:t,layout:e,index:r,stripe:n})=>{let{title:o,desc:a,value:s,status:l,type:d="text"}=t;return d==="metric"?(0,A.jsxs)("div",{className:`bg-muted/30 rounded-lg p-card-half border border-border hover:border-primary/20 transition-colors group ${n?"bg-muted/50":""}`,children:[(0,A.jsx)("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),(0,A.jsx)("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:s}),a&&(0,A.jsx)("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):(0,A.jsxs)("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card-hover hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${n?"bg-muted/60":""}`,children:[(0,A.jsxs)("div",{className:"mt-1",children:[l==="done"&&(0,A.jsx)(ve.CheckCircleOutlined,{className:"text-success"}),l==="doing"&&(0,A.jsx)(ve.MinusCircleOutlined,{className:"text-primary animate-pulse"}),l==="todo"&&(0,A.jsx)(ve.BorderOutlined,{className:"text-muted-foreground/30"}),!l&&(0,A.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:r+1})]}),(0,A.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,A.jsx)("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&(0,A.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},zn=t=>{let{header:e,footer:r,layout:n="grid",columns:o=3,items:a=[],type:s="text",stripe:l=!1}=t,d=n==="grid",p={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4",5:"grid-cols-2 md:grid-cols-5",6:"grid-cols-3 md:grid-cols-6"}[o]||"grid-cols-1 md:grid-cols-3";return(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),(0,A.jsxs)("div",{className:d?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((c,i)=>(0,A.jsx)(qn,{item:{type:s,...c},layout:n,index:i,stripe:l&&i%2===1},i)),a.length===0&&(0,A.jsx)("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),r&&(0,A.jsx)("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:r})]})},Pr=w(zn,{schema:We,skeleton:{rows:3}});var Rr=F(require("react"),1);var we=require("react/jsx-runtime"),Vn=()=>{let{items:t}=rr(),e=Rr.default.useMemo(()=>t.filter(o=>o.level>1),[t]),r=(o,a)=>{o.preventDefault();let s=document.getElementById(a);s&&s.scrollIntoView({behavior:"smooth"})},n=o=>{switch(o){case 2:return"pl-4";case 3:return"pl-8";case 4:return"pl-12";case 5:return"pl-16";case 6:return"pl-20";default:return"pl-4"}};return(0,we.jsx)("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?(0,we.jsx)("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):(0,we.jsx)("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>(0,we.jsx)("li",{className:`mb-2 text-sm leading-relaxed relative ${n(o.level)}`,children:(0,we.jsx)("a",{href:`#${o.id}`,onClick:a=>r(a,o.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:o.title})},o.id))})})},Tr=w(Vn,{schema:ze,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});var Xr=require("react");var J=require("@chatbi-v/ui-shell"),Wt=require("@ant-design/icons");var v=require("react/jsx-runtime"),Hn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return(0,v.jsx)("span",{className:"text-muted-foreground/30",children:"-"});let r=Math.min(...t),o=Math.max(...t)-r||1,a=60,s=24,l=t.map((m,p)=>({x:p/(t.length-1)*a,y:s-(m-r)/o*(s-4)-2})),d=l.reduce((m,p,c,i)=>{if(c===0)return`M ${p.x},${p.y}`;let u=i[c-1],f=(u.x+p.x)/2;return`${m} C ${f},${u.y} ${f},${p.y} ${p.x},${p.y}`},"");return(0,v.jsx)("div",{className:e||"text-primary",children:(0,v.jsxs)("svg",{width:a,height:s,className:"overflow-visible",children:[(0,v.jsx)("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,v.jsx)("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"2",fill:"currentColor"})]})})},Kn=t=>{let{bordered:e=!0,size:r="middle",summary:n=!1,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=o.length>0&&l.length>0,m=(0,Xr.useMemo)(()=>o.map(c=>({title:(0,v.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,v.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:c.title}),c.desc&&(0,v.jsx)(J.Tooltip,{title:c.desc,children:(0,v.jsx)(Wt.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:c.key,key:c.key,align:c.align||"left",flex:1,render:i=>{switch(c.type){case"progress":{let u=typeof i=="string"?parseFloat(i):i,f=u<=1?u*100:u,y="normal";return f>=100?y="success":f<60&&(y="exception"),(0,v.jsx)("div",{className:"flex items-center gap-2 min-w-24",children:(0,v.jsx)(J.Progress,{percent:Math.round(f),size:"small",status:y,showInfo:!0,strokeColor:f>=100?"var(--success)":f<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return(0,v.jsx)(Hn,{data:Array.isArray(i)?i:[]});case"badge":{let u="default",f=String(i).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(f)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(f)?u="error":["warning","warn","\u8B66\u544A"].includes(f)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(f)&&(u="processing"),(0,v.jsx)(J.Badge,{status:u,text:(0,v.jsx)("span",{className:"text-xs",children:i})})}case"image":return(0,v.jsx)("img",{src:i,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return(0,v.jsxs)("span",{className:"font-mono text-foreground/90 font-medium",children:[c.prefix,i?.toLocaleString?.()??i,c.suffix]});default:return(0,v.jsxs)("span",{className:"text-foreground/90",children:[c.prefix,i,c.suffix]})}}})),[o]);return(0,v.jsxs)("div",{className:"w-full xcml-table-container",children:[(0,v.jsx)(J.Table,{dataSource:l,columns:m,pagination:!1,size:r==="large"?"middle":"small",bordered:e,className:"xcml-custom-table [&_.ant-table]:!bg-transparent [&_.ant-table]:text-sm [&_.ant-table-thead_tr_th]:!bg-muted/40 [&_.ant-table-thead_tr_th]:border-b [&_.ant-table-thead_tr_th]:border-border/60 [&_.ant-table-thead_tr_th]:!py-3 [&_.ant-table-thead_tr_th]:!px-4 [&_.ant-table-tbody_tr_td]:border-b [&_.ant-table-tbody_tr_td]:border-border/30 [&_.ant-table-tbody_tr_td]:!py-2.5 [&_.ant-table-tbody_tr_td]:!px-4 [&_.ant-table-tbody_tr_td]:transition-all [&_.ant-table-tbody_tr_td]:duration-150 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:rounded-md [&_.ant-table-container]:overflow-hidden",scroll:{x:"max-content"},rowKey:(c,i)=>i?.toString()??"",summary:n?c=>!n||!d?null:(0,v.jsx)(J.Table.Summary,{fixed:!0,children:(0,v.jsx)(J.Table.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((i,u)=>{if(u===0)return(0,v.jsx)(J.Table.Summary.Cell,{index:0,children:(0,v.jsx)("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(i.type==="number"||["amount","value","sales","total"].includes(i.key)))return(0,v.jsx)(J.Table.Summary.Cell,{index:u},`summary-${i.key}`);let y=c.reduce((x,g)=>{let b=g[i.key],h=typeof b=="string"?parseFloat(b.replace(/[^0-9.-]/g,"")):b;return x+(typeof h=="number"&&!isNaN(h)?h:0)},0);return(0,v.jsx)(J.Table.Summary.Cell,{index:u,align:i.align,children:(0,v.jsxs)("span",{className:"text-primary font-mono",children:[i.prefix,Number.isInteger(y)?y:y.toFixed(2),i.suffix]})},`summary-${i.key}`)})})}):void 0,locale:{emptyText:(0,v.jsxs)("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[(0,v.jsx)("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:(0,v.jsx)(Wt.InfoCircleOutlined,{className:"text-xl opacity-20"})}),(0,v.jsx)("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!n&&d&&(0,v.jsxs)("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",l.length," rows"]})]})},Fr=w(Kn,{schema:De,skeleton:{rows:4}});var Se=require("react/jsx-runtime");function Jn(t){let e=t?.theme?{"data-theme":t.theme}:{};return me({metric:(n,o)=>(0,Se.jsx)(Lr,{node:n,...e},o),card:(n,o)=>(0,Se.jsx)(kr,{node:n,...e},o),list:(n,o)=>(0,Se.jsx)(Pr,{node:n,...e},o),toc:(n,o)=>(0,Se.jsx)(Tr,{node:n,...e},o),table:(n,o)=>(0,Se.jsx)(Fr,{node:n,...e},o)})}var Me=require("@ant-design/icons"),_r=F(require("react-countup"),1);var Z=require("react/jsx-runtime"),Ar=(t,e)=>{if(t==null)return null;let r=t>0,n=t===0,o=r?"text-success bg-success/5":n?"text-muted-foreground/40":"text-destructive bg-destructive/5",a=r?Me.ArrowUpOutlined:n?Me.MinusOutlined:Me.ArrowDownOutlined;return(0,Z.jsxs)("div",{className:`flex items-center px-2 py-0.5 rounded-full ${o} text-xs font-bold border border-current/10 transition-all shadow-sm`,children:[(0,Z.jsx)("span",{className:"opacity-70 mr-1",children:e}),(0,Z.jsx)(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},Gn=t=>{let{value:e,wow:r,yoy:n,unit:o="",prefix:a="",footer:s,precision:l}=t;return(0,Z.jsxs)("div",{className:"flex flex-col",children:[(0,Z.jsxs)("div",{className:"text-metric-lg font-black my-2 bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground to-foreground/70 group-hover:from-primary group-hover:to-pink-500 transition-all duration-500 tracking-tighter",children:[(0,Z.jsx)("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),(0,Z.jsx)(_r.default,{end:Number(e)||0,decimals:l,separator:",",duration:2.5}),(0,Z.jsx)("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),(0,Z.jsxs)("div",{className:"flex space-x-2 mt-2",children:[Ar(r,"\u73AF\u6BD4"),Ar(n,"\u540C\u6BD4")]}),s&&(0,Z.jsx)("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},Or=w(Gn,{schema:Ke,getTitle:t=>t.title||t.label,skeleton:{rows:2}});var Er=require("react");var st=require("@chatbi-v/ui-shell"),$r=require("@ant-design/plots");var H=require("react/jsx-runtime"),Un=({item:t})=>{let[e,r]=(0,Er.useState)(!1),{label:n,value:o,wow:a,trendData:s=[]}=t,d={data:s.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return(0,H.jsxs)("div",{className:"p-3 border border-border/60 rounded-lg hover:shadow-card hover:border-primary/30 transition-all relative bg-muted/40 text-card-foreground min-h-[6rem] flex flex-col justify-between group overflow-hidden",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,H.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),(0,H.jsxs)("div",{className:"relative z-10",children:[(0,H.jsx)("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:n}),(0,H.jsxs)("div",{className:"flex items-end justify-between flex-wrap",children:[(0,H.jsx)("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&(0,H.jsx)("div",{className:`w-2 h-2 rounded-full ${a>0?"bg-success":a<0?"bg-destructive":"bg-muted"} shadow-[0_0_6px_rgba(var(--primary),0.2)]`,title:`\u73AF\u6BD4: ${a}%`})]})]}),s.length>0&&(0,H.jsx)("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:(0,H.jsx)($r.Line,{...d})})]})},Yn=t=>{let{items:e=[]}=t,r=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return(0,H.jsx)(st.Row,{gutter:[16,16],children:e.map((n,o)=>(0,H.jsx)(st.Col,{span:r,children:(0,H.jsx)(Un,{item:n})},o))})},Ir=w(Yn,{schema:Je,skeleton:{rows:2}});var lt=require("react"),te=require("@chatbi-v/ui-shell"),jr=require("react-csv"),Ne=require("@ant-design/icons");var S=require("react/jsx-runtime"),Zn=t=>{let{title:e,description:r,bordered:n=!0,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=(0,lt.useMemo)(()=>l.map((i,u)=>({...i,__xcml_row_key:i.__xcml_key||i.id||`row-${u}`})),[l]),m=(0,lt.useMemo)(()=>o.map(i=>({...i,dataIndex:i.key||i.dataIndex,title:(0,S.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,S.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:i.title}),i.desc&&(0,S.jsx)(te.Tooltip,{title:i.desc,children:(0,S.jsx)(Ne.InfoCircleOutlined,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:i.align||"left",width:i.width,flex:1,render:u=>{if(u==null||u==="")return(0,S.jsx)("span",{className:"text-muted-foreground/30 italic",children:"-"});let f=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return(0,S.jsx)("div",{className:`whitespace-normal break-words ${f?"font-mono":""}`,children:f?u.toLocaleString():u})}})),[o]),p=(0,lt.useMemo)(()=>o.map(i=>({label:i.title,key:i.key||i.dataIndex})),[o]),c=d.length>0;return(0,S.jsxs)("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(r||c)&&(0,S.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,S.jsxs)("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary shadow-sm border border-primary/10",children:(0,S.jsx)(Ne.TableOutlined,{className:"text-sm"})}),(0,S.jsx)("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),r&&(0,S.jsx)("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:r})]}),c&&(0,S.jsx)(jr.CSVLink,{data:d,headers:p,filename:`${e||"snapshot"}.csv`,children:(0,S.jsx)(te.Button,{size:"small",icon:(0,S.jsx)(Ne.DownloadOutlined,{}),className:"flex items-center gap-1.5 text-xs h-8 px-3 rounded-md border-border/60 hover:border-primary/50 hover:text-primary bg-card/50 transition-all duration-150",children:"\u5BFC\u51FA CSV"})})]}),(0,S.jsxs)("div",{className:"relative group",children:[(0,S.jsx)(te.Table,{columns:m,dataSource:d,rowKey:"__xcml_row_key",pagination:d.length>10?{pageSize:10,size:"small",showSizeChanger:!1,className:"mt-4 px-2"}:!1,scroll:{x:"max-content"},className:"xcml-custom-snapshot-table [&_.ant-table]:!bg-transparent [&_.ant-table]:!text-xs [&_.ant-table-thead_tr_th]:!bg-muted/30 [&_.ant-table-thead_tr_th]:!border-b [&_.ant-table-thead_tr_th]:!border-border/60 [&_.ant-table-thead_tr_th]:!py-2.5 [&_.ant-table-thead_tr_th]:!px-3 [&_.ant-table-thead_tr_th]:!text-foreground/70 [&_.ant-table-tbody_tr_td]:!border-b [&_.ant-table-tbody_tr_td]:!border-border/30 [&_.ant-table-tbody_tr_td]:!py-2 [&_.ant-table-tbody_tr_td]:!px-3 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:!rounded-md [&_.ant-table-container]:!overflow-hidden [&_.ant-table-bordered_.ant-table-container]:!border-border/50 [&_.ant-pagination-item-active]:!border-primary [&_.ant-pagination-item-active]:!bg-primary/5 [&_.ant-pagination-item-active_a]:!text-primary",bordered:n,size:"small",locale:{emptyText:(0,S.jsx)(te.Empty,{image:te.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,S.jsx)("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),(0,S.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l from-background/50 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity"})]}),c&&(0,S.jsxs)("div",{className:"flex items-center justify-between px-1 mt-1",children:[(0,S.jsxs)("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[(0,S.jsx)("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",d.length," \u6761\u8BB0\u5F55"]}),(0,S.jsxs)("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},Br=w(Zn,{schema:Ue,skeleton:{rows:5}});var Wr=F(require("react"),1),ue=require("@chatbi-v/ui-shell"),qt=require("clsx"),qr=require("tailwind-merge"),zr=F(require("react-highlight-words"),1),X=require("@ant-design/icons");var C=require("react/jsx-runtime"),Dr={positive:{icon:(0,C.jsx)(X.RiseOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:(0,C.jsx)(X.FallOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:(0,C.jsx)(X.WarningOutlined,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:(0,C.jsx)(X.CloseCircleOutlined,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:(0,C.jsx)(X.CheckCircleOutlined,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:(0,C.jsx)(X.BulbOutlined,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:(0,C.jsx)(X.InfoCircleOutlined,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},Qn=t=>{let{content:e="",highlights:r=[],sentiment:n="insight",citations:o=[],actions:a=[]}=t,s=de(r),l=de(o),d=de(a),m=Dr[n]||Dr.insight,p=i=>{he.emit("action_click",{action:i,source:"insight_card"})},c=i=>{he.emit("feedback",{type:i,source:"insight_card",content:e})};return(0,C.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,C.jsxs)("div",{className:(0,qr.twMerge)("relative overflow-hidden rounded-2xl border transition-all duration-300",m.bg,m.border,"p-5 shadow-sm hover:shadow-md"),children:[(0,C.jsx)("div",{className:"absolute -right-4 -top-4 w-24 h-24 blur-3xl opacity-20 bg-current pointer-events-none"}),(0,C.jsxs)("div",{className:"relative flex gap-4",children:[(0,C.jsx)("div",{className:(0,qt.clsx)("flex items-center justify-center w-10 h-10 rounded-xl shadow-sm border shrink-0","bg-background/80 backdrop-blur-sm",m.color,m.border),children:Wr.default.cloneElement(m.icon,{className:"text-lg"})}),(0,C.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("span",{className:(0,qt.clsx)("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[(0,C.jsx)(ue.Tooltip,{title:"\u6709\u5E2E\u52A9",children:(0,C.jsx)(ue.Button,{type:"text",size:"small",icon:(0,C.jsx)(X.LikeOutlined,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("up")})}),(0,C.jsx)(ue.Tooltip,{title:"\u65E0\u5E2E\u52A9",children:(0,C.jsx)(ue.Button,{type:"text",size:"small",icon:(0,C.jsx)(X.DislikeOutlined,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("down")})})]})]}),(0,C.jsx)("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:(0,C.jsx)(zr.default,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})}),l.length>0&&(0,C.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:l.map((i,u)=>(0,C.jsxs)("button",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted/20 border border-border/50 text-xs text-muted-foreground hover:text-primary hover:border-primary/30 transition-all cursor-pointer",children:[(0,C.jsx)(X.LinkOutlined,{className:"text-xs"}),i]},u))})]})]})]}),d.length>0&&(0,C.jsxs)("div",{className:"space-y-3 px-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-xs font-bold text-foreground/40 uppercase tracking-widest",children:[(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-border/50"}),(0,C.jsx)(X.ThunderboltOutlined,{className:"text-amber-500"}),(0,C.jsx)("span",{children:"\u4E0B\u4E00\u6B65\u884C\u52A8\u5EFA\u8BAE"}),(0,C.jsx)("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-border/50"})]}),(0,C.jsx)("div",{className:"flex flex-wrap gap-2.5",children:d.map((i,u)=>(0,C.jsx)(ue.Button,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(i),children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"text-xs font-semibold text-foreground/80 group-hover:text-primary transition-colors",children:i}),(0,C.jsx)(X.ThunderboltOutlined,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},Vr=w(Qn,{schema:Ve,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>(0,C.jsx)(X.BulbOutlined,{}),getVariant:()=>"plain",skeleton:{rows:4}});var dt=require("react"),re=require("@chatbi-v/ui-shell"),mt=require("@ant-design/icons"),Hr=F(require("html2canvas"),1),Le=require("@ant-design/plots");var k=require("react/jsx-runtime"),ct=[{label:"\u79D1\u6280\u84DD",value:"#1890ff",bg:"#f0f5ff"},{label:"\u6D3B\u529B\u6A59",value:"#fa8c16",bg:"#fff7e6"},{label:"\u6E05\u65B0\u7EFF",value:"#52c41a",bg:"#f6ffed"},{label:"\u6697\u591C\u7D2B",value:"#722ed1",bg:"#f9f0ff"},{label:"\u5546\u52A1\u7070",value:"#595959",bg:"#f5f5f5"}],eo=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:r="Data Insight Poster",charts:n=[],qrCode:o="https://ant.design",author:a="ChatBI",date:s=new Date().toLocaleDateString(),backgroundImage:l,themeColor:d}=t,m=typeof l=="string"?l.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=(0,dt.useRef)(null),[c,i]=(0,dt.useState)(ct[0]),u=d||c.value,f=d?`${d}10`:c.bg,y=async()=>{if(p.current)try{let b=(await(0,Hr.default)(p.current,{useCORS:!0,scale:2,backgroundColor:c.bg})).toDataURL("image/png"),h=document.createElement("a");h.href=b,h.download=`poster-${Date.now()}.png`,h.click()}catch(g){console.error("Poster generation failed",g)}},x=(g,b)=>{let h={data:g.data,height:200,autoFit:!0};return g.type==="column"||g.type==="bar"?(0,k.jsx)(Le.Column,{...h,xField:"label",yField:"value"},b):g.type==="line"?(0,k.jsx)(Le.Line,{...h,xField:"label",yField:"value"},b):g.type==="pie"?(0,k.jsx)(Le.Pie,{...h,angleField:"value",colorField:"label"},b):null};return(0,k.jsxs)("div",{className:"flex flex-col",children:[(0,k.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,k.jsx)(re.Space,{children:(0,k.jsx)(re.Select,{value:c.value,onChange:g=>i(ct.find(b=>b.value===g)||ct[0]),options:ct,className:"w-32",suffixIcon:(0,k.jsx)(mt.BgColorsOutlined,{})})}),(0,k.jsx)(re.Button,{type:"primary",icon:(0,k.jsx)(mt.DownloadOutlined,{}),onClick:y,children:"\u751F\u6210\u6D77\u62A5"})]}),(0,k.jsx)("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:(0,k.jsxs)("div",{ref:p,className:"p-8 w-full mx-auto transition-colors duration-300 flex flex-col shrink-0 bg-cover bg-center text-zinc-800 min-h-full",style:{backgroundColor:f,backgroundImage:m?`url(${m})`:void 0},children:[(0,k.jsxs)("div",{className:"mb-6 text-center",children:[(0,k.jsx)("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),(0,k.jsx)("p",{className:"text-sm opacity-70",children:r})]}),(0,k.jsx)("div",{className:"space-y-6 mb-8",children:n.map((g,b)=>(0,k.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[(0,k.jsx)("h4",{className:"font-medium mb-2 text-center",children:g.title}),x(g,b)]},b))}),(0,k.jsxs)("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[(0,k.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,k.jsxs)("p",{children:["Created by ",a]}),(0,k.jsx)("p",{children:s})]}),(0,k.jsx)("div",{className:"bg-white p-1 rounded",children:(0,k.jsx)(re.QRCode,{value:o,size:64,bordered:!1})})]})]})})]})},Kr=w(eo,{schema:Ge,skeleton:{rows:4}});var pt=require("@chatbi-v/ui-shell"),ne=require("@ant-design/icons");var _=require("react/jsx-runtime"),{Text:to}=pt.Typography,ro=t=>{switch(t){case"success":return(0,_.jsx)(ne.CheckCircleFilled,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return(0,_.jsx)(ne.CloseCircleFilled,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return(0,_.jsx)(ne.LoadingOutlined,{className:"text-primary bg-card rounded-full relative z-10"});default:return(0,_.jsx)(ne.ClockCircleFilled,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},no=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},oo=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},ao=t=>{let{steps:e=[]}=t;return(0,_.jsxs)("div",{className:"relative pl-2 py-2",children:[(0,_.jsx)("div",{className:"absolute top-4 bottom-4 left-[15px] w-0.5 bg-gradient-to-b from-primary/10 via-primary/30 to-primary/10"}),e.map((r,n)=>(0,_.jsxs)("div",{className:"relative flex mb-6 last:mb-0 group",children:[(0,_.jsx)("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:ro(r.status)}),(0,_.jsxs)("div",{className:"flex-1 min-w-0 bg-card rounded-xl p-3 border border-border/50 hover:border-primary/30 hover:shadow-md transition-all duration-300 group-hover:-translate-y-0.5",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"font-bold text-sm text-foreground",children:r.tool||`\u6B65\u9AA4 ${n+1}`}),(0,_.jsx)(to,{type:"secondary",className:"text-xs text-muted-foreground",children:r.action})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[r.duration&&(0,_.jsx)("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:r.duration}),(0,_.jsx)(pt.Tag,{color:oo(r.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:no(r.status)})]})]}),r.thought&&(0,_.jsx)("div",{className:"mb-2 text-xs text-muted-foreground italic border-l-2 border-primary/30 pl-2 py-1 bg-primary/5 rounded-r-md whitespace-pre-wrap leading-normal",children:r.thought}),r.result&&(0,_.jsx)("div",{className:"mt-2 text-xs",children:(0,_.jsx)("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:(0,_.jsx)("pre",{className:"m-0 whitespace-pre-wrap font-mono text-xs text-muted-foreground leading-relaxed",children:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2)})})}),r.error&&(0,_.jsxs)("div",{className:"mt-2 text-xs text-destructive bg-destructive/5 p-2 rounded-lg border border-destructive/20 whitespace-pre-wrap",children:["\u9519\u8BEF: ",r.error]})]})]},n))]})},Jr=w(ao,{schema:Ye,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});var Ie=require("react"),oe=require("@chatbi-v/ui-shell"),ae=require("@ant-design/icons");var Gr=F(require("react-highlight-words"),1);var I=require("react/jsx-runtime"),io=t=>{let{message:e}=oe.App.useApp(),{label:r="\u62A5\u544A\u6458\u8981",value:n=0,step:o=1,unit:a="",actionId:s="update_summary",content:l="",highlightKeywords:d=[]}=t,[m,p]=(0,Ie.useState)(Number(n)||0),[c,i]=(0,Ie.useState)(!1);(0,Ie.useEffect)(()=>{p(Number(n)||0)},[n]);let u=de(d),f=x=>{p(x)};return(0,I.jsxs)("div",{className:"flex flex-col",children:[l&&(0,I.jsx)("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:(0,I.jsx)(Gr.default,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:l})}),(0,I.jsxs)("div",{className:"flex items-center justify-between",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:r}),(0,I.jsxs)("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,(0,I.jsx)("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),(0,I.jsxs)("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[(0,I.jsx)(oe.Button,{icon:(0,I.jsx)(ae.MinusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m-Number(o)),disabled:c}),(0,I.jsx)(oe.InputNumber,{value:m,onChange:x=>f(Number(x)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:c}),(0,I.jsx)(oe.Button,{icon:(0,I.jsx)(ae.PlusOutlined,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m+Number(o)),disabled:c}),(0,I.jsx)("div",{className:"w-px h-4 bg-border/50 mx-1"}),(0,I.jsx)(oe.Button,{type:"primary",size:"small",shape:"round",icon:c?(0,I.jsx)(ae.LoadingOutlined,{}):(0,I.jsx)(ae.SaveOutlined,{}),onClick:async()=>{i(!0);try{he.emit("action",{type:s,payload:{value:m,label:r,...t}}),await new Promise(x=>setTimeout(x,800)),e.success(`\u5DF2\u66F4\u65B0 ${r} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{i(!1)}},loading:c,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},Ur=w(io,{schema:He,getTitle:t=>t.label,skeleton:{rows:2}});var ie=require("react/jsx-runtime");function so(t){let e=t?.theme?{"data-theme":t.theme}:{};return me({"metric-card":(o,a)=>(0,ie.jsx)(Or,{node:o,...e},a),"mini-kpi-strip":(o,a)=>(0,ie.jsx)(Ir,{node:o,...e},a),"snapshot-table":(o,a)=>(0,ie.jsx)(Br,{node:o,...e},a),"insight-card":(o,a)=>(0,ie.jsx)(Vr,{node:o,...e},a),"poster-card":(o,a)=>(0,ie.jsx)(Kr,{node:o,...e},a),"thought-chain":(o,a)=>(0,ie.jsx)(Jr,{node:o,...e},a),"interactive-summary":(o,a)=>(0,ie.jsx)(Ur,{node:o,...e},a)},{})}0&&(module.exports={AntVChartLoader,COMMON_PROPS,DefaultEmptyPlaceholder,DefaultErrorPlaceholder,ThemeProvider,XCMLCardWrapper,XCMLChart,XCMLEventBus,XCMLLayoutProvider,XCMLMarkdown,XCML_SCHEMAS,buildConfig,chartSchema,cleanPropsBySchema,columnChartSchema,columnStrategy,createAntVRenderers,createBasicRenderers,createExtendedRenderers,createRenderersWithAliases,deepMerge,dualAxesChartSchema,dualAxesStrategy,extractBaseStyles,funnelChartSchema,funnelStrategy,getChartStrategy,getTheme,lineChartSchema,lineStrategy,mergePropsAndBody,normalizeNodeData,normalizeTagName,parse,parseArrayProp,parseInlineData,parseXCML,pieChartSchema,pieStrategy,preprocessXCML,renderXCML,strategies,stringify,stringifyToXCML,themeDark,themeLight,themeMap,toXCMLNodeFromElement,toXCMLTag,toXTag,useTheme,useXCMLComponent,useXCMLLayout,useXCMLNode,validateDataSchema,validateXCMLNode,withXCMLCard,xTagPlugin,xcmlBus});
|