@chatbi-v/xcml 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -18
- package/dist/index.css +700 -185
- package/dist/index.d.cts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +17 -18
- package/package.json +4 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import{parse as Ee}from"yaml";var ce={tag:"xcml: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:"label",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:{label:"\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 me={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 pe={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 ue={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 ye={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 ge={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 fe={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 he={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 be={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 nt={line:ye,column:ge,pie:fe,"dual-axes":he,funnel:be};function ot(t,e){let n=new Map;return Object.entries(t).forEach(([r,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 c=n.get(s.name);c?c.types.push(r):n.set(s.name,{def:s,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 te={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"},...ot(nt,"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"},...ot(nt,"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 xe={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 Ce={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 ve={tag:"xcml: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 we={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 Se={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 Me={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"}],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 Ne={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 ir=[{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}],sr={"xcml:metric":ce,"xcml:table":de,"xcml:chart":te,"xcml:list":me,"xcml:thought-chain":Ne,"xcml:insight-card":xe,"xcml:metric-card":ve,"xcml:card":pe,"xcml:toc":ue,"xcml:poster-card":Se,"xcml:mini-kpi-strip":we,"xcml:interactive-summary":Ce,"xcml:snapshot-table":Me},re=Object.fromEntries(Object.entries(sr).map(([t,e])=>[t,{...e,props:[...e.props||[],...ir]}]));import{parse as Ia,stringify as Oa}from"yaml";function ba(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 at(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(i){console.warn("[XCML] Failed to decode data-xcml-raw:",i)}if(typeof r=="string"){let i=r.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{r=JSON.parse(i)}catch{}}let a={};if(e&&((e.props||[]).forEach(i=>{i.default!==void 0&&(a[i.name]=i.default)}),(e.body||[]).forEach(i=>{i.default!==void 0&&(a[i.name]=i.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 i=(e?.body||[]).find(c=>c.type==="array")?.name||"data";a[i]=r}else{let i=e?.example?.contentProp||(e?.body||[]).find(c=>c.name==="content"||c.name==="value")?.name||"content";a[i]=r}return Object.assign(a,n),["theme","variant","layout","size"].forEach(i=>{a[i]===void 0&&n[i]!==void 0&&(a[i]=n[i])}),a}var J=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 U(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 wa=(t,e="xcml-node")=>{if(!t||!t.type||!re[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function Sa(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 it(t,e){let{node:n,streamStatus:r}=t,o=at(n,e),a=n?.streamStatus||r||o.streamStatus,s=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,i={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:i,isLoading:s,streamStatus:a}}function $e(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function lr(t){return`x-${$e(t)}`}function Le(t){return`xcml:${$e(t)}`}var je=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})}},ke=new je,cr=/\/\/(.*)$/gm,dr=/\/\*[\s\S]*?\*\//g;function mr(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(cr,"").replace(dr,""):n;try{return JSON.parse(r)}catch(o){try{let a=Ee(r);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return Ee(n);if(e==="csv"||e==="tsv"){let r=e==="csv"?",":" ",o=n.split(/\r?\n/).filter(s=>s.trim());if(o.length===0)return[];let a=o[0].split(r).map(s=>s.trim());return o.slice(1).map(s=>{let i=s.split(r),c={};return a.forEach((l,m)=>{let d=i[m]?.trim();d==="true"?d=!0:d==="false"?d=!1:d!==""&&!isNaN(Number(d))&&(d=Number(d)),c[l]=d}),c})}return e==="ndjson"?n.split(/\r?\n/).filter(Boolean).map(r=>JSON.parse(r)):JSON.parse(n)}catch(r){throw r}}function Xa(t,e){return e!=null}function st(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let n=Le(t),r=re[n];if(!r)return e;let o={...e};return[...r.props||[],...r.body||[]].forEach(s=>{let i=o[s.name];if((s.type==="object"||s.type==="array")&&typeof i=="string")try{let c=i.trim();if(c.startsWith("{")||c.startsWith("[")){let l=c,m=0;for(;typeof l=="string"&&m<2;){let d=JSON.parse(l);if(d===null||typeof d!="object")if(typeof d=="string"&&(d.startsWith("{")||d.startsWith("[")))l=d;else break;else{l=d;break}m++}o[s.name]=l}}catch{}}),o}function lt(t,e,n,r={}){let o=Le(t),a=re[o],s={},i={},{preferBody:c=!1}=r,l=ct(n),m=l;a&&(typeof l=="string"?m={[a.example?.contentProp||(a.body||[]).find(g=>g.name==="content"||g.name==="value")?.name||"content"]:l}:l&&typeof l=="object"&&Array.isArray(l)),m&&typeof m=="object"&&!Array.isArray(m)&&Object.keys(m).forEach(u=>{/^\d+$/.test(u)||(i[u]=m[u])});let d={...m&&typeof m=="object"&&!Array.isArray(m)?m:{},...e};if(!a)return{props:e,body:n};let p=new Set((a.props||[]).map(u=>u.name)),h=new Set((a.body||[]).map(u=>u.name));for(let[u,g]of Object.entries(d))/^\d+$/.test(u)||(c?p.has(u)||h.has(u)?i[u]=g:u in e?s[u]=g:i[u]=g:p.has(u)?s[u]=g:h.has(u)?i[u]=g:u in e?s[u]=g:i[u]=g);let x=i;if(Array.isArray(l))if(Object.keys(i).length===0)x=l;else{let u=(a.body||[]).find(g=>g.type==="array")?.name||"data";i[u]=l,x=i}return{props:st(o,s),body:st(o,x)}}function ct(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 Ra(t){let e=Le(t.tag||t.type||"unknown"),n=lr(e),r={...t.props||{}},o=ct(t.body),{body:a}=lt(e,r,o,{preferBody:!0}),s=[],i=a,c=Object.keys(a||{});c.length===1&&c[0]==="data"&&Array.isArray(a.data)&&(i=a.data);let l=s.length>0?" "+s.join(" "):"",m=JSON.stringify(i,null,2);return`<${n}${l}>
|
|
2
|
-
${
|
|
3
|
-
</${n}>`}function
|
|
1
|
+
import{parse as De}from"yaml";var ge={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 fe={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 he={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 xe={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 Ce={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 ve={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 we={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 Se={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 Ne={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 lt={line:Ce,column:ve,pie:we,"dual-axes":Se,funnel:Ne};function ct(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 ie={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"},...ct(lt,"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"},...ct(lt,"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 Me={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 Le={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 Pe={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 Te={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 Re={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 Xe={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 gr=[{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}],fr={"xcml:metric":ge,"xcml:table":fe,"xcml:chart":ie,"xcml:list":he,"xcml:thought-chain":Xe,"xcml:insight-card":Me,"xcml:metric-card":ke,"xcml:card":be,"xcml:toc":xe,"xcml:poster-card":Te,"xcml:mini-kpi-strip":Pe,"xcml:interactive-summary":Le,"xcml:snapshot-table":Re},se=Object.fromEntries(Object.entries(fr).map(([t,e])=>[t,{...e,props:[...e.props||[],...gr]}]));import{parse as Qa,stringify as ei}from"yaml";function Ia(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 dt(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 Q=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 ee(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 Da=(t,e="xcml-node")=>{if(!t||!t.type||!se[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function Wa(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 mt(t,e){let{node:n,streamStatus:r}=t,o=dt(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 qe(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function hr(t){return`x-${qe(t)}`}function Fe(t){return`xcml:${qe(t)}`}var We=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})}},le=new We,br=/\/\/(.*)$/gm,xr=/\/\*[\s\S]*?\*\//g;function Cr(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(br,"").replace(xr,""):n;try{return JSON.parse(r)}catch(o){try{let a=De(r);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return De(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 Ja(t,e){return e!=null}function pt(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let n=Fe(t),r=se[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 ut(t,e,n,r={}){let o=Fe(t),a=se[o],i={},s={},{preferBody:d=!1}=r,m=yt(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:pt(o,i),body:pt(o,b)}}function yt(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 Ga(t){let e=Fe(t.tag||t.type||"unknown"),n=hr(e),r={...t.props||{}},o=yt(t.body),{body:a}=ut(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}>
|
|
2
|
+
${p}
|
|
3
|
+
</${n}>`}function Ua(t){if(!t)return null;let e=t.trim();if(!e.startsWith("<"))try{let l=De(e);if(l&&(l.tag||l.type))return{tag:l.tag||l.type,props:l.props||{},body:l.body||l.data||l.dataProps||{}}}catch{}let n=e.match(/^<((?:xcml:|x-)[^\s/>]+)\s*([\s\S]*?)(\/?>)([\s\S]*?)$/);if(!n)return null;let[,r,o,a]=n,i=a==="/>",s={},d=/([a-zA-Z0-9-]+)\s*=\s*(?:'([^']*)'|"([^"]*)"|`([^`]*)`|((?:(?!\s|\/|>).)+))/g,m;for(;(m=d.exec(o))!==null;){let l=m[1],u=m[2]||m[3]||m[4]||m[5];s[l]=u}let p="";if(!i){let l=`</${r}>`,u=e.lastIndexOf(l);if(u!==-1){let b=-1,y=null;for(let h=0;h<e.length;h++){let g=e[h];if((g==="'"||g==='"'||g==="`")&&(y?y===g&&(y=null):y=g),g===">"&&!y){b=h;break}}b!==-1&&(p=e.slice(b+1,u).trim())}}let c=ce(r,s,p);return{tag:c.type,props:c.props,body:c.body}}function ce(t,e,n){let r=qe(t),o=Fe(r),a=e["data-format"]||"json",i;try{i=Cr(n,a)}catch{if(r==="list")try{i=vr(n)}catch{}!i&&n.trim()&&(i=n.trim()),i||(i=null)}let s={...e};for(let p in s){let c=s[p];if(typeof c=="string"){let l=c.trim();for(;l.length>=2&&(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'")||l.startsWith("`")&&l.endsWith("`"));)l=l.slice(1,-1).trim();if(l==="true")s[p]=!0;else if(l==="false")s[p]=!1;else if(/^-?\d+(\.\d+)?$/.test(l)){let u=Number(l);isNaN(u)||(s[p]=u)}else if(l.startsWith("[")||l.startsWith("{"))try{s[p]=JSON.parse(l)}catch{try{s[p]=JSON.parse(l.replace(/'/g,'"'))}catch{s[p]=l}}else s[p]=l}}let{props:d,body:m}=ut(o,s,i);return{type:o,props:d,body:m,__source:n}}function vr(t){let n=t.split(/\r?\n/).filter(r=>r.trim()).map(r=>{let o=r.match(/^\s*[-*+]\s*\[([ x-])\]\s*(.*)$/);if(o){let i=o[1],s=o[2].trim(),d="todo";return i==="x"?d="done":i==="-"&&(d="doing"),{title:s,status:d}}let a=r.match(/^\s*[-*+]\s*(.*)$/);return a?{title:a[1].trim(),status:"normal"}:null}).filter(Boolean);return n.length>0?{items:n}:null}function wr(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[,n,r,o]=e;if(!r)return t;let a=/([a-zA-Z0-9-]+)\s*=\s*([\[\{])/g,i=0,s="",d;for(;(d=a.exec(r))!==null;){let m=d[1],p=d[2],c=p==="["?"]":"}",l=d.index,u=l+d[0].length-1;if((r.slice(0,l).match(/['"]/g)||[]).length%2!==0)continue;let h=0,g=-1;for(let f=u;f<r.length;f++)if(r[f]===p?h++:r[f]===c&&h--,h===0){g=f;break}if(g!==-1){let f=r[u-1];if(f==="'"||f==='"')continue;let x=r.slice(u,g+1);s+=r.slice(i,l),s+=`${m}='${x}'`,i=g+1,a.lastIndex=i}}return s+=r.slice(i),`${n} ${s}${o}`}function gt(t,e){if(!t)return"";let n=t.match(/<(xcml:|xcml|xcm|xc|x)$/);n&&(t=t.slice(0,n.index));let r=t.replace(/<(\/?)xcml:([a-zA-Z0-9-]+)/g,"<$1x-$2"),o=e?new Set(e):null,a=[],i=0,s=r.length;for(;i<s;){let d=r[i];if(d!=="<"&&d!=="`"){let m=r.indexOf("<",i+1),p=r.indexOf("`",i+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(r.slice(i));break}a.push(r.slice(i,c)),i=c;continue}if(r.startsWith("```",i)){let m=r.indexOf("```",i+3);if(m===-1){a.push(r.slice(i));break}a.push(r.slice(i,m+3)),i=m+3;continue}if(d==="`"){let m=r.indexOf("`",i+1);if(m===-1){a.push(r.slice(i));break}a.push(r.slice(i,m+1)),i=m+1;continue}if(d==="<"){let m=-1,p=null;for(let c=i+1;c<s;c++){let l=r[c];if((l==="'"||l==='"'||l==="`")&&(p?p===l&&(p=null):p=l),l===">"&&!p){m=c;break}}if(m===-1){if(i+1<s&&/[a-zA-Z\/]/.test(r[i+1])){let c=i+(r[i+1]==="/"?2:1);for(;c<s&&/[a-zA-Z0-9-]/.test(r[c]);)c++;let l=r.slice(i+(r[i+1]==="/"?2:1),c);if(l.startsWith("x-")){if(o&&!o.has(l))break;r[i+1]!=="/"?a.push(`
|
|
4
4
|
|
|
5
|
-
<${
|
|
5
|
+
<${l} data-xcml-loading="true"></${l}>
|
|
6
6
|
|
|
7
7
|
`):a.push(`
|
|
8
8
|
|
|
9
|
-
${r.slice(
|
|
9
|
+
${r.slice(i).trim()}>
|
|
10
10
|
|
|
11
|
-
`);break}}a.push(
|
|
11
|
+
`);break}}a.push(d),i++;continue}else{let c=r[i+1]==="/",l=i+(c?2:1),u=l;for(;u<m&&/[a-zA-Z0-9-]/.test(r[u]);)u++;let b=r.slice(l,u);if(b.startsWith("x-")){if(o&&!o.has(b)){let g=`</${b}>`,f=r.indexOf(g,i);i=f!==-1?f+g.length:m+1;continue}let y=r.slice(i,m+1);c||(y=wr(y.replace(/\r?\n/g," ")));let h=y.replace(/\s+/g," ");if(c||h.endsWith("/>")){a.push(`
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${h}
|
|
14
14
|
|
|
15
|
-
`),
|
|
15
|
+
`),i=m+1;continue}else{let g=`</${b}>`,f=r.indexOf(g,m+1);if(f===-1){let x=h;x.includes("data-xcml-loading")||(x=x.replace(">",' data-xcml-loading="true">')),a.push(`
|
|
16
16
|
|
|
17
|
-
${
|
|
18
|
-
</${
|
|
17
|
+
${x}
|
|
18
|
+
</${b}>
|
|
19
19
|
|
|
20
|
-
`);break}else{let
|
|
20
|
+
`);break}else{let x=r.slice(m+1,f),T=x.trim(),L=x;(T.startsWith("{")||T.startsWith("["))&&(L=x.replace(/\\/g,"\\\\"));let S=h,M=L;if(T){let v=btoa(unescape(encodeURIComponent(x)));S=h.replace(">",` data-xcml-raw="${v}">`),M=""}a.push(`
|
|
21
21
|
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
22
|
+
${S}
|
|
23
|
+
${M}
|
|
24
|
+
${g}
|
|
25
25
|
|
|
26
|
-
`),
|
|
26
|
+
`),i=f+g.length;continue}}}}}a.push(d),i++}return a.join("").replace(/\n{3,}/g,`
|
|
27
27
|
|
|
28
|
-
`).trim()}import
|
|
28
|
+
`).trim()}import F from"react";import{XMarkdown as Lr}from"@ant-design/x-markdown";import{Button as kr,Modal as Pr,Tooltip as Tr}from"@chatbi-v/ui-shell";import{CodeOutlined as Rr}from"@ant-design/icons";import ze,{createContext as bt,useContext as xt,useState as Sr,useCallback as ft}from"react";import{jsx as ht}from"react/jsx-runtime";var Ct=bt([]),vt=bt({register:()=>{},unregister:()=>{}}),Nr=()=>xt(Ct),Ve=()=>xt(vt),wt=()=>{let t=Nr(),{register:e,unregister:n}=Ve();return{items:t,register:e,unregister:n}},St=({children:t})=>{let[e,n]=Sr(new Map),r=ze.useRef(0),o=ft(d=>{n(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:r.current++}),p)})},[]),a=ft(d=>{n(m=>{let p=new Map(m);return p.delete(d)?p:m})},[]),i=ze.useMemo(()=>Array.from(e.values()).sort((d,m)=>d.index-m.index),[e]),s=ze.useMemo(()=>({register:o,unregister:a}),[o,a]);return ht(vt.Provider,{value:s,children:ht(Ct.Provider,{value:i,children:t})})};function di(t={}){let n=`(${(t.tags||["chart","table","metric","list","card","toc"]).join("|")})`,r=new RegExp(`<x-${n}([^>]*)>`,"i");return{level:"block",name:"x-tag",start(o){return o.indexOf("<x-")},tokenizer(o){let a=o.match(r);if(!a)return;let i=a[1],s=a[2]||"",d=a.index||0,m=new RegExp(`</x-${i}>`,"i"),p=o.slice(d+a[0].length),c=p.match(m);if(!c)return;let l=p.slice(0,c.index),u=o.slice(d,d+a[0].length+l.length+c[0].length),b=Mr(s);return{type:"x-tag",raw:u,name:i,attrs:b,body:l}},renderer(o){let a=ce(o.name,o.attrs,o.body);return{type:a.type,props:a.props,body:a.body}}}}function Mr(t){let e={},n=/(\w[\w-]*)(=\"([^\"]*)\"|=\'([^\']*)\'|=([^\s"']+))?/g,r;for(;r=n.exec(t);){let o=r[1],a=r[3]??r[4]??r[5]??!0;e[o]=a}return e}import{clsx as Xr}from"clsx";import{twMerge as Je}from"tailwind-merge";import{jsx as P,jsxs as Nt}from"react/jsx-runtime";function Ge(t){let{content:e,stream:n,renderers:r,className:o,style:a,openLinksInNewTab:i,dompurifyConfig:s,enableHoverSource:d=!1,theme:m}=t,p=F.useDeferredValue(e),c=F.useMemo(()=>{let y=r?Object.keys(r).map(h=>h.startsWith("xcml:")?`x-${h.slice(5)}`:h):[];return p?gt(p,y):""},[p,r]),l=F.useMemo(()=>new WeakMap,[]),u=F.useMemo(()=>{let y={};if(r){let g=new Set;Object.keys(r).forEach(f=>{let x=f.startsWith("xcml:"),T=f.startsWith("x-");if(x||T){let L=x?`x-${f.slice(5)}`:f;g.add(L);let S=r[f];y[L]=M=>{let{domNode:v,className:X,streamStatus:$,node:H,children:I,...k}=M,j=l.get(v);if(!j){let ae="",Be=k["data-xcml-raw"];if(Be)try{ae=decodeURIComponent(escape(atob(Be)))}catch(st){console.error("[XCML] Failed to decode raw body:",st),ae=Ke(v?.children||[])}else ae=Ke(v?.children||[]);let it=x?f.slice(5):f.slice(2);j=ce(it,k,ae),l.set(v,j)}let R={...j};k["data-xcml-loading"]==="true"?R.streamStatus="loading":R.streamStatus=$;let at=S(R,k.key??L);return P(Fr,{tag:L,node:R,className:X,enableHoverSource:d,children:at})}}})}y.pre=g=>{let{domNode:f,streamStatus:x,node:T,...L}=g,S=(f?.children||[]).find(X=>X?.name==="code"),M=[S?.attribs?.class,S?.attribs?.classname,S?.attribs?.className].filter(Boolean).join(" ");if(/language-mermaid/.test(M)){let X=Ke(S?.children||[]),$=X.split("").reduce((I,k)=>(I=(I<<5)-I+k.charCodeAt(0),I&I),0),H=`m-${Math.abs($)}`;return P(Ar,{id:H,code:X,theme:m},g.key)}return F.createElement("pre",L,g.children)},y.p=g=>{let{domNode:f,node:x,children:T,streamStatus:L,...S}=g;return f?.children?.some(v=>v.type==="tag"&&(["div","p","pre","blockquote","table","ul","ol","h1","h2","h3","h4","h5","h6","form","fieldset","address"].includes(v.name)||v.name&&v.name.startsWith("x-")))||x?.children?.some(v=>v.tagName==="div"||v.tagName&&v.tagName.startsWith("x-"))?P("div",{...S,className:Je("mb-4 w-full",S.className),children:T}):P("p",{...S,children:T})};let h=F.memo(({level:g,children:f,domNode:x,streamStatus:T,node:L,...S})=>{let{register:M,unregister:v}=Ve(),X=F.useCallback(R=>typeof R=="string"?R:Array.isArray(R)?R.map(X).join(""):F.isValidElement(R)?X(R.props.children):"",[]),$=X(f),H=F.useMemo(()=>$.trim().toLowerCase().replace(/\s+/g,"-"),[$]),I=S.id||H||`h${g}-${Math.random().toString(36).slice(2,9)}`,k=F.useRef(null);F.useEffect(()=>{if(!M)return;let R={id:I,title:$,level:g};return(!k.current||k.current.id!==R.id||k.current.title!==R.title||k.current.level!==R.level)&&(k.current&&v?.(k.current.id),M(R),k.current=R),()=>{k.current&&(v?.(k.current.id),k.current=null)}},[I,$,g,M,v]);let j=`h${g}`;return Nt(j,{id:I,className:"scroll-mt-20 group relative",...S,children:[f,d&&P("a",{href:`#${I}`,className:"ml-2 opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity no-underline",children:"#"})]})});return y.h1=g=>P(h,{level:1,...g}),y.h2=g=>P(h,{level:2,...g}),y.h3=g=>P(h,{level:3,...g}),y.h4=g=>P(h,{level:4,...g}),y.h5=g=>P(h,{level:5,...g}),y.h6=g=>P(h,{level:6,...g}),y},[r,d,m]);return P(St,{children:P(Lr,{content:c,streaming:n?{hasNextChunk:!0}:void 0,components:u,className:Je(Xr("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:i,dompurifyConfig:s})})}function Fr({children:t,tag:e,node:n,className:r,enableHoverSource:o}){let[a,i]=F.useState(!1),[s,d]=F.useState(!1),m=c=>{c.stopPropagation(),d(!0)},p=F.useMemo(()=>{let c=Object.entries(n.attributes||{}).map(([l,u])=>`${l}="${u}"`).join(" ");return`<${e}${c?" "+c:""}>${n.children?`
|
|
29
29
|
`+n.children+`
|
|
30
|
-
`:""}</${e}>`},[e,n]);return Ct("div",{className:ze("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",r),onMouseEnter:()=>o&&s(!0),onMouseLeave:()=>o&&s(!1),children:[t,a&&o&&L(xr,{title:"\u67E5\u770B\u6E90\u7801",children:L(hr,{icon:L(Cr,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:l})}),L(br,{open:i,onCancel:()=>c(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:L("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:m})})]})}var qe=new WeakMap;function _e(t){if(!t)return"";if(qe.has(t))return qe.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 qe.set(t,r),r}var Sr=X.memo(({code:t,theme:e,id:n})=>{let r=X.useRef(null);return X.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:s})=>{r.current&&(r.current.innerHTML=s)})})},[t,e,n]),L("div",{ref:r,className:"mermaid w-full flex justify-center my-4"})});import Qr,{useMemo as Je,Suspense as en,forwardRef as tn}from"react";import*as rn from"@ant-design/plots";import{Skeleton as $t}from"antd";import{createContext as Mr,useContext as Nr,useEffect as Lr,useState as kr,useMemo as Pr,useRef as Xr}from"react";import{XProvider as Rr}from"@ant-design/x";import{theme as vt}from"antd";import{jsx as Ve}from"react/jsx-runtime";var Tr={theme:"light",setTheme:()=>null},wt=Mr(Tr);function ni({children:t,defaultTheme:e="light",theme:n,primaryColor:r="#6366f1",storageKey:o="xcml-ui-theme",scoped:a=!0,className:s,style:i,...c}){let[l,m]=kr(()=>localStorage.getItem(o)||e),d=n??l,p=Xr(null);Lr(()=>{let u=a?p.current:window.document.documentElement;if(!u)return;if(u.style.setProperty("--primary",r),r.startsWith("#")){let y=parseInt(r.slice(1,3),16),f=parseInt(r.slice(3,5),16),b=parseInt(r.slice(5,7),16);u.style.setProperty("--primary-rgb",`${y}, ${f}, ${b}`)}u.classList.remove("light","dark"),u.removeAttribute("data-theme");let g=["ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyan"];if(d==="system"){let y=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(y);return}if(d==="dark"){u.classList.add("dark");return}if(d==="light"){u.classList.add("light");return}if(g.includes(d)){u.setAttribute("data-theme",d);return}},[d,a]);let h={theme:d,setTheme:u=>{localStorage.setItem(o,u),m(u)}},x=Pr(()=>({algorithm:d==="dark"||d==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?vt.darkAlgorithm:vt.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'}}),[d,r]);return Ve(wt.Provider,{value:h,...c,children:Ve(Rr,{theme:x,children:Ve("div",{ref:p,className:`xcml-scope ${s||""}`,style:{color:"inherit",background:"inherit",...i},children:t})})})}var St=()=>{let t=Nr(wt);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var Fr={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},Ar={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]}}}},He={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Fr},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"}}}}}}},Ir={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Ar},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:He,dark:Ir,default:He};function Mt(t){return Or[t||"default"]||He}import Er from"react";var jr=Er.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Nt={type:"line",schema:ye,getComponent:()=>jr,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};import $r from"react";var Br=$r.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Lt={type:"column",schema:ge,getComponent:()=>Br,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}};import Dr from"react";var Wr=Dr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),kt={type:"pie",schema:fe,getComponent:()=>Wr,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}};import qr from"react";var _r=qr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),Pt={type:"dual-axes",schema:he,getComponent:()=>_r,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(i=>i.data&&i.data.length>0||r.length===0?!0:i.yField&&r.includes(i.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(c=>r.includes(c)))&&(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 i=e.xField,c=r.filter(l=>l!==i&&typeof n[0][l]=="number");c.length>=2?e.children=[{type:"interval",yField:c[0]},{type:"line",yField:c[1],style:{lineWidth:2}}]:c.length===1&&(e.children=[{type:"interval",yField:c[0]}])}let a=Array.isArray(e.data)&&e.data.length>0,s=Array.isArray(e.children)&&e.children.some(i=>i.data&&Array.isArray(i.data)&&i.data.length>0);if(!a&&s){let{data:i,...c}=e;return c}return e}};import zr from"react";var Vr=zr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Xt={type:"funnel",schema:be,getComponent:()=>Vr,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(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 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 Hr={line:Nt,column:Lt,pie:kt,"dual-axes":Pt,funnel:Xt};function Rt(t){return t&&Hr[t.toLowerCase()]||null}import Kr from"react";import{Empty as Tt,Button as Jr,Result as Ur}from"antd";import{jsx as ne}from"react/jsx-runtime";function Pe(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&&!Kr.isValidElement(o)?n[r]=Pe(a,o):n[r]=o}return n}function Ft(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]=Pe(o.default,n[a])),o.transform){let s=n[a];n[a]=o.transform(s,n)}}),n)}function At(t){let{type:e,data:n,theme:r,title:o,__native__:a,...s}=t,i={data:n||[],height:t.height||300,theme:r||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},c=Pe(Pe(i,s),a||{});return c.seriesField&&!c.colorField&&(c.colorField=c.seriesField),c.__native__={...c},c}var It=()=>ne("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:ne(Tt,{image:Tt.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),Ot=({error:t,reset:e})=>ne("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:ne(Ur,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[ne(Jr,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});import Gr from"react";import{Skeleton as Zr}from"antd";import{clsx as Et}from"clsx";import{twMerge as Yr}from"tailwind-merge";import{jsx as oe,jsxs as Ke}from"react/jsx-runtime";var Xe=({title:t,icon:e,children:n,source:r,summary:o,variant:a="card",theme:s,hoverable:i=!0,className:c,domNode:l,streamStatus:m,node:d,label:p,value:h,footer:x,precision:u,layout:g,note:y,trend:f,trendValue:b,unit:w,prefix:M,wow:N,yoy:T,sentiment:S,highlights:E,citations:B,actions:Q,steps:O,columns:k,rows:z,charts:P,data:et,subTitle:ee,themeColor:Oe,backgroundImage:tt,qrCode:rt,author:Ao,date:Io,...nr})=>{let K=a==="plain",or=s??d?.props?.theme??d?.data?.theme,ar=Yr(Et("xcml-scope xcml-card not-prose max-w-full min-w-0 group",K?"p-1":"rounded-xl border border-border/80 bg-card/50 backdrop-blur-sm shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-300 ease-out hover:ease-in-out",c,i&&!K?"hover:shadow-md hover:border-primary/50 hover:bg-card/80":""));return Ke("div",{className:ar,"data-theme":or,...nr,children:[t&&Ke("div",{className:"relative mb-4",children:[!K&&oe("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-300 group-hover:opacity-100 rounded-full scale-x-95 group-hover:scale-x-100"}),oe("div",{className:"flex items-center justify-between pb-3 border-b border-border/80",children:Ke("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!K&&e&&oe("span",{className:"flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary border border-primary/20 shadow-sm",children:e}),!K&&!e&&oe("span",{className:"w-1.5 h-6 rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]"}),t]})})]}),oe("div",{className:Et("xcml-card-body",!K&&"mt-1"),children:n})]})};import{jsx as Re}from"react/jsx-runtime";function C(t,e={}){let{schema:n,getTitle:r,getIcon:o,getVariant:a,renderLoading:s,skeleton:i=!0}=e,c=Gr.forwardRef((m,d)=>{let{merged:p,baseProps:h,isLoading:x,streamStatus:u}=it(m,n);p.delta!==void 0&&p.trendValue===void 0&&(p.trendValue=p.delta);let{className:g,...y}=m,f=r?r(p):p.title,b;f&&(typeof f=="string"?b=f:typeof f=="object"&&(Array.isArray(f)?b=void 0:b=f.text||f.content||JSON.stringify(f)));let w=o?o(p):p.icon,M=a?a(p):h.variant||"card",N=p.hoverable!==void 0?p.hoverable:!0,T={title:b,icon:w,variant:M,hoverable:N,className:g,node:m.node,streamStatus:u,...y};return x?Re(Xe,{...T,children:s?s(p):i?Re(Zr,{active:!0,paragraph:{rows:typeof i=="object"?i.rows:2}}):null}):Re(Xe,{...T,children:Re(t,{...p,ref:d})})}),l=t.displayName||t.name||"Component";return c.displayName=`withXCMLCard(${l})`,c}import{jsx as j,jsxs as sn}from"react/jsx-runtime";import{createElement as ln}from"react";var nn=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),jt={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},on=t=>{if(!t)return null;let e=jt[t.toLowerCase()]||jt[t],n=rn;if(e&&e in n)return n[e];let r=nn(t);return r&&r in n?n[r]:t in n?n[t]:null},Ue=class extends Qr.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):j(Ot,{error:this.state.error,reset:this.reset}):this.props.children}},an=tn((t,e)=>{let{type:n="line",node:r,theme:o,...a}=t,{theme:s}=St(),i=Je(()=>Rt(n),[n]),c=Je(()=>i?.getComponent()||on(n),[i,n]),l=Je(()=>{let h=t.theme||o||s||"light",u=["dark","black","midnight","slate","crimson"].includes(h)?"dark":"light",g=Mt(u),y=t.data,f={...t,theme:g,data:y},b=Ft(f,i?.schema||te),w=i?.transformProps?i.transformProps(b):b;return At(w)},[t,o,s,i]);if(!c)return sn("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 m=l.data&&Array.isArray(l.data)&&l.data.length>0,d=Array.isArray(l.children)&&l.children.some(h=>h.data&&Array.isArray(h.data)&&h.data.length>0);return m||d?j(Ue,{type:n,errorPlaceholder:l.errorPlaceholder,children:j(en,{fallback:j($t,{active:!0}),children:j("div",{className:"",children:ln(c,{...l,ref:e,key:n})})})}):j(It,{})}),Te=C(an,{schema:te,renderLoading:t=>j("div",{className:"w-full flex justify-center items-center bg-black/5 rounded-lg animate-pulse",style:{height:t.height||300},children:j($t.Image,{active:!0})})}),cs=t=>{let{node:e,...n}=t;if(e)return j(Te,{node:e});let r={props:{},body:{...n,data:t.data}};return j(Te,{node:r})};import{jsx as cn}from"react/jsx-runtime";function bs(t){let e=t?.theme;return U({chart:(r,o)=>cn(Te,{node:r,theme:e,className:r.props?.className},o)})}import{useMemo as Bt}from"react";import{ArrowUpOutlined as dn,ArrowDownOutlined as mn}from"@ant-design/icons";import{Fragment as yn,jsx as D,jsxs as Y}from"react/jsx-runtime";var pn=({data:t,color:e="#059669"})=>{if(!Array.isArray(t)||t.length<2)return null;let n=Math.min(...t),o=Math.max(...t)-n||1,a=80,s=24,i=t.map((c,l)=>{let m=l/(t.length-1)*a,d=s-(c-n)/o*s;return`${m},${d}`}).join(" ");return Y("svg",{width:a,height:s,className:"overflow-visible ml-2",children:[D("polyline",{points:i,fill:"none",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),D("circle",{cx:(t.length-1)/(t.length-1)*a,cy:s-(t[t.length-1]-n)/o*s,r:"2",fill:e})]})},un=t=>{let{precision:e=0,layout:n="vertical",footer:r,value:o,note:a,trend:s,trendValue:i}=t,c=Bt(()=>{if(i==null)return null;if(typeof i=="number"){let h=i.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(i).startsWith("+")?`+${h}`:s==="down"&&!String(i).startsWith("-")?`-${h}`:h}return String(i)},[i,e,s]),l=Bt(()=>{if(o==null)return"-";let h=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof h=="number"?h.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),m=s==="up",d=s==="down",p=Array.isArray(s);return Y(yn,{children:[Y("div",{className:`flex ${n==="horizontal"?"flex-row items-center justify-between":"flex-col"} gap-2`,children:[Y("div",{className:"flex flex-col",children:[Y("div",{className:"flex items-baseline gap-1.5 group",children:[D("span",{className:"text-metric font-bold text-card-foreground tracking-tight group-hover:text-primary transition-colors",children:l}),c&&Y("div",{className:`flex items-center text-xs font-bold px-1.5 py-0.5 rounded ${m?"text-success bg-success/10":d?"text-destructive bg-destructive/10":"text-muted-foreground bg-muted"}`,children:[m&&D(dn,{className:"mr-0.5"}),d&&D(mn,{className:"mr-0.5"}),c]})]}),a&&D("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",title:a,children:a})]}),p&&D("div",{className:"h-10 w-24",children:D(pn,{data:s,color:m?"#10b981":d?"#ef4444":"#6366f1"})})]}),r&&D("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-[10px] text-muted-foreground italic",children:r})]})},Dt=C(un,{schema:ce,skeleton:{rows:1}});import{jsx as Ye}from"react/jsx-runtime";var gn=t=>{let{description:e,content:n,node:r}=t,o=n||e||(r?.body||r?.data?"":r?.__source);return Ye("div",{className:"text-muted-foreground leading-relaxed",children:o?Ye(xt,{content:o}):Ye("div",{className:"text-muted-foreground/50 text-xs italic",children:"No content"})})},Wt=C(gn,{schema:pe,skeleton:{rows:2}});import{CheckCircleOutlined as fn,MinusCircleOutlined as hn,BorderOutlined as bn}from"@ant-design/icons";import{Fragment as vn,jsx as A,jsxs as G}from"react/jsx-runtime";var xn=({item:t,layout:e,index:n,stripe:r})=>{let{title:o,desc:a,value:s,status:i,type:c="text"}=t;return c==="metric"?G("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:[A("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),A("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:s}),a&&A("div",{className:"text-[10px] text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):G("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${r?"bg-muted/60":""}`,children:[G("div",{className:"mt-1",children:[i==="done"&&A(fn,{className:"text-success"}),i==="doing"&&A(hn,{className:"text-primary animate-pulse"}),i==="todo"&&A(bn,{className:"text-muted-foreground/30"}),!i&&A("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-[10px] text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:n+1})]}),G("div",{className:"flex-1 min-w-0",children:[A("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&A("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},Cn=t=>{let{header:e,footer:n,layout:r="grid",columns:o=3,items:a=[],type:s="text",stripe:i=!1}=t,c=r==="grid",m={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 G(vn,{children:[e&&A("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),G("div",{className:c?`grid ${m} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((d,p)=>A(xn,{item:{type:s,...d},layout:r,index:p,stripe:i&&p%2===1},p)),a.length===0&&A("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),n&&A("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:n})]})},qt=C(Cn,{schema:me,skeleton:{rows:3}});import wn from"react";import{jsx as ae}from"react/jsx-runtime";var Sn=()=>{let{items:t}=ht(),e=wn.useMemo(()=>t.filter(r=>r.level>1),[t]),n=(r,o)=>{r.preventDefault();let a=document.getElementById(o);a&&a.scrollIntoView({behavior:"smooth"})};return ae("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?ae("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):ae("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(r=>ae("li",{className:"mb-2 text-sm leading-relaxed relative",style:{paddingLeft:`${(r.level-2)*1+1}rem`},children:ae("a",{href:`#${r.id}`,onClick:o=>n(o,r.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:r.title})},r.id))})})},_t=C(Sn,{schema:ue,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});import{useMemo as Mn}from"react";import{Badge as Nn,Tooltip as Ln}from"antd";import{InfoCircleOutlined as zt}from"@ant-design/icons";import{jsx as v,jsxs as $}from"react/jsx-runtime";var kn=({data:t,color:e})=>{let n=e||"hsl(var(--primary))";if(!Array.isArray(t)||t.length<2)return v("span",{className:"text-muted-foreground/30",children:"-"});let r=Math.min(...t),a=Math.max(...t)-r||1,s=60,i=20,c=t.map((l,m)=>{let d=m/(t.length-1)*s,p=i-(l-r)/a*i;return`${d},${p}`}).join(" ");return $("svg",{width:s,height:i,className:"overflow-visible",children:[v("polyline",{points:c,fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v("circle",{cx:(t.length-1)/(t.length-1)*s,cy:i-(t[t.length-1]-r)/a*i,r:"2.5",fill:n})]})},Pn=({value:t,color:e="bg-primary"})=>{let n=Math.min(Math.max(t*100,0),100);return v("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:v("div",{className:`h-full rounded-full transition-all duration-300 w-[var(--percent)] ${e}`,style:{"--percent":`${n}%`}})})},Xn=t=>{let{bordered:e=!0,size:n="middle",summary:r=!1,columns:o=[],rows:a=[],dataSource:s=[]}=t,i=s.length>0?s:a,c=o.length>0&&i.length>0,l=Mn(()=>{if(!r||!c)return null;let u={_isSummary:!0};return o.forEach(g=>{let y=i.map(f=>{let b=f[g.key];return typeof b=="string"?parseFloat(b.replace(/[^0-9.-]/g,"")):b}).filter(f=>typeof f=="number"&&!isNaN(f));if(y.length>0&&(g.type==="number"||g.key==="amount"||g.key==="value"||g.key==="sales")){let f=y.reduce((b,w)=>b+w,0);u[g.key]=Number.isInteger(f)?f:f.toFixed(2)}else u[g.key]=""}),u[o[0].key]="\u5408\u8BA1",u},[r,c,o,i]),m=(u,g)=>{let y=g[u.key];switch(u.type){case"progress":let f=typeof y=="string"?parseFloat(y):y,b=f<=1?f:f/100,w="bg-primary";return b>=1?w="bg-success":b<.6?w="bg-destructive":w="bg-primary/60",$("div",{className:"flex items-center gap-2",children:[$("span",{className:"text-xs w-8 text-right font-mono",children:[(b*100).toFixed(0),"%"]}),v("div",{className:"flex-1 min-w-[60px]",children:v(Pn,{value:b,color:w})})]});case"trend":return v(kn,{data:Array.isArray(y)?y:[]});case"badge":let M="default";return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(String(y).toLowerCase())?M="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(String(y).toLowerCase())?M="error":["warning","warn","\u8B66\u544A"].includes(String(y).toLowerCase())?M="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(String(y).toLowerCase())&&(M="processing"),v(Nn,{status:M,text:y});case"image":return v("img",{src:y,alt:"",className:"h-8 w-8 rounded object-cover border border-border"});default:return $("span",{className:u.type==="number"?"font-mono":"",children:[u.prefix,y,u.suffix]})}},d={small:"px-4 py-2.5",middle:"px-5 py-3.5",large:"px-6 py-5"},p=d[n]||d.middle,h="border-b border-border/40 transition-all duration-150",x="hover:bg-primary/5 cursor-default";return $("div",{className:`w-full overflow-hidden ${e?"border border-border/60 rounded-xl shadow-sm bg-card":""}`,children:[c?v("div",{className:"overflow-x-auto custom-scrollbar",children:$("table",{className:"w-full border-collapse text-[13.5px] leading-relaxed table-auto",children:[v("thead",{children:v("tr",{className:"bg-muted/40 border-b border-border/60",children:o.map((u,g)=>v("th",{className:`${p} font-bold text-foreground/80 whitespace-nowrap align-middle uppercase tracking-wider text-[11px]`,style:{textAlign:u.align||"left",width:u.width},children:$("div",{className:"flex items-center gap-1.5",children:[u.title,u.desc&&v(Ln,{title:u.desc,children:v(zt,{className:"text-[10px] cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]})},g))})}),$("tbody",{className:"divide-y divide-border/30",children:[i.map((u,g)=>v("tr",{className:`${h} ${x}`,children:o.map((y,f)=>v("td",{className:`${p} align-middle text-foreground/90 whitespace-normal break-words`,style:{textAlign:y.align||"left"},children:m(y,u)},f))},g)),l&&v("tr",{className:"bg-primary/5 font-bold border-t-2 border-primary/20",children:o.map((u,g)=>v("td",{className:`${p} align-middle text-primary/90 whitespace-normal break-words`,style:{textAlign:u.align||"left"},children:m(u,l)},g))})]})]})}):$("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[v("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:v(zt,{className:"text-xl opacity-20"})}),v("span",{children:"\u6682\u65E0\u6570\u636E"})]}),!r&&c&&$("div",{className:"py-2 text-[10px] text-muted-foreground/40 italic text-right px-4 border-t border-border/10",children:["Total ",i.length," rows"]})]})},Vt=C(Xn,{schema:de,skeleton:{rows:4}});import{jsx as ie}from"react/jsx-runtime";function sl(t){let e=t?.theme?{"data-theme":t.theme}:{};return U({metric:(r,o)=>ie(Dt,{node:r,...e},o),card:(r,o)=>ie(Wt,{node:r,...e},o),list:(r,o)=>ie(qt,{node:r,...e},o),toc:(r,o)=>ie(_t,{node:r,...e},o),table:(r,o)=>ie(Vt,{node:r,...e},o)})}import{ArrowUpOutlined as Rn,ArrowDownOutlined as Tn,MinusOutlined as Fn}from"@ant-design/icons";import An from"react-countup";import{jsx as Z,jsxs as Fe}from"react/jsx-runtime";var Ht=(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?Rn:r?Fn:Tn;return Fe("div",{className:`flex items-center px-2 py-0.5 rounded-full ${o} text-[11px] font-bold border border-current/10 transition-all shadow-sm`,children:[Z("span",{className:"opacity-70 mr-1",children:e}),Z(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},In=t=>{let{value:e,wow:n,yoy:r,unit:o="",prefix:a="",footer:s,precision:i}=t;return Fe("div",{className:"flex flex-col",children:[Fe("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:[Z("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),Z(An,{end:Number(e)||0,decimals:i,separator:",",duration:2.5}),Z("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),Fe("div",{className:"flex space-x-2 mt-2",children:[Ht(n,"\u73AF\u6BD4"),Ht(r,"\u540C\u6BD4")]}),s&&Z("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-[10px] text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},Kt=C(In,{schema:ve,getTitle:t=>t.title||t.label,skeleton:{rows:2}});import{useState as On}from"react";import{Row as En,Col as jn}from"antd";import{Line as $n}from"@ant-design/plots";import{jsx as W,jsxs as Ge}from"react/jsx-runtime";var Bn=({item:t})=>{let[e,n]=On(!1),{label:r,value:o,wow:a,trendData:s=[]}=t,c={data:s.map((l,m)=>({index:m,value:l})),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 Ge("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:[W("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),Ge("div",{className:"relative z-10",children:[W("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:r}),Ge("div",{className:"flex items-end justify-between flex-wrap",children:[W("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&W("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&&W("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:W($n,{...c})})]})},Dn=t=>{let{items:e=[]}=t,n=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return W(En,{gutter:[16,16],children:e.map((r,o)=>W(jn,{span:n,children:W(Bn,{item:r})},o))})},Jt=C(Dn,{schema:we,skeleton:{rows:2}});import Ze from"react";import{Table as Wn}from"antd";import{CSVLink as qn}from"react-csv";import{DownloadOutlined as _n}from"@ant-design/icons";import{jsx as se,jsxs as Ut}from"react/jsx-runtime";var zn=t=>{let{title:e,columns:n=[],rows:r=[],dataSource:o=[]}=t,a=o.length>0?o:r,s=Ze.useMemo(()=>a.map((l,m)=>({...l,__xcml_row_key:l.__xcml_key||l.id||`row-${m}`})),[a]),i=Ze.useMemo(()=>n.map(l=>({...l,dataIndex:l.key||l.dataIndex,title:l.title,ellipsis:!1,className:"whitespace-normal break-words",render:m=>se("div",{className:"whitespace-normal break-words",children:m})})),[n]),c=Ze.useMemo(()=>i.map(l=>({label:l.title,key:l.dataIndex})),[i]);return Ut("div",{className:"flex flex-col",children:[se("div",{className:"flex justify-end mb-2",children:Ut(qn,{data:s,headers:c,filename:`${e||"snapshot"}.csv`,className:"inline-flex items-center px-3 py-1 text-sm font-medium rounded border border-border bg-card text-card-foreground hover:bg-muted transition-colors",children:[se(_n,{className:"mr-1"})," \u5BFC\u51FACSV"]})}),se("div",{className:"text-foreground",children:se(Wn,{columns:i,dataSource:s,rowKey:"__xcml_row_key",pagination:{pageSize:5},scroll:{y:300,x:"100%"},className:"w-full [&_.ant-table]:!w-full [&_.ant-table-container]:!w-full",bordered:!0,size:"small",rowClassName:(l,m)=>m%2!==0?"bg-muted/20":"hover:bg-muted/30 transition-colors"})})]})},Yt=C(zn,{schema:Me,skeleton:{rows:5}});import{Tag as Vn,Typography as Hn,Button as Kn}from"antd";import Jn from"react-highlight-words";import{LinkOutlined as Un,ThunderboltOutlined as Yn}from"@ant-design/icons";import{jsx as q,jsxs as Ae}from"react/jsx-runtime";var{Title:Dl}=Hn,Gt={positive:"\u{1F4C8}",negative:"\u{1F4C9}",neutral:"\u{1F610}",insight:"\u{1F4A1}",warning:"\u26A0\uFE0F",success:"\u2705",error:"\u274C",insight_pro:"\u{1F48E}"},Gn={positive:"text-green-500",negative:"text-red-500",warning:"text-amber-500",error:"text-red-600",success:"text-green-600",insight:"text-indigo-500"},Zn=t=>{let{content:e="",highlights:n=[],sentiment:r="insight",citations:o=[],actions:a=[]}=t,s=J(n),i=J(o),c=J(a),l=m=>{ke.emit("action_click",{action:m,source:"insight_card"})};return Ae("div",{className:"space-y-4",children:[Ae("div",{className:"flex items-center gap-3",children:[q("div",{className:"text-xl shrink-0",children:Gt[r]||"\u{1F4A1}"}),q("div",{className:`text-base leading-normal whitespace-pre-wrap ${Gn[r]||"text-foreground"}`,children:q(Jn,{highlightClassName:"bg-primary/15 text-primary font-bold px-1 rounded-md mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})})]}),i.length>0&&q("div",{className:"pt-2 border-t border-dashed border-border flex flex-wrap gap-2",children:i.map((m,d)=>q(Vn,{icon:q(Un,{}),className:"m-0 bg-secondary/50 border-none rounded px-2 py-0.5 text-xs",children:m},d))}),c.length>0&&Ae("div",{className:"space-y-2",children:[Ae("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-1.5",children:[q(Yn,{className:"text-amber-500"}),"\u5EFA\u8BAE\u884C\u52A8"]}),q("div",{className:"flex flex-wrap gap-2",children:c.map((m,d)=>q(Kn,{size:"small",className:"text-xs h-7 px-3 rounded-full hover:border-primary hover:text-primary transition-all",onClick:()=>l(m),children:m},d))})]})]})},Zt=C(Zn,{schema:xe,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>t.icon||Gt[t.sentiment]||"\u{1F4A1}",skeleton:{rows:4}});import{useRef as Qn,useState as eo}from"react";import{Button as to,QRCode as ro,Select as no,Space as oo}from"antd";import{DownloadOutlined as ao,BgColorsOutlined as io}from"@ant-design/icons";import so from"html2canvas";import{Column as lo,Line as co,Pie as mo}from"@ant-design/plots";import{jsx as R,jsxs as _}from"react/jsx-runtime";var Ie=[{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"}],po=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:n="Data Insight Poster",charts:r=[],qrCode:o="https://ant.design",author:a="ChatBI",date:s=new Date().toLocaleDateString(),backgroundImage:i,themeColor:c}=t,l=typeof i=="string"?i.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,m=Qn(null),[d,p]=eo(Ie[0]),h=c||d.value,x=c?`${c}10`:d.bg,u=async()=>{if(m.current)try{let f=(await so(m.current,{useCORS:!0,scale:2,backgroundColor:d.bg})).toDataURL("image/png"),b=document.createElement("a");b.href=f,b.download=`poster-${Date.now()}.png`,b.click()}catch(y){console.error("Poster generation failed",y)}},g=(y,f)=>{let b={data:y.data,height:200,autoFit:!0};return y.type==="column"||y.type==="bar"?R(lo,{...b,xField:"label",yField:"value"},f):y.type==="line"?R(co,{...b,xField:"label",yField:"value"},f):y.type==="pie"?R(mo,{...b,angleField:"value",colorField:"label"},f):null};return _("div",{className:"flex flex-col",children:[_("div",{className:"flex justify-between items-center mb-4",children:[R(oo,{children:R(no,{value:d.value,onChange:y=>p(Ie.find(f=>f.value===y)||Ie[0]),options:Ie,style:{width:120},suffixIcon:R(io,{})})}),R(to,{type:"primary",icon:R(ao,{}),onClick:u,children:"\u751F\u6210\u6D77\u62A5"})]}),R("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:_("div",{ref:m,className:"p-8 w-full mx-auto transition-colors duration-300 flex flex-col shrink-0",style:{backgroundColor:x,backgroundImage:l?`url(${l})`:void 0,backgroundSize:"cover",backgroundPosition:"center",color:"#333",minHeight:"100%"},children:[_("div",{className:"mb-6 text-center",children:[R("h1",{className:"text-2xl font-bold mb-2",style:{color:h},children:e}),R("p",{className:"text-sm opacity-70",children:n})]}),R("div",{className:"space-y-6 mb-8",children:r.map((y,f)=>_("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[R("h4",{className:"font-medium mb-2 text-center",children:y.title}),g(y,f)]},f))}),_("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[_("div",{className:"text-xs text-muted-foreground",children:[_("p",{children:["Created by ",a]}),R("p",{children:s})]}),R("div",{className:"bg-white p-1 rounded",children:R(ro,{value:o,size:64,bordered:!1})})]})]})})]})},Qt=C(po,{schema:Se,skeleton:{rows:4}});import{Tag as uo,Typography as yo}from"antd";import{CheckCircleFilled as go,CloseCircleFilled as fo,LoadingOutlined as ho,ClockCircleFilled as bo}from"@ant-design/icons";import{jsx as F,jsxs as V}from"react/jsx-runtime";var{Text:xo}=yo,Co=t=>{switch(t){case"success":return F(go,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return F(fo,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return F(ho,{className:"text-primary bg-card rounded-full relative z-10"});default:return F(bo,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},vo=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},wo=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},So=t=>{let{steps:e=[]}=t;return V("div",{className:"relative pl-2 py-2",children:[F("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)=>V("div",{className:"relative flex mb-6 last:mb-0 group",children:[F("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:Co(n.status)}),V("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:[V("div",{className:"flex items-center justify-between mb-2",children:[V("div",{className:"flex items-center gap-2",children:[F("span",{className:"font-bold text-sm text-foreground",children:n.tool||`\u6B65\u9AA4 ${r+1}`}),F(xo,{type:"secondary",className:"text-xs text-muted-foreground",children:n.action})]}),V("div",{className:"flex items-center gap-2",children:[n.duration&&F("span",{className:"text-[10px] font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:n.duration}),F(uo,{color:wo(n.status),variant:"filled",className:"mr-0 text-[10px] px-1.5 rounded-full border-none",children:vo(n.status)})]})]}),n.thought&&F("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&&F("div",{className:"mt-2 text-xs",children:F("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:F("pre",{className:"m-0 whitespace-pre-wrap font-mono text-[11px] text-muted-foreground leading-relaxed",children:typeof n.result=="string"?n.result:JSON.stringify(n.result,null,2)})})}),n.error&&V("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))]})},er=C(So,{schema:Ne,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});import{useState as tr,useEffect as Mo}from"react";import{Button as Qe,App as No,InputNumber as Lo}from"antd";import{PlusOutlined as ko,MinusOutlined as Po,SaveOutlined as Xo,LoadingOutlined as Ro}from"@ant-design/icons";import To from"react-highlight-words";import{jsx as I,jsxs as le}from"react/jsx-runtime";var Fo=t=>{let{message:e}=No.useApp(),{label:n="\u62A5\u544A\u6458\u8981",value:r=0,step:o=1,unit:a="",actionId:s="update_summary",content:i="",highlightKeywords:c=[]}=t,[l,m]=tr(Number(r)||0),[d,p]=tr(!1);Mo(()=>{m(Number(r)||0)},[r]);let h=J(c),x=g=>{m(g)};return le("div",{className:"flex flex-col",children:[i&&I("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:I(To,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:h,autoEscape:!0,textToHighlight:i})}),le("div",{className:"flex items-center justify-between",children:[le("div",{children:[I("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:n}),le("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[l,I("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),le("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[I(Qe,{icon:I(Po,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>x(l-Number(o)),disabled:d}),I(Lo,{value:l,onChange:g=>x(Number(g)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:d}),I(Qe,{icon:I(ko,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>x(l+Number(o)),disabled:d}),I("div",{className:"w-px h-4 bg-border/50 mx-1"}),I(Qe,{type:"primary",size:"small",shape:"round",icon:d?I(Ro,{}):I(Xo,{}),onClick:async()=>{p(!0);try{ke.emit("action",{type:s,payload:{value:l,label:n,...t}}),await new Promise(g=>setTimeout(g,800)),e.success(`\u5DF2\u66F4\u65B0 ${n} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{p(!1)}},loading:d,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},rr=C(Fo,{schema:Ce,getTitle:t=>t.label,skeleton:{rows:2}});import{jsx as H}from"react/jsx-runtime";function Sc(t){let e=t?.theme?{"data-theme":t.theme}:{};return U({metric:(o,a)=>H(Kt,{node:o,...e},a),"mini-kpi":(o,a)=>H(Jt,{node:o,...e},a),snapshot:(o,a)=>H(Yt,{node:o,...e},a),insight:(o,a)=>H(Zt,{node:o,...e},a),"poster-card":(o,a)=>H(Qt,{node:o,...e},a),thought:(o,a)=>H(er,{node:o,...e},a),summary:(o,a)=>H(rr,{node:o,...e},a)},{metric:["metric-card"],"mini-kpi":["mini-kpi-strip"],snapshot:["snapshot-table","table-snapshot"],insight:["insight-card"],"poster-card":["poster"],thought:["thought-chain"],summary:["interactive-summary"]})}export{Te as AntVChartLoader,ir as COMMON_PROPS,It as DefaultEmptyPlaceholder,Ot as DefaultErrorPlaceholder,ni as ThemeProvider,Xe as XCMLCardWrapper,cs as XCMLChart,je as XCMLEventBus,xt as XCMLMarkdown,re as XCML_SCHEMAS,At as buildConfig,te as chartSchema,Ft as cleanPropsBySchema,ge as columnChartSchema,Lt as columnStrategy,bs as createAntVRenderers,sl as createBasicRenderers,Sc as createExtendedRenderers,U as createRenderersWithAliases,Pe as deepMerge,he as dualAxesChartSchema,Pt as dualAxesStrategy,ba as extractBaseStyles,be as funnelChartSchema,Xt as funnelStrategy,Rt as getChartStrategy,Mt as getTheme,ye as lineChartSchema,Nt as lineStrategy,lt as mergePropsAndBody,st as normalizeNodeData,$e as normalizeTagName,Ia as parse,J as parseArrayProp,mr as parseInlineData,Ta as parseXCML,fe as pieChartSchema,kt as pieStrategy,dt as preprocessXCML,wa as renderXCML,Hr as strategies,Oa as stringify,Ra as stringifyToXCML,Ir as themeDark,He as themeLight,Or as themeMap,Be as toXCMLNodeFromElement,Le as toXCMLTag,lr as toXTag,St as useTheme,it as useXCMLComponent,at as useXCMLNode,Xa as validateDataSchema,Sa as validateXCMLNode,C as withXCMLCard,ke as xcmlBus};
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
30
|
+
`:""}</${e}>`},[e,n]);return Nt("div",{className:Je("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&&P(Tr,{title:"\u67E5\u770B\u6E90\u7801",children:P(kr,{icon:P(Rr,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:m})}),P(Pr,{open:s,onCancel:()=>d(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:P("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:p})})]})}var He=new WeakMap;function Ke(t){if(!t)return"";if(He.has(t))return He.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 He.set(t,r),r}var Ar=F.memo(({code:t,theme:e,id:n})=>{let r=F.useRef(null);return F.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]),P("div",{ref:r,className:"mermaid w-full flex justify-center my-4"})});import dn,{useMemo as Qe,Suspense as mn,forwardRef as pn}from"react";import*as un from"@ant-design/plots";import{Skeleton as Dt}from"@chatbi-v/ui-shell";import{createContext as _r,useContext as Or,useEffect as $r,useState as Ir,useMemo as Er,useRef as jr}from"react";import{XProvider as Br}from"@chatbi-v/ui-shell";import{theme as Mt}from"@chatbi-v/ui-shell";import{jsx as Ue}from"react/jsx-runtime";var Dr={theme:"light",setTheme:()=>null},Lt=_r(Dr);function Li({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]=Ir(()=>localStorage.getItem(o)||e),c=n??m,l=jr(null);$r(()=>{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),T=parseInt(g.substring(4,6),16);y.style.setProperty("--primary-rgb",`${f}, ${x}, ${T}`);let L=f/255,S=x/255,M=T/255,v=Math.max(L,S,M),X=Math.min(L,S,M),$=0,H=0,I=(v+X)/2;if(v!==X){let j=v-X;switch(H=I>.5?j/(2-v-X):j/(v+X),v){case L:$=(S-M)/j+(S<M?6:0);break;case S:$=(M-L)/j+2;break;case M:$=(L-S)/j+4;break}$/=6}let k=`${Math.round($*360)} ${Math.round(H*100)}% ${Math.round(I*100)}%`;y.style.setProperty("--primary",k)}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=Er(()=>({algorithm:c==="dark"||c==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?Mt.darkAlgorithm:Mt.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 Ue(Lt.Provider,{value:u,...d,children:Ue(Br,{theme:b,children:Ue("div",{ref:l,className:`xcml-scope text-inherit bg-inherit ${i||""}`,style:s,children:t})})})}var Ae=()=>{let t=Or(Lt);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var Wr={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},qr={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]}}}},Ye={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:Wr},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"}}}}}}},zr={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:qr},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)"}}}}},Vr={light:Ye,dark:zr,default:Ye};function kt(t){return Vr[t||"default"]||Ye}import Hr from"react";var Kr=Hr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Pt={type:"line",schema:Ce,getComponent:()=>Kr,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};import Jr from"react";var Gr=Jr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Tt={type:"column",schema:ve,getComponent:()=>Gr,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}};import Ur from"react";var Yr=Ur.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),Rt={type:"pie",schema:we,getComponent:()=>Yr,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}};import Zr from"react";var Qr=Zr.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),Xt={type:"dual-axes",schema:Se,getComponent:()=>Qr,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}};import en from"react";var tn=en.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Ft={type:"funnel",schema:Ne,getComponent:()=>tn,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 rn={line:Pt,column:Tt,pie:Rt,"dual-axes":Xt,funnel:Ft};function At(t){return t&&rn[t.toLowerCase()]||null}import nn from"react";import{Empty as _t,Button as on,Result as an}from"@chatbi-v/ui-shell";import{jsx as de}from"react/jsx-runtime";function _e(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&&!nn.isValidElement(o)?n[r]=_e(a,o):n[r]=o}return n}function Ot(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]=_e(o.default,n[a])),o.transform){let i=n[a];n[a]=o.transform(i,n)}}),n)}function $t(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=_e(_e(s,i),a||{});return d.seriesField&&!d.colorField&&(d.colorField=d.seriesField),d.__native__={...d},d}var It=()=>de("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:de(_t,{image:_t.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),Et=({error:t,reset:e})=>de("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:de(an,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[de(on,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});import ln from"react";import{Skeleton as cn}from"@chatbi-v/ui-shell";import{clsx as jt}from"clsx";import{twMerge as sn}from"tailwind-merge";import{jsx as me,jsxs as Ze}from"react/jsx-runtime";var Oe=({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:T,prefix:L,wow:S,yoy:M,sentiment:v,highlights:X,citations:$,actions:H,steps:I,columns:k,rows:j,charts:R,data:at,subTitle:ae,themeColor:Be,backgroundImage:it,qrCode:st,author:Zo,date:Qo,...mr})=>{let{theme:pr}=Ae(),Z=a==="plain",ur=i??c?.props?.theme??c?.data?.theme??pr,yr=sn(jt("xcml-card not-prose max-w-full min-w-0 group",Z?"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&&!Z?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return Ze("div",{className:yr,"data-theme":ur,...mr,children:[t&&Ze("div",{className:"relative mb-3",children:[!Z&&me("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"}),me("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:Ze("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!Z&&me("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!Z&&e&&me("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]})})]}),me("div",{className:jt("xcml-card-body",!Z&&"mt-0.5"),children:n})]})};import{jsx as $e}from"react/jsx-runtime";function w(t,e={}){let{schema:n,getTitle:r,getIcon:o,getVariant:a,renderLoading:i,skeleton:s=!0}=e,d=ln.forwardRef((p,c)=>{let{merged:l,baseProps:u,isLoading:b,streamStatus:y}=mt(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 T=o?o(l):l.icon,L=a?a(l):u.variant||"card",S=l.hoverable!==void 0?l.hoverable:!0,M={title:x,icon:T,variant:L,hoverable:S,className:h,node:p.node,streamStatus:y,...g};return b?$e(Oe,{...M,children:i?i(l):s?$e(cn,{active:!0,paragraph:{rows:typeof s=="object"?s.rows:2}}):null}):$e(Oe,{...M,children:$e(t,{...l,ref:c})})}),m=t.displayName||t.name||"Component";return d.displayName=`withXCMLCard(${m})`,d}import{jsx as W,jsxs as hn}from"react/jsx-runtime";import{createElement as bn}from"react";var yn=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),Bt={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},gn=t=>{if(!t)return null;let e=Bt[t.toLowerCase()]||Bt[t],n=un;if(e&&e in n)return n[e];let r=yn(t);return r&&r in n?n[r]:t in n?n[t]:null},et=class extends dn.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):W(Et,{error:this.state.error,reset:this.reset}):this.props.children}},fn=pn((t,e)=>{let{type:n="line",node:r,theme:o,...a}=t,{theme:i}=Ae(),s=Qe(()=>At(n),[n]),d=Qe(()=>s?.getComponent()||gn(n),[s,n]),m=Qe(()=>{let u=t.theme||o||i||"light",y=["dark","black","midnight","slate","crimson"].includes(u)?"dark":"light",h=kt(y),g=t.data,f={...t,theme:h,data:g},x=Ot(f,s?.schema||ie),T=s?.transformProps?s.transformProps(x):x;return $t(T)},[t,o,i,s]);if(!d)return hn("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?W(et,{type:n,errorPlaceholder:m.errorPlaceholder,children:W(mn,{fallback:W(Dt,{active:!0}),children:W("div",{className:"",children:bn(d,{...m,ref:e,key:n})})})}):W(It,{})}),Ie=w(fn,{schema:ie,renderLoading:t=>{let e=t.height||300;return W("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:W(Dt.Image,{active:!0})})}}),As=t=>{let{node:e,...n}=t;if(e)return W(Ie,{node:e});let r={props:{},body:{...n,data:t.data}};return W(Ie,{node:r})};import{jsx as xn}from"react/jsx-runtime";function Ws(t){let e=t?.theme;return ee({chart:(r,o)=>xn(Ie,{node:r,theme:e,className:r.props?.className},o)})}import{useMemo as Wt}from"react";import{ArrowUpOutlined as Cn,ArrowDownOutlined as vn}from"@ant-design/icons";import{jsx as _,jsxs as K}from"react/jsx-runtime";var qt=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),wn=({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 _("div",{className:`relative group/sparkline ${e}`,children:K("svg",{width:a,height:i,className:"overflow-visible",children:[_("defs",{children:K("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[_("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),_("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),_("path",{d:m,fill:`url(#${p})`}),_("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),_("circle",{cx:s[s.length-1].x,cy:s[s.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},Sn=t=>{let{precision:e=0,layout:n="vertical",footer:r,value:o,note:a,trend:i,trendValue:s}=t,d=Wt(()=>{if(s==null)return null;if(typeof s=="number"){let b=Math.abs(s)>=1e4?qt(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=Wt(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?qt(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 K("div",{className:"flex flex-col h-full justify-between",children:[K("div",{className:`flex ${n==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[K("div",{className:"flex flex-col min-w-0",children:[K("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[_("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),d&&K("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&&_(Cn,{className:"mr-1 text-xs"}),c&&_(vn,{className:"mr-1 text-xs"}),_("span",{className:"tabular-nums",children:d})]})]}),a&&_("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),l&&_("div",{className:"shrink-0 mb-1",children:_(wn,{data:i,className:p?"text-success":c?"text-destructive":"text-primary"})})]}),r&&K("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[_("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:r}),_("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},zt=w(Sn,{schema:ge,skeleton:{rows:1}});import{jsx as te,jsxs as Mn}from"react/jsx-runtime";var Nn=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 Mn("div",{className:"flex flex-col gap-4",children:[i&&te("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:te(Ge,{content:e})}),te("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:s?te(Ge,{content:s}):!i&&te("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:te("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},Vt=w(Nn,{schema:be,skeleton:{rows:2}});import{CheckCircleOutlined as Ln,MinusCircleOutlined as kn,BorderOutlined as Pn}from"@ant-design/icons";import{Fragment as Xn,jsx as B,jsxs as re}from"react/jsx-runtime";var Tn=({item:t,layout:e,index:n,stripe:r})=>{let{title:o,desc:a,value:i,status:s,type:d="text"}=t;return d==="metric"?re("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:[B("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),B("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:i}),a&&B("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):re("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:[re("div",{className:"mt-1",children:[s==="done"&&B(Ln,{className:"text-success"}),s==="doing"&&B(kn,{className:"text-primary animate-pulse"}),s==="todo"&&B(Pn,{className:"text-muted-foreground/30"}),!s&&B("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})]}),re("div",{className:"flex-1 min-w-0",children:[B("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&B("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},Rn=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 re(Xn,{children:[e&&B("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),re("div",{className:d?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((c,l)=>B(Tn,{item:{type:i,...c},layout:r,index:l,stripe:s&&l%2===1},l)),a.length===0&&B("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),n&&B("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:n})]})},Ht=w(Rn,{schema:he,skeleton:{rows:3}});import Fn from"react";import{jsx as pe}from"react/jsx-runtime";var An=()=>{let{items:t}=wt(),e=Fn.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 pe("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?pe("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):pe("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>pe("li",{className:`mb-2 text-sm leading-relaxed relative ${r(o.level)}`,children:pe("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))})})},Kt=w(An,{schema:xe,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});import{useMemo as _n}from"react";import{Badge as On,Tooltip as $n,Table as ne,Progress as In}from"@chatbi-v/ui-shell";import{InfoCircleOutlined as Jt}from"@ant-design/icons";import{jsx as N,jsxs as J}from"react/jsx-runtime";var En=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return N("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 N("div",{className:e||"text-primary",children:J("svg",{width:a,height:i,className:"overflow-visible",children:[N("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),N("circle",{cx:s[s.length-1].x,cy:s[s.length-1].y,r:"2",fill:"currentColor"})]})})},jn=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=_n(()=>o.map(c=>({title:J("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[N("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:c.title}),c.desc&&N($n,{title:c.desc,children:N(Jt,{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"),N("div",{className:"flex items-center gap-2 min-w-24",children:N(In,{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 N(En,{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"),N(On,{status:u,text:N("span",{className:"text-xs",children:l})})}case"image":return N("img",{src:l,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return J("span",{className:"font-mono text-foreground/90 font-medium",children:[c.prefix,l?.toLocaleString?.()??l,c.suffix]});default:return J("span",{className:"text-foreground/90",children:[c.prefix,l,c.suffix]})}}})),[o]);return J("div",{className:"w-full xcml-table-container",children:[N(ne,{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:N(ne.Summary,{fixed:!0,children:N(ne.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((l,u)=>{if(u===0)return N(ne.Summary.Cell,{index:0,children:N("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(l.type==="number"||["amount","value","sales","total"].includes(l.key)))return N(ne.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 N(ne.Summary.Cell,{index:u,align:l.align,children:J("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:J("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[N("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:N(Jt,{className:"text-xl opacity-20"})}),N("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!r&&d&&J("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",s.length," rows"]})]})},Gt=w(jn,{schema:fe,skeleton:{rows:4}});import{jsx as ue}from"react/jsx-runtime";function Xl(t){let e=t?.theme?{"data-theme":t.theme}:{};return ee({metric:(r,o)=>ue(zt,{node:r,...e},o),card:(r,o)=>ue(Vt,{node:r,...e},o),list:(r,o)=>ue(Ht,{node:r,...e},o),toc:(r,o)=>ue(Kt,{node:r,...e},o),table:(r,o)=>ue(Gt,{node:r,...e},o)})}import{ArrowUpOutlined as Bn,ArrowDownOutlined as Dn,MinusOutlined as Wn}from"@ant-design/icons";import qn from"react-countup";import{jsx as oe,jsxs as Ee}from"react/jsx-runtime";var Ut=(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?Bn:r?Wn:Dn;return Ee("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:[oe("span",{className:"opacity-70 mr-1",children:e}),oe(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},zn=t=>{let{value:e,wow:n,yoy:r,unit:o="",prefix:a="",footer:i,precision:s}=t;return Ee("div",{className:"flex flex-col",children:[Ee("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:[oe("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),oe(qn,{end:Number(e)||0,decimals:s,separator:",",duration:2.5}),oe("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),Ee("div",{className:"flex space-x-2 mt-2",children:[Ut(n,"\u73AF\u6BD4"),Ut(r,"\u540C\u6BD4")]}),i&&oe("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})]})},Yt=w(zn,{schema:ke,getTitle:t=>t.title||t.label,skeleton:{rows:2}});import{useState as Vn}from"react";import{Row as Hn,Col as Kn}from"@chatbi-v/ui-shell";import{Line as Jn}from"@ant-design/plots";import{jsx as z,jsxs as tt}from"react/jsx-runtime";var Gn=({item:t})=>{let[e,n]=Vn(!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 tt("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:[z("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),tt("div",{className:"relative z-10",children:[z("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:r}),tt("div",{className:"flex items-end justify-between flex-wrap",children:[z("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&z("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&&z("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:z(Jn,{...d})})]})},Un=t=>{let{items:e=[]}=t,n=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return z(Hn,{gutter:[16,16],children:e.map((r,o)=>z(Kn,{span:n,children:z(Gn,{item:r})},o))})},Zt=w(Un,{schema:Pe,skeleton:{rows:2}});import{useMemo as rt}from"react";import{Table as Yn,Button as Zn,Tooltip as Qn,Empty as Qt}from"@chatbi-v/ui-shell";import{CSVLink as eo}from"react-csv";import{DownloadOutlined as to,TableOutlined as ro,InfoCircleOutlined as no}from"@ant-design/icons";import{jsx as A,jsxs as V}from"react/jsx-runtime";var oo=t=>{let{title:e,description:n,bordered:r=!0,columns:o=[],rows:a=[],dataSource:i=[]}=t,s=i.length>0?i:a,d=rt(()=>s.map((l,u)=>({...l,__xcml_row_key:l.__xcml_key||l.id||`row-${u}`})),[s]),m=rt(()=>o.map(l=>({...l,dataIndex:l.key||l.dataIndex,title:V("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[A("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:l.title}),l.desc&&A(Qn,{title:l.desc,children:A(no,{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 A("span",{className:"text-muted-foreground/30 italic",children:"-"});let b=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return A("div",{className:`whitespace-normal break-words ${b?"font-mono":""}`,children:b?u.toLocaleString():u})}})),[o]),p=rt(()=>o.map(l=>({label:l.title,key:l.key||l.dataIndex})),[o]),c=d.length>0;return V("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(n||c)&&V("div",{className:"flex items-center justify-between px-1",children:[V("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&V("div",{className:"flex items-center gap-2",children:[A("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:A(ro,{className:"text-sm"})}),A("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),n&&A("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:n})]}),c&&A(eo,{data:d,headers:p,filename:`${e||"snapshot"}.csv`,children:A(Zn,{size:"small",icon:A(to,{}),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"})})]}),V("div",{className:"relative group",children:[A(Yn,{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:A(Qt,{image:Qt.PRESENTED_IMAGE_SIMPLE,description:A("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),A("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&&V("div",{className:"flex items-center justify-between px-1 mt-1",children:[V("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[A("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",d.length," \u6761\u8BB0\u5F55"]}),V("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},er=w(oo,{schema:Re,skeleton:{rows:5}});import ao from"react";import{Button as nt,Tooltip as tr}from"@chatbi-v/ui-shell";import{clsx as rr}from"clsx";import{twMerge as io}from"tailwind-merge";import so from"react-highlight-words";import{LinkOutlined as lo,ThunderboltOutlined as nr,LikeOutlined as co,DislikeOutlined as mo,InfoCircleOutlined as po,CheckCircleOutlined as uo,CloseCircleOutlined as yo,WarningOutlined as go,BulbOutlined as ar,RiseOutlined as fo,FallOutlined as ho}from"@ant-design/icons";import{jsx as C,jsxs as q}from"react/jsx-runtime";var or={positive:{icon:C(fo,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:C(ho,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:C(go,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:C(yo,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:C(uo,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:C(ar,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:C(po,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},bo=t=>{let{content:e="",highlights:n=[],sentiment:r="insight",citations:o=[],actions:a=[]}=t,i=Q(n),s=Q(o),d=Q(a),m=or[r]||or.insight,p=l=>{le.emit("action_click",{action:l,source:"insight_card"})},c=l=>{le.emit("feedback",{type:l,source:"insight_card",content:e})};return q("div",{className:"flex flex-col gap-5",children:[q("div",{className:io("relative overflow-hidden rounded-2xl border transition-all duration-300",m.bg,m.border,"p-5 shadow-sm hover:shadow-md"),children:[C("div",{className:"absolute -right-4 -top-4 w-24 h-24 blur-3xl opacity-20 bg-current pointer-events-none"}),q("div",{className:"relative flex gap-4",children:[C("div",{className:rr("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:ao.cloneElement(m.icon,{className:"text-lg"})}),q("div",{className:"flex-1 space-y-3",children:[q("div",{className:"flex items-center justify-between",children:[C("span",{className:rr("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),q("div",{className:"flex items-center gap-1",children:[C(tr,{title:"\u6709\u5E2E\u52A9",children:C(nt,{type:"text",size:"small",icon:C(co,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("up")})}),C(tr,{title:"\u65E0\u5E2E\u52A9",children:C(nt,{type:"text",size:"small",icon:C(mo,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("down")})})]})]}),C("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:C(so,{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&&C("div",{className:"flex flex-wrap gap-2 pt-2",children:s.map((l,u)=>q("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:[C(lo,{className:"text-xs"}),l]},u))})]})]})]}),d.length>0&&q("div",{className:"space-y-3 px-1",children:[q("div",{className:"flex items-center gap-2 text-xs font-bold text-foreground/40 uppercase tracking-widest",children:[C("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-border/50"}),C(nr,{className:"text-amber-500"}),C("span",{children:"\u4E0B\u4E00\u6B65\u884C\u52A8\u5EFA\u8BAE"}),C("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-border/50"})]}),C("div",{className:"flex flex-wrap gap-2.5",children:d.map((l,u)=>C(nt,{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:q("div",{className:"flex items-center gap-2",children:[C("span",{className:"text-xs font-semibold text-foreground/80 group-hover:text-primary transition-colors",children:l}),C(nr,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},ir=w(bo,{schema:Me,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>C(ar,{}),getVariant:()=>"plain",skeleton:{rows:4}});import{useRef as xo,useState as Co}from"react";import{Button as vo,QRCode as wo,Select as So,Space as No}from"@chatbi-v/ui-shell";import{DownloadOutlined as Mo,BgColorsOutlined as Lo}from"@ant-design/icons";import ko from"html2canvas";import{Column as Po,Line as To,Pie as Ro}from"@ant-design/plots";import{jsx as O,jsxs as G}from"react/jsx-runtime";var je=[{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"}],Xo=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=xo(null),[c,l]=Co(je[0]),u=d||c.value,b=d?`${d}10`:c.bg,y=async()=>{if(p.current)try{let f=(await ko(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"?O(Po,{...x,xField:"label",yField:"value"},f):g.type==="line"?O(To,{...x,xField:"label",yField:"value"},f):g.type==="pie"?O(Ro,{...x,angleField:"value",colorField:"label"},f):null};return G("div",{className:"flex flex-col",children:[G("div",{className:"flex justify-between items-center mb-4",children:[O(No,{children:O(So,{value:c.value,onChange:g=>l(je.find(f=>f.value===g)||je[0]),options:je,className:"w-32",suffixIcon:O(Lo,{})})}),O(vo,{type:"primary",icon:O(Mo,{}),onClick:y,children:"\u751F\u6210\u6D77\u62A5"})]}),O("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:G("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:[G("div",{className:"mb-6 text-center",children:[O("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),O("p",{className:"text-sm opacity-70",children:n})]}),O("div",{className:"space-y-6 mb-8",children:r.map((g,f)=>G("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[O("h4",{className:"font-medium mb-2 text-center",children:g.title}),h(g,f)]},f))}),G("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[G("div",{className:"text-xs text-muted-foreground",children:[G("p",{children:["Created by ",a]}),O("p",{children:i})]}),O("div",{className:"bg-white p-1 rounded",children:O(wo,{value:o,size:64,bordered:!1})})]})]})})]})},sr=w(Xo,{schema:Te,skeleton:{rows:4}});import{Tag as Fo,Typography as Ao}from"@chatbi-v/ui-shell";import{CheckCircleFilled as _o,CloseCircleFilled as Oo,LoadingOutlined as $o,ClockCircleFilled as Io}from"@ant-design/icons";import{jsx as E,jsxs as U}from"react/jsx-runtime";var{Text:Eo}=Ao,jo=t=>{switch(t){case"success":return E(_o,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return E(Oo,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return E($o,{className:"text-primary bg-card rounded-full relative z-10"});default:return E(Io,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},Bo=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},Do=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},Wo=t=>{let{steps:e=[]}=t;return U("div",{className:"relative pl-2 py-2",children:[E("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)=>U("div",{className:"relative flex mb-6 last:mb-0 group",children:[E("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:jo(n.status)}),U("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:[U("div",{className:"flex items-center justify-between mb-2",children:[U("div",{className:"flex items-center gap-2",children:[E("span",{className:"font-bold text-sm text-foreground",children:n.tool||`\u6B65\u9AA4 ${r+1}`}),E(Eo,{type:"secondary",className:"text-xs text-muted-foreground",children:n.action})]}),U("div",{className:"flex items-center gap-2",children:[n.duration&&E("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:n.duration}),E(Fo,{color:Do(n.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:Bo(n.status)})]})]}),n.thought&&E("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&&E("div",{className:"mt-2 text-xs",children:E("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:E("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&&U("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))]})},lr=w(Wo,{schema:Xe,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});import{useState as cr,useEffect as qo}from"react";import{Button as ot,App as zo,InputNumber as Vo}from"@chatbi-v/ui-shell";import{PlusOutlined as Ho,MinusOutlined as Ko,SaveOutlined as Jo,LoadingOutlined as Go}from"@ant-design/icons";import Uo from"react-highlight-words";import{jsx as D,jsxs as ye}from"react/jsx-runtime";var Yo=t=>{let{message:e}=zo.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]=cr(Number(r)||0),[c,l]=cr(!1);qo(()=>{p(Number(r)||0)},[r]);let u=Q(d),b=h=>{p(h)};return ye("div",{className:"flex flex-col",children:[s&&D("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:D(Uo,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:s})}),ye("div",{className:"flex items-center justify-between",children:[ye("div",{children:[D("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:n}),ye("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,D("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),ye("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[D(ot,{icon:D(Ko,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>b(m-Number(o)),disabled:c}),D(Vo,{value:m,onChange:h=>b(Number(h)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:c}),D(ot,{icon:D(Ho,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>b(m+Number(o)),disabled:c}),D("div",{className:"w-px h-4 bg-border/50 mx-1"}),D(ot,{type:"primary",size:"small",shape:"round",icon:c?D(Go,{}):D(Jo,{}),onClick:async()=>{l(!0);try{le.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"})]})]})]})},dr=w(Yo,{schema:Le,getTitle:t=>t.label,skeleton:{rows:2}});import{jsx as Y}from"react/jsx-runtime";function Qc(t){let e=t?.theme?{"data-theme":t.theme}:{};return ee({"metric-card":(o,a)=>Y(Yt,{node:o,...e},a),"mini-kpi-strip":(o,a)=>Y(Zt,{node:o,...e},a),"snapshot-table":(o,a)=>Y(er,{node:o,...e},a),"insight-card":(o,a)=>Y(ir,{node:o,...e},a),"poster-card":(o,a)=>Y(sr,{node:o,...e},a),"thought-chain":(o,a)=>Y(lr,{node:o,...e},a),"interactive-summary":(o,a)=>Y(dr,{node:o,...e},a)},{})}export{Ie as AntVChartLoader,gr as COMMON_PROPS,It as DefaultEmptyPlaceholder,Et as DefaultErrorPlaceholder,Li as ThemeProvider,Oe as XCMLCardWrapper,As as XCMLChart,We as XCMLEventBus,Ge as XCMLMarkdown,se as XCML_SCHEMAS,$t as buildConfig,ie as chartSchema,Ot as cleanPropsBySchema,ve as columnChartSchema,Tt as columnStrategy,Ws as createAntVRenderers,Xl as createBasicRenderers,Qc as createExtendedRenderers,ee as createRenderersWithAliases,_e as deepMerge,Se as dualAxesChartSchema,Xt as dualAxesStrategy,Ia as extractBaseStyles,Ne as funnelChartSchema,Ft as funnelStrategy,At as getChartStrategy,kt as getTheme,Ce as lineChartSchema,Pt as lineStrategy,ut as mergePropsAndBody,pt as normalizeNodeData,qe as normalizeTagName,Qa as parse,Q as parseArrayProp,Cr as parseInlineData,Ua as parseXCML,we as pieChartSchema,Rt as pieStrategy,gt as preprocessXCML,Da as renderXCML,rn as strategies,ei as stringify,Ga as stringifyToXCML,zr as themeDark,Ye as themeLight,Vr as themeMap,ce as toXCMLNodeFromElement,Fe as toXCMLTag,hr as toXTag,Ae as useTheme,mt as useXCMLComponent,dt as useXCMLNode,Ja as validateDataSchema,Wa as validateXCMLNode,w as withXCMLCard,di as xTagPlugin,le as xcmlBus};
|