@chatbi-v/xcml 2.1.1 → 2.1.3

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.js CHANGED
@@ -1,30 +1,30 @@
1
- import{parse as qe}from"yaml";var he={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 be={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 xe={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 Ce={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 ve={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 we={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 Se={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 Me={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 Ne={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 Le={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 mt={line:we,column:Se,pie:Me,"dual-axes":Ne,funnel:Le};function pt(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 d=n.get(s.name);d?d.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 le={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"},...pt(mt,"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"},...pt(mt,"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 ke={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 Pe={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 Re={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 Te={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 Xe={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 Fe={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 Ae={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 Mr=[{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}],Nr={"xcml:metric":he,"xcml:table":be,"xcml:chart":le,"xcml:list":xe,"xcml:thought-chain":Ae,"xcml:insight-card":ke,"xcml:metric-card":Re,"xcml:card":Ce,"xcml:toc":ve,"xcml:poster-card":Xe,"xcml:mini-kpi-strip":Te,"xcml:interactive-summary":Pe,"xcml:snapshot-table":Fe},ce=Object.fromEntries(Object.entries(Nr).map(([t,e])=>[t,{...e,props:[...e.props||[],...Mr]}]));import{parse as mi,stringify as pi}from"yaml";function Ga(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 ut(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(l){console.warn("[XCML] Failed to decode data-xcml-raw:",l)}if(typeof r=="string"){let l=r.trim();if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{r=JSON.parse(l)}catch{}}let a={};if(e&&((e.props||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)}),(e.body||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)})),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 l=(e?.body||[]).find(d=>d.type==="array")?.name||"data";a[l]=r}else{let l=e?.example?.contentProp||(e?.body||[]).find(d=>d.name==="content"||d.name==="value")?.name||"content";a[l]=r}return Object.assign(a,n),["theme","variant","layout","size"].forEach(l=>{a[l]===void 0&&n[l]!==void 0&&(a[l]=n[l])}),a}var re=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 ne(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 Qa=(t,e="xcml-node")=>{if(!t||!t.type||!ce[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function ei(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 yt(t,e){let{node:n,streamStatus:r}=t,o=ut(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,l={theme:o.theme,variant:o.variant,size:o.size,className:t.className,style:t.style,loading:s,streamStatus:a,error:t.error};return{merged:o,baseProps:l,isLoading:s,streamStatus:a}}function Ve(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Lr(t){return`x-${Ve(t)}`}function _e(t){return`xcml:${Ve(t)}`}var ze=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})}},de=new ze,kr=/\/\/(.*)$/gm,Pr=/\/\*[\s\S]*?\*\//g;function Rr(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(kr,"").replace(Pr,""):n;try{return JSON.parse(r)}catch(o){try{let a=qe(r);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return qe(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 l=s.split(r),d={};return a.forEach((m,p)=>{let c=l[p]?.trim();c==="true"?c=!0:c==="false"?c=!1:c!==""&&!isNaN(Number(c))&&(c=Number(c)),d[m]=c}),d})}return e==="ndjson"?n.split(/\r?\n/).filter(Boolean).map(r=>JSON.parse(r)):JSON.parse(n)}catch(r){throw r}}function ii(t,e){return e!=null}function gt(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let n=_e(t),r=ce[n];if(!r)return e;let o={...e};return[...r.props||[],...r.body||[]].forEach(s=>{let l=o[s.name];if((s.type==="object"||s.type==="array")&&typeof l=="string")try{let d=l.trim();if(d.startsWith("{")||d.startsWith("[")){let m=d,p=0;for(;typeof m=="string"&&p<2;){let c=JSON.parse(m);if(c===null||typeof c!="object")if(typeof c=="string"&&(c.startsWith("{")||c.startsWith("[")))m=c;else break;else{m=c;break}p++}o[s.name]=m}}catch{}}),o}function ft(t,e,n,r={}){let o=_e(t),a=ce[o],s={},l={},{preferBody:d=!1}=r,m=ht(n),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(x=>x.name==="content"||x.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(y=>{/^\d+$/.test(y)||(l[y]=p[y])});let c={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:n};let i=new Set((a.props||[]).map(y=>y.name)),u=new Set((a.body||[]).map(y=>y.name));for(let[y,x]of Object.entries(c))/^\d+$/.test(y)||(d?i.has(y)||u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x:i.has(y)?s[y]=x:u.has(y)?l[y]=x:y in e?s[y]=x:l[y]=x);let f=l;if(Array.isArray(m))if(Object.keys(l).length===0)f=m;else{let y=(a.body||[]).find(x=>x.type==="array")?.name||"data";l[y]=m,f=l}return{props:gt(o,s),body:gt(o,f)}}function ht(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 si(t){let e=_e(t.tag||t.type||"unknown"),n=Lr(e),r={...t.props||{}},o=ht(t.body),{body:a}=ft(e,r,o,{preferBody:!0}),s=[],l=a,d=Object.keys(a||{});d.length===1&&d[0]==="data"&&Array.isArray(a.data)&&(l=a.data);let m=s.length>0?" "+s.join(" "):"",p=JSON.stringify(l,null,2);return`<${n}${m}>
1
+ import{parse as He}from"yaml";var be={tag:"x-metric",title:"\u6307\u6807\u5361\u7247",description:"\u7528\u4E8E\u5C55\u793A\u5355\u4E00\u6838\u5FC3\u6570\u503C\u53CA\u5176\u8D8B\u52BF\u6216\u5907\u6CE8\u4FE1\u606F\uFF0C\u652F\u6301\u591A\u79CD\u5E03\u5C40\u548C\u6837\u5F0F\u53D8\u4F53\u3002",props:[{name:"title",type:"string",description:"\u6307\u6807\u540D\u79F0/\u6807\u9898",category:"required",required:!0},{name:"variant",type:"enum",description:"\u5C55\u793A\u53D8\u4F53\u6837\u5F0F",category:"style",options:["card","plain","compact"],default:"card"},{name:"layout",type:"enum",description:"\u5E03\u5C40\u65B9\u5411",category:"layout",options:["horizontal","vertical"],default:"vertical"},{name:"icon",type:"string",description:"\u88C5\u9970\u56FE\u6807 (Emoji)",category:"style"},{name:"precision",type:"number",description:"\u6570\u503C\u4FDD\u7559\u5C0F\u6570\u4F4D\u6570",category:"style",default:0}],body:[{name:"value",type:"string",description:"\u6307\u6807\u6570\u503C",category:"required",required:!0},{name:"trend",type:"enum",description:"\u8D8B\u52BF\u65B9\u5411",category:"optional",options:["up","down","none"]},{name:"trendValue",type:"string",description:"\u8D8B\u52BF\u503C",category:"optional"},{name:"note",type:"string",description:"\u6307\u6807\u5907\u6CE8",category:"optional"},{name:"footer",type:"string",description:"\u5E95\u90E8\u8F85\u52A9\u4FE1\u606F",category:"optional"}],example:{props:{title:"\u6708\u5EA6\u51C0\u9500\u552E\u989D",variant:"card",layout:"vertical",precision:0,icon:"\u{1F4B0}"},body:{value:"1280000",trend:"up",trendValue:"+12.5%",note:"\u8F83\u4E0A\u6708\u589E\u957F 12.5%"},contentProp:"value"}};var xe={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 Ce={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 ve={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 we={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 Se={tag:"x-line-chart",title:"\u6298\u7EBF\u56FE",description:"\u7528\u4E8E\u5C55\u793A\u8FDE\u7EED\u65F6\u95F4\u8DE8\u5EA6\u4E0B\u7684\u6570\u636E\u8D8B\u52BF\u3002",props:[],body:[{name:"data",type:"array",description:"\u6298\u7EBF\u56FE\u6570\u636E",required:!0},{name:"xField",type:"string",description:"x\u8F74\u5B57\u6BB5",default:"category",required:!0},{name:"yField",type:"string",description:"y\u8F74\u5B57\u6BB5",default:"value",required:!0},{name:"seriesField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",default:"type"}],example:{props:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF"},body:{title:"\u5404\u7C7B\u578B\u5546\u54C1\u9500\u552E\u8D8B\u52BF",xField:"category",yField:"value",seriesField:"type",data:[{category:"A",value:10,type:"T1"},{category:"B",value:20,type:"T1"}]}}};var Me={tag:"x-column-chart",title:"\u67F1\u72B6\u56FE",description:"\u7528\u4E8E\u6BD4\u8F83\u4E0D\u540C\u5206\u7C7B\u4E4B\u95F4\u7684\u6570\u636E\u5DEE\u5F02\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5 (\u5206\u7C7B)",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5 (\u6570\u503C)",category:"required",required:!0},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u5206\u7EC4)",category:"optional"},{name:"colorField",type:"string",description:"\u989C\u8272\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"stack",type:"any",description:"\u662F\u5426\u5806\u53E0",category:"layout"},{name:"group",type:"any",description:"\u662F\u5426\u5206\u7EC4\u663E\u793A",category:"layout"},{name:"percent",type:"boolean",description:"\u662F\u5426\u767E\u5206\u6BD4\u5C55\u793A",category:"layout"},{name:"conversionTag",type:"object",description:"\u8F6C\u5316\u7387\u914D\u7F6E",category:"style"},{name:"markBackground",type:"object",description:"\u5143\u7D20\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{title:"\u5404\u533A\u57DF\u5E74\u5EA6\u9500\u552E\u5206\u6790"},body:{xField:"region",yField:"sales",seriesField:"year",stack:!0,label:[{text:"sales",position:"inside"}],data:[{region:"\u534E\u4E1C",year:"2022",sales:4500},{region:"\u534E\u4E1C",year:"2023",sales:5200},{region:"\u534E\u5317",year:"2022",sales:3800},{region:"\u534E\u5317",year:"2023",sales:4100},{region:"\u534E\u5357",year:"2022",sales:4200},{region:"\u534E\u5357",year:"2023",sales:4800}]}}};var Ne={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 Le={tag:"x-dual-axes-chart",title:"\u53CC\u8F74\u56FE",description:"\u7528\u4E8E\u5728\u540C\u4E00\u56FE\u8868\u4E2D\u5C55\u793A\u4E24\u4E2A\u4E0D\u540C\u91CF\u7EB2\u7684\u6570\u636E\u7CFB\u5217\u3002",props:[],body:[{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"children",type:"array",description:"\u5B50\u56FE\u5C42\u914D\u7F6E\u6570\u7EC4",category:"required",required:!0,transform:(t,e)=>Array.isArray(t)?t.map(r=>{!r.xField&&e.xField&&(r.xField=e.xField);let n=r.xField||"x",o=r.scale||{},a=o[n]||{};return(r.type==="interval"||!a.type)&&(a.type="band"),{...r,scale:{...o,[n]:a}}}):t,items:[{name:"properties",type:"object",description:"\u5B50\u56FE\u5C42\u914D\u7F6E",category:"required",properties:[{name:"type",type:"enum",description:"\u56FE\u5C42\u7C7B\u578B",category:"required",options:["interval","line","area","point"],required:!0},{name:"yField",type:"string",description:"\u6570\u503C\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5 (\u522B\u540D)",category:"optional"},{name:"shapeField",type:"string",description:"\u5F62\u72B6\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"group",type:"boolean",description:"\u662F\u5426\u5206\u7EC4",category:"layout"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"data",type:"array",description:"\u5B50\u56FE\u5C42\u72EC\u7ACB\u6570\u636E\u6E90",category:"required"},{name:"axis",type:"object",description:"\u8BE5\u56FE\u5C42\u7684\u8F74\u914D\u7F6E",category:"style",properties:[{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","inside","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]}]}]},{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"title",type:"any",description:"\u56FE\u8868\u6807\u9898",category:"style",properties:[{name:"title",type:"string",description:"\u4E3B\u6807\u9898",category:"optional"},{name:"subtitle",type:"string",description:"\u526F\u6807\u9898",category:"optional"},{name:"align",type:"enum",description:"\u5BF9\u9F50\u65B9\u5F0F",category:"style",options:["left","center","right"]},{name:"titleFontSize",type:"number",description:"\u4E3B\u6807\u9898\u5B57\u53F7",category:"style"},{name:"titleFontWeight",type:"any",description:"\u4E3B\u6807\u9898\u5B57\u91CD",category:"style"},{name:"titleFill",type:"string",description:"\u4E3B\u6807\u9898\u989C\u8272",category:"style"}]},{name:"label",type:"any",description:"\u6807\u7B7E\u914D\u7F6E",category:"style",properties:[{name:"text",type:"string",description:"\u6620\u5C04\u5B57\u6BB5",category:"optional"},{name:"position",type:"enum",description:"\u4F4D\u7F6E",category:"layout",options:["top","bottom","middle","left","right"]},{name:"style",type:"object",description:"\u6837\u5F0F",category:"style"},{name:"background",type:"any",description:"\u80CC\u666F\u914D\u7F6E",category:"style"},{name:"transform",type:"array",description:"\u5E03\u5C40\u53D8\u6362",category:"style"}]},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style",properties:[{name:"x",type:"object",description:"X\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]},{name:"y",type:"object",description:"Y\u8F74\u914D\u7F6E",category:"style",properties:[{name:"title",type:"any",description:"\u8F74\u6807\u9898",category:"style"},{name:"line",type:"any",description:"\u8F74\u7EBF",category:"style"},{name:"tick",type:"any",description:"\u523B\u5EA6\u7EBF",category:"style"},{name:"label",type:"any",description:"\u523B\u5EA6\u503C",category:"style"},{name:"grid",type:"any",description:"\u7F51\u683C\u7EBF",category:"style"},{name:"labelFormatter",type:"any",description:"\u683C\u5F0F\u5316",category:"style"}]}]},{name:"scale",type:"object",description:"\u6BD4\u4F8B\u5C3A\u914D\u7F6E",category:"style",properties:[{name:"type",type:"string",description:"\u7C7B\u578B",category:"style"},{name:"domain",type:"array",description:"\u5B9A\u4E49\u57DF",category:"style"},{name:"range",type:"array",description:"\u503C\u57DF",category:"style"},{name:"palette",type:"string",description:"\u8272\u677F",category:"style"}]},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u60AC\u6D6E\u63D0\u793A\u914D\u7F6E",category:"interaction"},{name:"style",type:"object",description:"\u56FE\u5F62\u6837\u5F0F\u914D\u7F6E",category:"style"},{name:"annotations",type:"array",description:"\u8F85\u52A9\u6807\u6CE8\u914D\u7F6E",category:"style"}],example:{props:{xField:"month",children:[{type:"interval",yField:"sales",label:[{position:"middle"}]},{type:"line",yField:"rate",label:[{position:"top"}],style:{stroke:"#5AD8A6",lineWidth:2}}],axis:{y:[{title:{text:"\u9500\u552E\u989D"}},{title:{text:"\u5229\u6DA6\u7387"},position:"right"}]},data:[{month:"1\u6708",sales:450,rate:.12},{month:"2\u6708",sales:520,rate:.15},{month:"3\u6708",sales:480,rate:.14},{month:"4\u6708",sales:610,rate:.18},{month:"5\u6708",sales:580,rate:.16}]},body:{xField:"time",yField:["value","count"],data:[{time:"2021-01",value:10,count:5},{time:"2021-02",value:20,count:10}]}}};var ke={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 yt={line:Se,column:Me,pie:Ne,"dual-axes":Le,funnel:ke};function gt(t,e){let r=new Map;return Object.entries(t).forEach(([n,o])=>{(o[e]||[]).forEach(s=>{if(["type","data","xField","yField","colorField","seriesField","title","label","axis","legend","tooltip","scale","interaction","theme"].includes(s.name))return;let c=r.get(s.name);c?c.types.push(n):r.set(s.name,{def:s,types:[n]})})}),Array.from(r.values()).map(({def:n,types:o})=>({...n,visibleIf:a=>o.includes(a.type)?n.visibleIf?n.visibleIf(a):!0:!1}))}var ce={tag:"xcml:chart",title:"AntV \u901A\u7528\u56FE\u8868",description:"\u5168\u529F\u80FD\u56FE\u8868\u7EC4\u4EF6\u5BB9\u5668\uFF0C\u652F\u6301\u901A\u8FC7 type \u52A8\u6001\u5207\u6362\u6298\u7EBF\u56FE\u3001\u67F1\u72B6\u56FE\u3001\u997C\u56FE\u7B49\u3002",props:[{name:"type",type:"enum",description:"\u56FE\u8868\u7C7B\u578B",category:"required",required:!0,options:["line","column","pie","dual-axes","funnel"],default:"line"},...gt(yt,"props")],body:[{name:"data",type:"array",description:"\u56FE\u8868\u6570\u636E\u6E90",category:"required",required:!0},{name:"xField",type:"string",description:"X\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"yField",type:"string",description:"Y\u8F74\u5B57\u6BB5",category:"required",required:!0},{name:"colorField",type:"string",description:"\u989C\u8272/\u5206\u7EC4\u5B57\u6BB5",category:"optional"},{name:"seriesField",type:"string",description:"\u7CFB\u5217\u5B57\u6BB5",category:"optional"},{name:"title",type:"object",description:"\u56FE\u8868\u6807\u9898",category:"style"},{name:"label",type:"object",description:"\u6570\u636E\u6807\u7B7E",category:"style"},{name:"axis",type:"object",description:"\u5750\u6807\u8F74\u914D\u7F6E",category:"style"},{name:"legend",type:"object",description:"\u56FE\u4F8B\u914D\u7F6E",category:"style"},{name:"tooltip",type:"object",description:"\u63D0\u793A\u4FE1\u606F",category:"interaction"},{name:"scale",type:"object",description:"\u5EA6\u91CF\u914D\u7F6E",category:"optional"},{name:"interaction",type:"object",description:"\u4EA4\u4E92\u914D\u7F6E",category:"interaction"},{name:"theme",type:"string",description:"\u56FE\u8868\u4E3B\u9898",category:"style"},...gt(yt,"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 Pe={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 Re={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 Te={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 Xe={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 Fe={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 Ae={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 _e={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 Tr=[{name:"theme",type:"enum",description:"\u7EC4\u4EF6\u89C6\u89C9\u4E3B\u9898\u98CE\u683C",category:"style",options:["light","dark","ocean","sunset"],default:void 0}],Xr={"xcml:metric":be,"xcml:table":xe,"xcml:chart":ce,"xcml:list":Ce,"xcml:thought-chain":_e,"xcml:insight-card":Pe,"xcml:metric-card":Te,"xcml:card":ve,"xcml:toc":we,"xcml:poster-card":Fe,"xcml:mini-kpi-strip":Xe,"xcml:interactive-summary":Re,"xcml:snapshot-table":Ae},de=Object.fromEntries(Object.entries(Xr).map(([t,e])=>[t,{...e,props:[...e.props||[],...Tr]}]));import{parse as yi,stringify as gi}from"yaml";function Za(t){let{theme:e,variant:r,size:n,className:o,style:a}=t;return{theme:e,variant:r,size:n,className:o,style:a}}function ft(t,e){let r=t.props||{},n=t.body!==void 0?t.body:t.data,o=(t.props||{})["data-xcml-raw"];if(o)try{n=decodeURIComponent(escape(atob(o)))}catch(l){console.warn("[XCML] Failed to decode data-xcml-raw:",l)}if(typeof n=="string"){let l=n.trim();if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{n=JSON.parse(l)}catch{}}let a={};if(e&&((e.props||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)}),(e.body||[]).forEach(l=>{l.default!==void 0&&(a[l.name]=l.default)})),n!=null)if(typeof n=="object"&&!Array.isArray(n))Object.assign(a,n),Array.isArray(n.data)&&(a.data=n.data);else if(Array.isArray(n)){let l=(e?.body||[]).find(c=>c.type==="array")?.name||"data";a[l]=n}else{let l=e?.example?.contentProp||(e?.body||[]).find(c=>c.name==="content"||c.name==="value")?.name||"content";a[l]=n}return Object.assign(a,r),["theme","variant","layout","size"].forEach(l=>{a[l]===void 0&&r[l]!==void 0&&(a[l]=r[l])}),a}var ne=t=>{if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();if(!e)return[];if(e.startsWith("["))try{return JSON.parse(e)}catch{try{return JSON.parse(e.replace(/'/g,'"'))}catch{}}return e.split(/[,,]/).map(r=>r.trim()).filter(Boolean)}return[]};function oe(t,e={}){let r={};return Object.entries(t).forEach(([n,o])=>{r[`xcml:${n}`]=o,e[n]&&e[n].forEach(a=>{r[`xcml:${a}`]=o})}),r}var ri=(t,e="xcml-node")=>{if(!t||!t.type||!de[t.type])return null;let o=(globalThis.__XCML_RENDERERS__||{})[t.type];return o?o(t,e):null};function ni(t,e){let r=[],n=t.props||{};if(e.props.forEach(o=>{o.required&&(n[o.name]===void 0||n[o.name]===null||n[o.name]==="")&&r.push(`\u5C5E\u6027 '${o.name}' (${o.description}) \u662F\u5FC5\u586B\u9879`)}),e.props.forEach(o=>{let a=n[o.name];a!=null&&(o.type==="number"&&isNaN(Number(a))&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u6570\u5B57\u7C7B\u578B`),o.type==="boolean"&&typeof a!="boolean"&&a!=="true"&&a!=="false"&&r.push(`\u5C5E\u6027 '${o.name}' \u5E94\u4E3A\u5E03\u5C14\u7C7B\u578B`),o.type==="enum"&&o.options&&!o.options.includes(a)&&r.push(`\u5C5E\u6027 '${o.name}' \u7684\u503C '${a}' \u4E0D\u5728\u53EF\u9009\u8303\u56F4\u5185: ${o.options.join(", ")}`))}),e.body&&e.body.length>0){let o=t.body!==void 0?t.body:t.data;e.body.forEach(a=>{a.required&&(o==null||o===""?r.push("\u6807\u7B7E\u4F53\u5185\u5BB9 (Body Data) \u662F\u5FC5\u586B\u9879"):typeof o=="object"&&!Array.isArray(o)&&(o[a.name]===void 0||o[a.name]===null||o[a.name]==="")&&r.push(`\u6807\u7B7E\u4F53\u5185\u5BB9\u5E94\u5305\u542B '${a.name}' (${a.description}) \u5B57\u6BB5`))})}return{valid:r.length===0,errors:r}}function ht(t,e){let{node:r,streamStatus:n}=t,o=ft(r,e),a=r?.streamStatus||n||o.streamStatus,s=a==="loading"||r?.body?.["data-xcml-loading"]==="true"||r?.data?.["data-xcml-loading"]==="true"||r?.props?.["data-xcml-loading"]==="true"||o?.["data-xcml-loading"]==="true"||t.loading,l={theme:o.theme,variant:o.variant,size:o.size,className:t.className,style:t.style,loading:s,streamStatus:a,error:t.error};return{merged:o,baseProps:l,isLoading:s,streamStatus:a}}function Je(t){return t.startsWith("xcml:")?t.slice(5):t.startsWith("x-")?t.slice(2):t}function Fr(t){return`x-${Je(t)}`}function Ee(t){return`xcml:${Je(t)}`}var Ke=class{constructor(){this.listeners={}}on(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r)}emit(e,r){(this.listeners[e]||[]).forEach(n=>n(r))}refresh(e){this.emit("refresh",{id:e})}update(e,r){this.emit("update",{id:e,payload:r})}resize(e){this.emit("resize",{id:e})}export(e,r){this.emit("export",{id:e,type:r})}},me=new Ke,Ar=/\/\/(.*)$/gm,_r=/\/\*[\s\S]*?\*\//g;function Er(t,e="json"){let r=t.trim();if(!r)return null;if((e==="json"||e==="jsonc")&&!(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")))return r;try{if(e==="json"||e==="jsonc"){let n=e==="jsonc"?r.replace(Ar,"").replace(_r,""):r;try{return JSON.parse(n)}catch(o){try{let a=He(n);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("[")))throw o;return a}catch{throw o}}}if(e==="yaml")return He(r);if(e==="csv"||e==="tsv"){let n=e==="csv"?",":" ",o=r.split(/\r?\n/).filter(s=>s.trim());if(o.length===0)return[];let a=o[0].split(n).map(s=>s.trim());return o.slice(1).map(s=>{let l=s.split(n),c={};return a.forEach((m,p)=>{let d=l[p]?.trim();d==="true"?d=!0:d==="false"?d=!1:d!==""&&!isNaN(Number(d))&&(d=Number(d)),c[m]=d}),c})}return e==="ndjson"?r.split(/\r?\n/).filter(Boolean).map(n=>JSON.parse(n)):JSON.parse(r)}catch(n){throw n}}function ci(t,e){return e!=null}function bt(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e;let r=Ee(t),n=de[r];if(!n)return e;let o={...e};return[...n.props||[],...n.body||[]].forEach(s=>{let l=o[s.name];if((s.type==="object"||s.type==="array")&&typeof l=="string")try{let c=l.trim();if(c.startsWith("{")||c.startsWith("[")){let m=c,p=0;for(;typeof m=="string"&&p<2;){let d=JSON.parse(m);if(d===null||typeof d!="object")if(typeof d=="string"&&(d.startsWith("{")||d.startsWith("[")))m=d;else break;else{m=d;break}p++}o[s.name]=m}}catch{}}),o}function xt(t,e,r,n={}){let o=Ee(t),a=de[o],s={},l={},{preferBody:c=!1}=n,m=Ct(r),p=m;a&&(typeof m=="string"?p={[a.example?.contentProp||(a.body||[]).find(x=>x.name==="content"||x.name==="value")?.name||"content"]:m}:m&&typeof m=="object"&&Array.isArray(m)),p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).forEach(b=>{/^\d+$/.test(b)||(l[b]=p[b])});let d={...p&&typeof p=="object"&&!Array.isArray(p)?p:{},...e};if(!a)return{props:e,body:r};let i=new Set((a.props||[]).map(b=>b.name)),u=new Set((a.body||[]).map(b=>b.name));for(let[b,x]of Object.entries(d))/^\d+$/.test(b)||(c?i.has(b)||u.has(b)?l[b]=x:b in e?s[b]=x:l[b]=x:i.has(b)?s[b]=x:u.has(b)?l[b]=x:b in e?s[b]=x:l[b]=x);let g=l;if(Array.isArray(m))if(Object.keys(l).length===0)g=m;else{let b=(a.body||[]).find(x=>x.type==="array")?.name||"data";l[b]=m,g=l}return{props:bt(o,s),body:bt(o,g)}}function Ct(t){if(Array.isArray(t))return t;if(t&&typeof t=="object"){let e=Object.keys(t).filter(r=>/^\d+$/.test(r)).sort((r,n)=>Number(r)-Number(n));if(e.length>0&&e.length===Object.keys(t).length&&e.every((r,n)=>Number(r)===n))return e.map(r=>t[r])}return t}function di(t){let e=Ee(t.tag||t.type||"unknown"),r=Fr(e),n={...t.props||{}},o=Ct(t.body),{body:a}=xt(e,n,o,{preferBody:!0}),s=[],l=a,c=Object.keys(a||{});c.length===1&&c[0]==="data"&&Array.isArray(a.data)&&(l=a.data);let m=s.length>0?" "+s.join(" "):"",p=JSON.stringify(l,null,2);return`<${r}${m}>
2
2
  ${p}
3
- </${n}>`}function li(t){if(!t)return null;let e=t.trim();if(!e.startsWith("<"))try{let i=qe(e);if(i&&(i.tag||i.type))return{tag:i.tag||i.type,props:i.props||{},body:i.body||i.data||i.dataProps||{}}}catch{}let n=e.match(/^<((?:xcml:|x-)[^\s/>]+)\s*([\s\S]*?)(\/?>)([\s\S]*?)$/);if(!n)return null;let[,r,o,a]=n,s=a==="/>",l={},d=/([a-zA-Z0-9-]+)\s*=\s*(?:'([^']*)'|"([^"]*)"|`([^`]*)`|((?:(?!\s|\/|>).)+))/g,m;for(;(m=d.exec(o))!==null;){let i=m[1],u=m[2]||m[3]||m[4]||m[5];l[i]=u}let p="";if(!s){let i=`</${r}>`,u=e.lastIndexOf(i);if(u!==-1){let f=-1,y=null;for(let x=0;x<e.length;x++){let g=e[x];if((g==="'"||g==='"'||g==="`")&&(y?y===g&&(y=null):y=g),g===">"&&!y){f=x;break}}f!==-1&&(p=e.slice(f+1,u).trim())}}let c=me(r,l,p);return{tag:c.type,props:c.props,body:c.body}}function me(t,e,n){let r=Ve(t),o=_e(r),a=e["data-format"]||"json",s;try{s=Rr(n,a)}catch{if(r==="list")try{s=Tr(n)}catch{}!s&&n.trim()&&(s=n.trim()),s||(s=null)}let l={...e};for(let p in l){let c=l[p];if(typeof c=="string"){let i=c.trim();for(;i.length>=2&&(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")||i.startsWith("`")&&i.endsWith("`"));)i=i.slice(1,-1).trim();if(i==="true")l[p]=!0;else if(i==="false")l[p]=!1;else if(/^-?\d+(\.\d+)?$/.test(i)){let u=Number(i);isNaN(u)||(l[p]=u)}else if(i.startsWith("[")||i.startsWith("{"))try{l[p]=JSON.parse(i)}catch{try{l[p]=JSON.parse(i.replace(/'/g,'"'))}catch{l[p]=i}}else l[p]=i}}let{props:d,body:m}=ft(o,l,s);return{type:o,props:d,body:m,__source:n}}function Tr(t){let n=t.split(/\r?\n/).filter(r=>r.trim()).map(r=>{let o=r.match(/^\s*[-*+]\s*\[([ x-])\]\s*(.*)$/);if(o){let s=o[1],l=o[2].trim(),d="todo";return s==="x"?d="done":s==="-"&&(d="doing"),{title:l,status:d}}let a=r.match(/^\s*[-*+]\s*(.*)$/);return a?{title:a[1].trim(),status:"normal"}:null}).filter(Boolean);return n.length>0?{items:n}:null}function Xr(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,s=0,l="",d;for(;(d=a.exec(r))!==null;){let m=d[1],p=d[2],c=p==="["?"]":"}",i=d.index,u=i+d[0].length-1;if((r.slice(0,i).match(/['"]/g)||[]).length%2!==0)continue;let x=0,g=-1;for(let b=u;b<r.length;b++)if(r[b]===p?x++:r[b]===c&&x--,x===0){g=b;break}if(g!==-1){let b=r[u-1];if(b==="'"||b==='"')continue;let h=r.slice(u,g+1);l+=r.slice(s,i),l+=`${m}='${h}'`,s=g+1,a.lastIndex=s}}return l+=r.slice(s),`${n} ${l}${o}`}function bt(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=[],s=0,l=r.length;for(;s<l;){let d=r[s];if(d!=="<"&&d!=="`"){let m=r.indexOf("<",s+1),p=r.indexOf("`",s+1),c=-1;if(m!==-1&&p!==-1?c=Math.min(m,p):m!==-1?c=m:p!==-1&&(c=p),c===-1){a.push(r.slice(s));break}a.push(r.slice(s,c)),s=c;continue}if(r.startsWith("```",s)){let m=r.indexOf("```",s+3);if(m===-1){a.push(r.slice(s));break}a.push(r.slice(s,m+3)),s=m+3;continue}if(d==="`"){let m=r.indexOf("`",s+1);if(m===-1){a.push(r.slice(s));break}a.push(r.slice(s,m+1)),s=m+1;continue}if(d==="<"){let m=-1,p=null;for(let c=s+1;c<l;c++){let i=r[c];if((i==="'"||i==='"'||i==="`")&&(p?p===i&&(p=null):p=i),i===">"&&!p){m=c;break}}if(m===-1){if(s+1<l&&/[a-zA-Z\/]/.test(r[s+1])){let c=s+(r[s+1]==="/"?2:1);for(;c<l&&/[a-zA-Z0-9-]/.test(r[c]);)c++;let i=r.slice(s+(r[s+1]==="/"?2:1),c);if(i.startsWith("x-")){if(o&&!o.has(i))break;r[s+1]!=="/"?a.push(`
3
+ </${r}>`}function mi(t){if(!t)return null;let e=t.trim();if(!e.startsWith("<"))try{let i=He(e);if(i&&(i.tag||i.type))return{tag:i.tag||i.type,props:i.props||{},body:i.body||i.data||i.dataProps||{}}}catch{}let r=e.match(/^<((?:xcml:|x-)[^\s/>]+)\s*([\s\S]*?)(\/?>)([\s\S]*?)$/);if(!r)return null;let[,n,o,a]=r,s=a==="/>",l={},c=/([a-zA-Z0-9-]+)\s*=\s*(?:'([^']*)'|"([^"]*)"|`([^`]*)`|((?:(?!\s|\/|>).)+))/g,m;for(;(m=c.exec(o))!==null;){let i=m[1],u=m[2]||m[3]||m[4]||m[5];l[i]=u}let p="";if(!s){let i=`</${n}>`,u=e.lastIndexOf(i);if(u!==-1){let g=-1,b=null;for(let x=0;x<e.length;x++){let f=e[x];if((f==="'"||f==='"'||f==="`")&&(b?b===f&&(b=null):b=f),f===">"&&!b){g=x;break}}g!==-1&&(p=e.slice(g+1,u).trim())}}let d=pe(n,l,p);return{tag:d.type,props:d.props,body:d.body}}function pe(t,e,r){let n=Je(t),o=Ee(n),a=e["data-format"]||"json",s;try{s=Er(r,a)}catch{if(n==="list")try{s=Or(r)}catch{}!s&&r.trim()&&(s=r.trim()),s||(s=null)}let l={...e};for(let p in l){let d=l[p];if(typeof d=="string"){let i=d.trim();for(;i.length>=2&&(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")||i.startsWith("`")&&i.endsWith("`"));)i=i.slice(1,-1).trim();if(i==="true")l[p]=!0;else if(i==="false")l[p]=!1;else if(/^-?\d+(\.\d+)?$/.test(i)){let u=Number(i);isNaN(u)||(l[p]=u)}else if(i.startsWith("[")||i.startsWith("{"))try{l[p]=JSON.parse(i)}catch{try{l[p]=JSON.parse(i.replace(/'/g,'"'))}catch{l[p]=i}}else l[p]=i}}let{props:c,body:m}=xt(o,l,s);return{type:o,props:c,body:m,__source:r}}function Or(t){let r=t.split(/\r?\n/).filter(n=>n.trim()).map(n=>{let o=n.match(/^\s*[-*+]\s*\[([ x-])\]\s*(.*)$/);if(o){let s=o[1],l=o[2].trim(),c="todo";return s==="x"?c="done":s==="-"&&(c="doing"),{title:l,status:c}}let a=n.match(/^\s*[-*+]\s*(.*)$/);return a?{title:a[1].trim(),status:"normal"}:null}).filter(Boolean);return r.length>0?{items:r}:null}function Ir(t){if(!t.startsWith("<x-")&&!t.startsWith("<xcml:"))return t;let e=t.match(/^(<(?:x-|xcml:)[^\s/>]+)\s*([\s\S]*?)(\/?>)$/);if(!e)return t;let[,r,n,o]=e;if(!n)return t;let a=/([a-zA-Z0-9-]+)\s*=\s*([\[\{])/g,s=0,l="",c;for(;(c=a.exec(n))!==null;){let m=c[1],p=c[2],d=p==="["?"]":"}",i=c.index,u=i+c[0].length-1;if((n.slice(0,i).match(/['"]/g)||[]).length%2!==0)continue;let x=0,f=-1;for(let y=u;y<n.length;y++)if(n[y]===p?x++:n[y]===d&&x--,x===0){f=y;break}if(f!==-1){let y=n[u-1];if(y==="'"||y==='"')continue;let h=n.slice(u,f+1);l+=n.slice(s,i),l+=`${m}='${h}'`,s=f+1,a.lastIndex=s}}return l+=n.slice(s),`${r} ${l}${o}`}function vt(t,e){if(!t)return"";let r=t.match(/<(xcml:|xcml|xcm|xc|x)$/);r&&(t=t.slice(0,r.index));let n=t.replace(/<(\/?)xcml:([a-zA-Z0-9-]+)/g,"<$1x-$2"),o=e?new Set(e):null,a=[],s=0,l=n.length;for(;s<l;){let c=n[s];if(c!=="<"&&c!=="`"){let m=n.indexOf("<",s+1),p=n.indexOf("`",s+1),d=-1;if(m!==-1&&p!==-1?d=Math.min(m,p):m!==-1?d=m:p!==-1&&(d=p),d===-1){a.push(n.slice(s));break}a.push(n.slice(s,d)),s=d;continue}if(n.startsWith("```",s)){let m=n.indexOf("```",s+3);if(m===-1){a.push(n.slice(s));break}a.push(n.slice(s,m+3)),s=m+3;continue}if(c==="`"){let m=n.indexOf("`",s+1);if(m===-1){a.push(n.slice(s));break}a.push(n.slice(s,m+1)),s=m+1;continue}if(c==="<"){let m=-1,p=null;for(let d=s+1;d<l;d++){let i=n[d];if((i==="'"||i==='"'||i==="`")&&(p?p===i&&(p=null):p=i),i===">"&&!p){m=d;break}}if(m===-1){if(s+1<l&&/[a-zA-Z\/]/.test(n[s+1])){let d=s+(n[s+1]==="/"?2:1);for(;d<l&&/[a-zA-Z0-9-]/.test(n[d]);)d++;let i=n.slice(s+(n[s+1]==="/"?2:1),d);if(i.startsWith("x-")){if(o&&!o.has(i))break;n[s+1]!=="/"?a.push(`
4
4
 
5
5
  <${i} data-xcml-loading="true"></${i}>
6
6
 
7
7
  `):a.push(`
8
8
 
9
- ${r.slice(s).trim()}>
9
+ ${n.slice(s).trim()}>
10
10
 
11
- `);break}}a.push(d),s++;continue}else{let c=r[s+1]==="/",i=s+(c?2:1),u=i;for(;u<m&&/[a-zA-Z0-9-]/.test(r[u]);)u++;let f=r.slice(i,u);if(f.startsWith("x-")){if(o&&!o.has(f)){let g=`</${f}>`,b=r.indexOf(g,s);s=b!==-1?b+g.length:m+1;continue}let y=r.slice(s,m+1);c||(y=Xr(y.replace(/\r?\n/g," ")));let x=y.replace(/\s+/g," ");if(c||x.endsWith("/>")){a.push(`
11
+ `);break}}a.push(c),s++;continue}else{let d=n[s+1]==="/",i=s+(d?2:1),u=i;for(;u<m&&/[a-zA-Z0-9-]/.test(n[u]);)u++;let g=n.slice(i,u);if(g.startsWith("x-")){if(o&&!o.has(g)){let f=`</${g}>`,y=n.indexOf(f,s);s=y!==-1?y+f.length:m+1;continue}let b=n.slice(s,m+1);d||(b=Ir(b.replace(/\r?\n/g," ")));let x=b.replace(/\s+/g," ");if(d||x.endsWith("/>")){a.push(`
12
12
 
13
13
  ${x}
14
14
 
15
- `),s=m+1;continue}else{let g=`</${f}>`,b=r.indexOf(g,m+1);if(b===-1){let h=x;h.includes("data-xcml-loading")||(h=h.replace(">",' data-xcml-loading="true">')),a.push(`
15
+ `),s=m+1;continue}else{let f=`</${g}>`,y=n.indexOf(f,m+1);if(y===-1){let h=x;h.includes("data-xcml-loading")||(h=h.replace(">",' data-xcml-loading="true">')),a.push(`
16
16
 
17
17
  ${h}
18
- </${f}>
18
+ </${g}>
19
19
 
20
- `);break}else{let h=r.slice(m+1,b),w=h.trim(),k=h;(w.startsWith("{")||w.startsWith("["))&&(k=h.replace(/\\/g,"\\\\"));let P=x,S=k;if(w){let M=btoa(unescape(encodeURIComponent(h)));P=x.replace(">",` data-xcml-raw="${M}">`),S=""}a.push(`
20
+ `);break}else{let h=n.slice(m+1,y),v=h.trim(),M=h;(v.startsWith("{")||v.startsWith("["))&&(M=h.replace(/\\/g,"\\\\"));let _=x,L=M;if(v){let k=btoa(unescape(encodeURIComponent(h)));_=x.replace(">",` data-xcml-raw="${k}">`),L=""}a.push(`
21
21
 
22
- ${P}
23
- ${S}
24
- ${g}
22
+ ${_}
23
+ ${L}
24
+ ${f}
25
25
 
26
- `),s=b+g.length;continue}}}}}a.push(d),s++}return a.join("").replace(/\n{3,}/g,`
26
+ `),s=y+f.length;continue}}}}}a.push(c),s++}return a.join("").replace(/\n{3,}/g,`
27
27
 
28
- `).trim()}import T from"react";import{XMarkdown as jr}from"@ant-design/x-markdown";import{Button as Br,Modal as Dr,Tooltip as Wr}from"@chatbi-v/ui-shell";import{CodeOutlined as qr}from"@ant-design/icons";import He,{createContext as vt,useContext as wt,useState as Fr,useCallback as xt}from"react";import{jsx as Ct}from"react/jsx-runtime";var St=vt([]),Mt=vt({register:()=>{},unregister:()=>{}}),Ar=()=>wt(St),Ke=()=>wt(Mt),Nt=()=>{let t=Ar(),{register:e,unregister:n}=Ke();return{items:t,register:e,unregister:n}},Lt=({children:t})=>{let[e,n]=Fr(new Map),r=He.useRef(0),o=xt(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=xt(d=>{n(m=>{let p=new Map(m);return p.delete(d)?p:m})},[]),s=He.useMemo(()=>Array.from(e.values()).sort((d,m)=>d.index-m.index),[e]),l=He.useMemo(()=>({register:o,unregister:a}),[o,a]);return Ct(Mt.Provider,{value:l,children:Ct(St.Provider,{value:s,children:t})})};import{createContext as _r,useContext as Or,useState as Er,useEffect as $r,useRef as Je}from"react";import{jsx as kt}from"react/jsx-runtime";var Pt=_r({containerWidth:0}),Rt=({children:t})=>{let[e,n]=Er(0),r=Je(null),o=Je(0),a=Je(0);return $r(()=>{let s=r.current;if(!s)return;let l=c=>{for(let i of c){let u=i.borderBoxSize?.[0]?.inlineSize??i.contentRect.width,f=Math.floor(u);Math.abs(f-o.current)>=1&&(cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{o.current=f,n(f)}))}},d=new ResizeObserver(l);d.observe(s);let p=s.getBoundingClientRect().width;return o.current=Math.floor(p),n(Math.floor(p)),()=>{d.disconnect(),cancelAnimationFrame(a.current)}},[]),kt(Pt.Provider,{value:{containerWidth:e},children:kt("div",{ref:r,className:"xcml-layout-container w-full min-w-0 relative block","data-container-width":e,children:t})})},Tt=()=>Or(Pt);function Li(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 s=a[1],l=a[2]||"",d=a.index||0,m=new RegExp(`</x-${s}>`,"i"),p=o.slice(d+a[0].length),c=p.match(m);if(!c)return;let i=p.slice(0,c.index),u=o.slice(d,d+a[0].length+i.length+c[0].length),f=Ir(l);return{type:"x-tag",raw:u,name:s,attrs:f,body:i}},renderer(o){let a=me(o.name,o.attrs,o.body);return{type:a.type,props:a.props,body:a.body}}}}function Ir(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 zr}from"clsx";import{twMerge as Ye}from"tailwind-merge";import{jsx as R,jsxs as Xt}from"react/jsx-runtime";function Ze(t){let{content:e,stream:n,renderers:r,className:o,style:a,openLinksInNewTab:s,dompurifyConfig:l,enableHoverSource:d=!1,theme:m,onContentChange:p,onComponentRender:c}=t;T.useEffect(()=>{e&&p&&p(e)},[e,p]);let i=T.useDeferredValue(e),u=T.useMemo(()=>{let g=r?Object.keys(r).map(b=>b.startsWith("xcml:")?`x-${b.slice(5)}`:b):[];return i?bt(i,g):""},[i,r]),f=T.useMemo(()=>new WeakMap,[]),y=T.useMemo(()=>{let g={};if(r){let h=new Set;Object.keys(r).forEach(w=>{let k=w.startsWith("xcml:"),P=w.startsWith("x-");if(k||P){let S=k?`x-${w.slice(5)}`:w;h.add(S);let M=r[w];g[S]=$=>{let{domNode:N,className:I,streamStatus:W,node:U,children:X,...F}=$,Y=f.get(N);if(!Y){let Z="",We=F["data-xcml-raw"];if(We)try{Z=decodeURIComponent(escape(atob(We)))}catch(dt){console.error("[XCML] Failed to decode raw body:",dt),Z=Ue(N?.children||[])}else Z=Ue(N?.children||[]);let ct=k?w.slice(5):w.slice(2);Y=me(ct,F,Z),f.set(N,Y)}let A={...Y};F["data-xcml-loading"]==="true"?A.streamStatus="loading":A.streamStatus=W;let lt=M(A,F.key??S);return R(Vr,{tag:S,node:A,className:I,enableHoverSource:d,onStatusChange:Z=>c?.(S,Z),children:lt})}}})}g.pre=h=>{let{domNode:w,streamStatus:k,node:P,...S}=h,M=(w?.children||[]).find(I=>I?.name==="code"),$=[M?.attribs?.class,M?.attribs?.classname,M?.attribs?.className].filter(Boolean).join(" ");if(/language-mermaid/.test($)){let I=Ue(M?.children||[]),W=I.split("").reduce((X,F)=>(X=(X<<5)-X+F.charCodeAt(0),X&X),0),U=`m-${Math.abs(W)}`;return R(Hr,{id:U,code:I,theme:m},h.key)}return T.createElement("pre",S,h.children)},g.p=h=>{let{domNode:w,node:k,children:P,streamStatus:S,...M}=h;return w?.children?.some(N=>N.type==="tag"&&(["div","p","pre","blockquote","table","ul","ol","h1","h2","h3","h4","h5","h6","form","fieldset","address"].includes(N.name)||N.name&&N.name.startsWith("x-")))||k?.children?.some(N=>N.tagName==="div"||N.tagName&&N.tagName.startsWith("x-"))?R("div",{...M,className:Ye("mb-4 w-full",M.className),children:P}):R("p",{...M,children:P})};let b=T.memo(({level:h,children:w,domNode:k,streamStatus:P,node:S,...M})=>{let{register:$,unregister:N}=Ke(),I=T.useCallback(A=>typeof A=="string"?A:Array.isArray(A)?A.map(I).join(""):T.isValidElement(A)?I(A.props.children):"",[]),W=I(w),U=T.useMemo(()=>W.trim().toLowerCase().replace(/\s+/g,"-"),[W]),X=M.id||U||`h${h}-${Math.random().toString(36).slice(2,9)}`,F=T.useRef(null);T.useEffect(()=>{if(!$)return;let A={id:X,title:W,level:h};return(!F.current||F.current.id!==A.id||F.current.title!==A.title||F.current.level!==A.level)&&(F.current&&N?.(F.current.id),$(A),F.current=A),()=>{F.current&&(N?.(F.current.id),F.current=null)}},[X,W,h,$,N]);let Y=`h${h}`;return Xt(Y,{id:X,className:"scroll-mt-20 group relative",...M,children:[w,d&&R("a",{href:`#${X}`,className:"ml-2 opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity no-underline",children:"#"})]})});return g.h1=h=>R(b,{level:1,...h}),g.h2=h=>R(b,{level:2,...h}),g.h3=h=>R(b,{level:3,...h}),g.h4=h=>R(b,{level:4,...h}),g.h5=h=>R(b,{level:5,...h}),g.h6=h=>R(b,{level:6,...h}),g},[r,d,m]);return R(Rt,{children:R(Lt,{children:R(jr,{content:u,streaming:n?{hasNextChunk:!0}:void 0,components:y,className:Ye(zr("prose w-full max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-code:text-foreground prose-th:text-foreground prose-td:text-foreground prose-a:text-primary prose-code:bg-muted/50 prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-pre:bg-muted/50 prose-pre:text-foreground",o)),style:a,openLinksInNewTab:s,dompurifyConfig:l})})})}function Vr({children:t,tag:e,node:n,className:r,enableHoverSource:o,onStatusChange:a}){let[s,l]=T.useState(!1),[d,m]=T.useState(!1);T.useEffect(()=>{if(a){let i=n?.streamStatus||"success";a(i)}},[n?.streamStatus,a]);let p=i=>{i.stopPropagation(),m(!0)},c=T.useMemo(()=>{let i=Object.entries(n.attributes||{}).map(([u,f])=>`${u}="${f}"`).join(" ");return`<${e}${i?" "+i:""}>${n.children?`
29
- `+n.children+`
30
- `:""}</${e}>`},[e,n]);return Xt("div",{className:Ye("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",r),onMouseEnter:()=>o&&l(!0),onMouseLeave:()=>o&&l(!1),children:[t,s&&o&&R(Wr,{title:"\u67E5\u770B\u6E90\u7801",children:R(Br,{icon:R(qr,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:p})}),R(Dr,{open:d,onCancel:()=>m(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:R("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:c})})]})}var Ge=new WeakMap;function Ue(t){if(!t)return"";if(Ge.has(t))return Ge.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 Ge.set(t,r),r}var Hr=T.memo(({code:t,theme:e,id:n})=>{let r=T.useRef(null);return T.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]),R("div",{ref:r,className:"mermaid w-full flex justify-center my-4"})});import Sn,{useMemo as rt,Suspense as Mn,forwardRef as Nn,useRef as Kt,useEffect as Jt,useCallback as Ln}from"react";import*as kn from"@ant-design/plots";import{Skeleton as Ut}from"@chatbi-v/ui-shell";import{createContext as Kr,useContext as Jr,useEffect as Gr,useState as Ur,useMemo as Yr,useRef as Zr}from"react";import{XProvider as Qr}from"@chatbi-v/ui-shell";import{theme as Ft}from"@chatbi-v/ui-shell";import{jsx as Qe}from"react/jsx-runtime";var en={theme:"light",setTheme:()=>null},At=Kr(en);function zi({children:t,defaultTheme:e="sunset",theme:n,primaryColor:r="#ea580c",storageKey:o="xcml-ui-theme",scoped:a=!0,className:s,style:l,...d}){let[m,p]=Ur(()=>localStorage.getItem(o)||e),c=n??m,i=Zr(null);Gr(()=>{let y=a?i.current:window.document.documentElement;if(!y)return;if(r.startsWith("#")){let g=r.replace(/^#/,""),b=parseInt(g.substring(0,2),16),h=parseInt(g.substring(2,4),16),w=parseInt(g.substring(4,6),16);y.style.setProperty("--primary-rgb",`${b}, ${h}, ${w}`);let k=b/255,P=h/255,S=w/255,M=Math.max(k,P,S),$=Math.min(k,P,S),N=0,I=0,W=(M+$)/2;if(M!==$){let X=M-$;switch(I=W>.5?X/(2-M-$):X/(M+$),M){case k:N=(P-S)/X+(P<S?6:0);break;case P:N=(S-k)/X+2;break;case S:N=(k-P)/X+4;break}N/=6}let U=`${Math.round(N*360)} ${Math.round(I*100)}% ${Math.round(W*100)}%`;y.style.setProperty("--primary",U)}else y.style.setProperty("--primary",r);y.classList.remove("light","dark"),y.removeAttribute("data-theme");let x=["ocean","sunset","lavender","rose","amber","midnight","forest","slate","crimson","cyan"];if(c==="system"){let g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(g);return}if(c==="dark"){y.classList.add("dark");return}if(c==="light"){y.classList.add("light");return}if(x.includes(c)){y.setAttribute("data-theme",c);return}},[c,a]);let u={theme:c,setTheme:y=>{localStorage.setItem(o,y),p(y)}},f=Yr(()=>({algorithm:c==="dark"||c==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ft.darkAlgorithm:Ft.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 Qe(At.Provider,{value:u,...d,children:Qe(Qr,{theme:f,children:Qe("div",{ref:i,className:`xcml-scope text-inherit bg-inherit ${s||""}`,style:l,children:t})})})}var Oe=()=>{let t=Jr(At);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var tn={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},rn={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]}}}},et={defaultColor:"#8b5cf6",colors10:["#8b5cf6","#f472b6","#0ea5e9","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:tn},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"}}}}}}},nn={defaultColor:"#a78bfa",colors10:["#a78bfa","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#c4b5fd","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:rn},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)"}}}}},on={light:et,dark:nn,default:et};function _t(t){return on[t||"default"]||et}import an from"react";var sn=an.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Ot={type:"line",schema:we,getComponent:()=>sn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};import ln from"react";var cn=ln.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Et={type:"column",schema:Se,getComponent:()=>cn,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 dn from"react";var mn=dn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),$t={type:"pie",schema:Me,getComponent:()=>mn,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 pn from"react";var un=pn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),It={type:"dual-axes",schema:Ne,getComponent:()=>un,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(l=>l.data&&l.data.length>0||r.length===0?!0:l.yField&&r.includes(l.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 l=e.xField,d=r.filter(m=>m!==l&&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,s=Array.isArray(e.children)&&e.children.some(l=>l.data&&Array.isArray(l.data)&&l.data.length>0);if(!a&&s){let{data:l,...d}=e;return d}return e}};import yn from"react";var gn=yn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),jt={type:"funnel",schema:Le,getComponent:()=>gn,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 fn={line:Ot,column:Et,pie:$t,"dual-axes":It,funnel:jt};function Bt(t){return t&&fn[t.toLowerCase()]||null}import hn from"react";import{Empty as Dt,Button as bn,Result as xn}from"@chatbi-v/ui-shell";import{jsx as pe}from"react/jsx-runtime";function Ee(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&&!hn.isValidElement(o)?n[r]=Ee(a,o):n[r]=o}return n}function Wt(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]=Ee(o.default,n[a])),o.transform){let s=n[a];n[a]=o.transform(s,n)}}),n)}function qt(t){let{type:e,data:n,theme:r,title:o,__native__:a,...s}=t,l={data:n||[],height:t.height||300,theme:r||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},d=Ee(Ee(l,s),a||{});return d.seriesField&&!d.colorField&&(d.colorField=d.seriesField),d.__native__={...d},d}var zt=()=>pe("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:pe(Dt,{image:Dt.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),Vt=({error:t,reset:e})=>pe("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:pe(xn,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[pe(bn,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});import vn from"react";import{Skeleton as wn}from"@chatbi-v/ui-shell";import{clsx as Ht}from"clsx";import{twMerge as Cn}from"tailwind-merge";import{jsx as ue,jsxs as tt}from"react/jsx-runtime";var $e=({title:t,icon:e,children:n,source:r,summary:o,variant:a="card",theme:s,hoverable:l=!0,className:d,domNode:m,streamStatus:p,node:c,label:i,value:u,footer:f,precision:y,layout:x,note:g,trend:b,trendValue:h,unit:w,prefix:k,wow:P,yoy:S,sentiment:M,highlights:$,citations:N,actions:I,steps:W,columns:U,rows:X,charts:F,data:Y,subTitle:A,themeColor:lt,backgroundImage:Z,qrCode:We,author:ct,date:dt,...Cr})=>{let{theme:vr}=Oe(),te=a==="plain",wr=s??c?.props?.theme??c?.data?.theme??vr,Sr=Cn(Ht("xcml-card not-prose max-w-full min-w-0 group",te?"p-1":"rounded-md border border-border/80 bg-card shadow-sm p-card mb-6 overflow-hidden","relative transition-all duration-150 ease-out hover:ease-in-out",d,l&&!te?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return tt("div",{className:Sr,"data-theme":wr,...Cr,children:[t&&tt("div",{className:"relative mb-3",children:[!te&&ue("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"}),ue("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:tt("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!te&&ue("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!te&&e&&ue("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]})})]}),ue("div",{className:Ht("xcml-card-body",!te&&"mt-0.5"),children:n})]})};import{jsx as Ie}from"react/jsx-runtime";function v(t,e={}){let{schema:n,getTitle:r,getIcon:o,getVariant:a,renderLoading:s,skeleton:l=!0}=e,d=vn.forwardRef((p,c)=>{let{merged:i,baseProps:u,isLoading:f,streamStatus:y}=yt(p,n);i.delta!==void 0&&i.trendValue===void 0&&(i.trendValue=i.delta);let{className:x,...g}=p,b=r?r(i):i.title,h;b&&(typeof b=="string"?h=b:typeof b=="object"&&(Array.isArray(b)?h=void 0:h=b.text||b.content||JSON.stringify(b)));let w=o?o(i):i.icon,k=a?a(i):u.variant||"card",P=i.hoverable!==void 0?i.hoverable:!0,S={title:h,icon:w,variant:k,hoverable:P,className:x,node:p.node,streamStatus:y,...g};return f?Ie($e,{...S,children:s?s(i):l?Ie(wn,{active:!0,paragraph:{rows:typeof l=="object"?l.rows:2}}):null}):Ie($e,{...S,children:Ie(t,{...i,ref:c})})}),m=t.displayName||t.name||"Component";return d.displayName=`withXCMLCard(${m})`,d}import{jsx as q,jsxs as Xn}from"react/jsx-runtime";import{createElement as Fn}from"react";var Pn=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),Gt={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},Rn=t=>{if(!t)return null;let e=Gt[t.toLowerCase()]||Gt[t],n=kn;if(e&&e in n)return n[e];let r=Pn(t);return r&&r in n?n[r]:t in n?n[t]:null},nt=class extends Sn.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):q(Vt,{error:this.state.error,reset:this.reset}):this.props.children}},Tn=Nn((t,e)=>{let{type:n="line",node:r,theme:o,...a}=t,{theme:s}=Oe(),{containerWidth:l}=Tt(),d=Kt(null),m=Kt(null),p=rt(()=>Bt(n),[n]),c=rt(()=>p?.getComponent()||Rn(n),[p,n]),i=rt(()=>{let g=t.theme||o||s||"light",h=["dark","black","midnight","slate","crimson"].includes(g)?"dark":"light",w=_t(h),k=t.data,P={...t,theme:w,data:k},S=Wt(P,p?.schema||le),M=p?.transformProps?p.transformProps(S):S;return qt(M)},[t,o,s,p]);Jt(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch(g){console.warn("[Chart] Resize failed:",g)}},[l,i.autoFit]),Jt(()=>{if(!d.current)return;let g=new ResizeObserver(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch{}});return g.observe(d.current),()=>{g.disconnect()}},[i.autoFit]);let u=Ln(g=>{m.current=g,typeof e=="function"?e(g):e&&(e.current=g)},[e]);if(!c)return Xn("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 f=i.data&&Array.isArray(i.data)&&i.data.length>0,y=Array.isArray(i.children)&&i.children.some(g=>g.data&&Array.isArray(g.data)&&g.data.length>0);return f||y?q(nt,{type:n,errorPlaceholder:i.errorPlaceholder,children:q(Mn,{fallback:q(Ut,{active:!0}),children:q("div",{ref:d,className:"w-full h-full min-h-[100px]",children:Fn(c,{...i,ref:u,key:n})})})}):q(zt,{})}),je=v(Tn,{schema:le,renderLoading:t=>{let e=t.height||300;return q("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:q(Ut.Image,{active:!0})})}}),Zs=t=>{let{node:e,...n}=t;if(e)return q(je,{node:e});let r={props:{},body:{...n,data:t.data}};return q(je,{node:r})};import{jsx as An}from"react/jsx-runtime";function sl(t){let e=t?.theme;return ne({chart:(r,o)=>An(je,{node:r,theme:e,className:r.props?.className},o)})}import{useMemo as Yt}from"react";import{ArrowUpOutlined as _n,ArrowDownOutlined as On}from"@ant-design/icons";import{jsx as O,jsxs as K}from"react/jsx-runtime";var Zt=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),En=({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,s=32,l=t.map((c,i)=>({x:i/(t.length-1)*a,y:s-(c-n)/o*(s-8)-4})),d=l.reduce((c,i,u,f)=>{if(u===0)return`M ${i.x},${i.y}`;let y=f[u-1],x=(y.x+i.x)/2;return`${c} C ${x},${y.y} ${x},${i.y} ${i.x},${i.y}`},""),m=`${d} L ${a},${s} L 0,${s} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return O("div",{className:`relative group/sparkline ${e}`,children:K("svg",{width:a,height:s,className:"overflow-visible",children:[O("defs",{children:K("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[O("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),O("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),O("path",{d:m,fill:`url(#${p})`}),O("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),O("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},$n=t=>{let{precision:e=0,layout:n="vertical",footer:r,value:o,note:a,trend:s,trendValue:l}=t,d=Yt(()=>{if(l==null)return null;if(typeof l=="number"){let f=Math.abs(l)>=1e4?Zt(l,1):l.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(l).startsWith("+")?`+${f}`:s==="down"&&!String(l).startsWith("-")?`-${f}`:f}return String(l)},[l,e,s]),m=Yt(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?Zt(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),p=s==="up",c=s==="down",i=Array.isArray(s);return 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:[O("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&&O(_n,{className:"mr-1 text-xs"}),c&&O(On,{className:"mr-1 text-xs"}),O("span",{className:"tabular-nums",children:d})]})]}),a&&O("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),i&&O("div",{className:"shrink-0 mb-1",children:O(En,{data:s,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:[O("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:r}),O("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},Qt=v($n,{schema:he,skeleton:{rows:1}});import{jsx as oe,jsxs as jn}from"react/jsx-runtime";var In=t=>{let{description:e,content:n,node:r}=t,o=!!e,a=!!r?.__source&&!(r?.body||r?.data),s=o&&e!==n,l=n||(o&&!s?"":e)||(a?r.__source:"");return jn("div",{className:"flex flex-col gap-4",children:[s&&oe("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:oe(Ze,{content:e})}),oe("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:l?oe(Ze,{content:l}):!s&&oe("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:oe("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},er=v(In,{schema:Ce,skeleton:{rows:2}});import{CheckCircleOutlined as Bn,MinusCircleOutlined as Dn,BorderOutlined as Wn}from"@ant-design/icons";import{Fragment as Vn,jsx as B,jsxs as ae}from"react/jsx-runtime";var qn=({item:t,layout:e,index:n,stripe:r})=>{let{title:o,desc:a,value:s,status:l,type:d="text"}=t;return d==="metric"?ae("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:s}),a&&B("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):ae("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:[ae("div",{className:"mt-1",children:[l==="done"&&B(Bn,{className:"text-success"}),l==="doing"&&B(Dn,{className:"text-primary animate-pulse"}),l==="todo"&&B(Wn,{className:"text-muted-foreground/30"}),!l&&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})]}),ae("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})]})]})},zn=t=>{let{header:e,footer:n,layout:r="grid",columns:o=3,items:a=[],type:s="text",stripe:l=!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 ae(Vn,{children:[e&&B("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),ae("div",{className:d?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((c,i)=>B(qn,{item:{type:s,...c},layout:r,index:i,stripe:l&&i%2===1},i)),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})]})},tr=v(zn,{schema:xe,skeleton:{rows:3}});import Hn from"react";import{jsx as ye}from"react/jsx-runtime";var Kn=()=>{let{items:t}=Nt(),e=Hn.useMemo(()=>t.filter(o=>o.level>1),[t]),n=(o,a)=>{o.preventDefault();let s=document.getElementById(a);s&&s.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 ye("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?ye("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):ye("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>ye("li",{className:`mb-2 text-sm leading-relaxed relative ${r(o.level)}`,children:ye("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))})})},rr=v(Kn,{schema:ve,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});import{useMemo as Jn}from"react";import{Badge as Gn,Tooltip as Un,Table as ie,Progress as Yn}from"@chatbi-v/ui-shell";import{InfoCircleOutlined as nr}from"@ant-design/icons";import{jsx as L,jsxs as J}from"react/jsx-runtime";var Zn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return L("span",{className:"text-muted-foreground/30",children:"-"});let n=Math.min(...t),o=Math.max(...t)-n||1,a=60,s=24,l=t.map((m,p)=>({x:p/(t.length-1)*a,y:s-(m-n)/o*(s-4)-2})),d=l.reduce((m,p,c,i)=>{if(c===0)return`M ${p.x},${p.y}`;let u=i[c-1],f=(u.x+p.x)/2;return`${m} C ${f},${u.y} ${f},${p.y} ${p.x},${p.y}`},"");return L("div",{className:e||"text-primary",children:J("svg",{width:a,height:s,className:"overflow-visible",children:[L("path",{d,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),L("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"2",fill:"currentColor"})]})})},Qn=t=>{let{bordered:e=!0,size:n="middle",summary:r=!1,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=o.length>0&&l.length>0,m=Jn(()=>o.map(c=>({title:J("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[L("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:c.title}),c.desc&&L(Un,{title:c.desc,children:L(nr,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:c.key,key:c.key,align:c.align||"left",flex:1,render:i=>{switch(c.type){case"progress":{let u=typeof i=="string"?parseFloat(i):i,f=u<=1?u*100:u,y="normal";return f>=100?y="success":f<60&&(y="exception"),L("div",{className:"flex items-center gap-2 min-w-24",children:L(Yn,{percent:Math.round(f),size:"small",status:y,showInfo:!0,strokeColor:f>=100?"var(--success)":f<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return L(Zn,{data:Array.isArray(i)?i:[]});case"badge":{let u="default",f=String(i).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(f)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(f)?u="error":["warning","warn","\u8B66\u544A"].includes(f)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(f)&&(u="processing"),L(Gn,{status:u,text:L("span",{className:"text-xs",children:i})})}case"image":return L("img",{src:i,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,i?.toLocaleString?.()??i,c.suffix]});default:return J("span",{className:"text-foreground/90",children:[c.prefix,i,c.suffix]})}}})),[o]);return J("div",{className:"w-full xcml-table-container",children:[L(ie,{dataSource:l,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,i)=>i?.toString()??"",summary:r?c=>!r||!d?null:L(ie.Summary,{fixed:!0,children:L(ie.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((i,u)=>{if(u===0)return L(ie.Summary.Cell,{index:0,children:L("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(i.type==="number"||["amount","value","sales","total"].includes(i.key)))return L(ie.Summary.Cell,{index:u},`summary-${i.key}`);let y=c.reduce((x,g)=>{let b=g[i.key],h=typeof b=="string"?parseFloat(b.replace(/[^0-9.-]/g,"")):b;return x+(typeof h=="number"&&!isNaN(h)?h:0)},0);return L(ie.Summary.Cell,{index:u,align:i.align,children:J("span",{className:"text-primary font-mono",children:[i.prefix,Number.isInteger(y)?y:y.toFixed(2),i.suffix]})},`summary-${i.key}`)})})}):void 0,locale:{emptyText:J("div",{className:"py-12 text-center text-muted-foreground/50 italic flex flex-col items-center gap-2",children:[L("div",{className:"w-12 h-12 rounded-full bg-muted/30 flex items-center justify-center",children:L(nr,{className:"text-xl opacity-20"})}),L("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 ",l.length," rows"]})]})},or=v(Qn,{schema:be,skeleton:{rows:4}});import{jsx as ge}from"react/jsx-runtime";function Ul(t){let e=t?.theme?{"data-theme":t.theme}:{};return ne({metric:(r,o)=>ge(Qt,{node:r,...e},o),card:(r,o)=>ge(er,{node:r,...e},o),list:(r,o)=>ge(tr,{node:r,...e},o),toc:(r,o)=>ge(rr,{node:r,...e},o),table:(r,o)=>ge(or,{node:r,...e},o)})}import{ArrowUpOutlined as eo,ArrowDownOutlined as to,MinusOutlined as ro}from"@ant-design/icons";import no from"react-countup";import{jsx as se,jsxs as Be}from"react/jsx-runtime";var ar=(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?eo:r?ro:to;return Be("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:[se("span",{className:"opacity-70 mr-1",children:e}),se(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},oo=t=>{let{value:e,wow:n,yoy:r,unit:o="",prefix:a="",footer:s,precision:l}=t;return Be("div",{className:"flex flex-col",children:[Be("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:[se("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),se(no,{end:Number(e)||0,decimals:l,separator:",",duration:2.5}),se("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),Be("div",{className:"flex space-x-2 mt-2",children:[ar(n,"\u73AF\u6BD4"),ar(r,"\u540C\u6BD4")]}),s&&se("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},ir=v(oo,{schema:Re,getTitle:t=>t.title||t.label,skeleton:{rows:2}});import{useState as ao}from"react";import{Row as io,Col as so}from"@chatbi-v/ui-shell";import{Line as lo}from"@ant-design/plots";import{jsx as V,jsxs as ot}from"react/jsx-runtime";var co=({item:t})=>{let[e,n]=ao(!1),{label:r,value:o,wow:a,trendData:s=[]}=t,d={data:s.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return ot("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:[V("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),ot("div",{className:"relative z-10",children:[V("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:r}),ot("div",{className:"flex items-end justify-between flex-wrap",children:[V("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&V("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&&V("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:V(lo,{...d})})]})},mo=t=>{let{items:e=[]}=t,n=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return V(io,{gutter:[16,16],children:e.map((r,o)=>V(so,{span:n,children:V(co,{item:r})},o))})},sr=v(mo,{schema:Te,skeleton:{rows:2}});import{useMemo as at}from"react";import{Table as po,Button as uo,Tooltip as yo,Empty as lr}from"@chatbi-v/ui-shell";import{CSVLink as go}from"react-csv";import{DownloadOutlined as fo,TableOutlined as ho,InfoCircleOutlined as bo}from"@ant-design/icons";import{jsx as _,jsxs as H}from"react/jsx-runtime";var xo=t=>{let{title:e,description:n,bordered:r=!0,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,d=at(()=>l.map((i,u)=>({...i,__xcml_row_key:i.__xcml_key||i.id||`row-${u}`})),[l]),m=at(()=>o.map(i=>({...i,dataIndex:i.key||i.dataIndex,title:H("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[_("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:i.title}),i.desc&&_(yo,{title:i.desc,children:_(bo,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:i.align||"left",width:i.width,flex:1,render:u=>{if(u==null||u==="")return _("span",{className:"text-muted-foreground/30 italic",children:"-"});let f=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return _("div",{className:`whitespace-normal break-words ${f?"font-mono":""}`,children:f?u.toLocaleString():u})}})),[o]),p=at(()=>o.map(i=>({label:i.title,key:i.key||i.dataIndex})),[o]),c=d.length>0;return H("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(n||c)&&H("div",{className:"flex items-center justify-between px-1",children:[H("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&H("div",{className:"flex items-center gap-2",children:[_("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:_(ho,{className:"text-sm"})}),_("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),n&&_("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:n})]}),c&&_(go,{data:d,headers:p,filename:`${e||"snapshot"}.csv`,children:_(uo,{size:"small",icon:_(fo,{}),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"})})]}),H("div",{className:"relative group",children:[_(po,{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:_(lr,{image:lr.PRESENTED_IMAGE_SIMPLE,description:_("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),_("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&&H("div",{className:"flex items-center justify-between px-1 mt-1",children:[H("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[_("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",d.length," \u6761\u8BB0\u5F55"]}),H("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},cr=v(xo,{schema:Fe,skeleton:{rows:5}});import Co from"react";import{Button as it,Tooltip as dr}from"@chatbi-v/ui-shell";import{clsx as mr}from"clsx";import{twMerge as vo}from"tailwind-merge";import wo from"react-highlight-words";import{LinkOutlined as So,ThunderboltOutlined as pr,LikeOutlined as Mo,DislikeOutlined as No,InfoCircleOutlined as Lo,CheckCircleOutlined as ko,CloseCircleOutlined as Po,WarningOutlined as Ro,BulbOutlined as yr,RiseOutlined as To,FallOutlined as Xo}from"@ant-design/icons";import{jsx as C,jsxs as z}from"react/jsx-runtime";var ur={positive:{icon:C(To,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:C(Xo,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:C(Ro,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:C(Po,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:C(ko,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:C(yr,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:C(Lo,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},Fo=t=>{let{content:e="",highlights:n=[],sentiment:r="insight",citations:o=[],actions:a=[]}=t,s=re(n),l=re(o),d=re(a),m=ur[r]||ur.insight,p=i=>{de.emit("action_click",{action:i,source:"insight_card"})},c=i=>{de.emit("feedback",{type:i,source:"insight_card",content:e})};return z("div",{className:"flex flex-col gap-5",children:[z("div",{className:vo("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"}),z("div",{className:"relative flex gap-4",children:[C("div",{className:mr("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:Co.cloneElement(m.icon,{className:"text-lg"})}),z("div",{className:"flex-1 space-y-3",children:[z("div",{className:"flex items-center justify-between",children:[C("span",{className:mr("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),z("div",{className:"flex items-center gap-1",children:[C(dr,{title:"\u6709\u5E2E\u52A9",children:C(it,{type:"text",size:"small",icon:C(Mo,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>c("up")})}),C(dr,{title:"\u65E0\u5E2E\u52A9",children:C(it,{type:"text",size:"small",icon:C(No,{}),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(wo,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})}),l.length>0&&C("div",{className:"flex flex-wrap gap-2 pt-2",children:l.map((i,u)=>z("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(So,{className:"text-xs"}),i]},u))})]})]})]}),d.length>0&&z("div",{className:"space-y-3 px-1",children:[z("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(pr,{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((i,u)=>C(it,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(i),children:z("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:i}),C(pr,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},gr=v(Fo,{schema:ke,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>C(yr,{}),getVariant:()=>"plain",skeleton:{rows:4}});import{useRef as Ao,useState as _o}from"react";import{Button as Oo,QRCode as Eo,Select as $o,Space as Io}from"@chatbi-v/ui-shell";import{DownloadOutlined as jo,BgColorsOutlined as Bo}from"@ant-design/icons";import Do from"html2canvas";import{Column as Wo,Line as qo,Pie as zo}from"@ant-design/plots";import{jsx as E,jsxs as G}from"react/jsx-runtime";var De=[{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"}],Vo=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:l,themeColor:d}=t,m=typeof l=="string"?l.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=Ao(null),[c,i]=_o(De[0]),u=d||c.value,f=d?`${d}10`:c.bg,y=async()=>{if(p.current)try{let b=(await Do(p.current,{useCORS:!0,scale:2,backgroundColor:c.bg})).toDataURL("image/png"),h=document.createElement("a");h.href=b,h.download=`poster-${Date.now()}.png`,h.click()}catch(g){console.error("Poster generation failed",g)}},x=(g,b)=>{let h={data:g.data,height:200,autoFit:!0};return g.type==="column"||g.type==="bar"?E(Wo,{...h,xField:"label",yField:"value"},b):g.type==="line"?E(qo,{...h,xField:"label",yField:"value"},b):g.type==="pie"?E(zo,{...h,angleField:"value",colorField:"label"},b):null};return G("div",{className:"flex flex-col",children:[G("div",{className:"flex justify-between items-center mb-4",children:[E(Io,{children:E($o,{value:c.value,onChange:g=>i(De.find(b=>b.value===g)||De[0]),options:De,className:"w-32",suffixIcon:E(Bo,{})})}),E(Oo,{type:"primary",icon:E(jo,{}),onClick:y,children:"\u751F\u6210\u6D77\u62A5"})]}),E("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:f,backgroundImage:m?`url(${m})`:void 0},children:[G("div",{className:"mb-6 text-center",children:[E("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),E("p",{className:"text-sm opacity-70",children:n})]}),E("div",{className:"space-y-6 mb-8",children:r.map((g,b)=>G("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[E("h4",{className:"font-medium mb-2 text-center",children:g.title}),x(g,b)]},b))}),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]}),E("p",{children:s})]}),E("div",{className:"bg-white p-1 rounded",children:E(Eo,{value:o,size:64,bordered:!1})})]})]})})]})},fr=v(Vo,{schema:Xe,skeleton:{rows:4}});import{Tag as Ho,Typography as Ko}from"@chatbi-v/ui-shell";import{CheckCircleFilled as Jo,CloseCircleFilled as Go,LoadingOutlined as Uo,ClockCircleFilled as Yo}from"@ant-design/icons";import{jsx as j,jsxs as Q}from"react/jsx-runtime";var{Text:Zo}=Ko,Qo=t=>{switch(t){case"success":return j(Jo,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return j(Go,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return j(Uo,{className:"text-primary bg-card rounded-full relative z-10"});default:return j(Yo,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},ea=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},ta=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},ra=t=>{let{steps:e=[]}=t;return Q("div",{className:"relative pl-2 py-2",children:[j("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)=>Q("div",{className:"relative flex mb-6 last:mb-0 group",children:[j("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:Qo(n.status)}),Q("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:[Q("div",{className:"flex items-center justify-between mb-2",children:[Q("div",{className:"flex items-center gap-2",children:[j("span",{className:"font-bold text-sm text-foreground",children:n.tool||`\u6B65\u9AA4 ${r+1}`}),j(Zo,{type:"secondary",className:"text-xs text-muted-foreground",children:n.action})]}),Q("div",{className:"flex items-center gap-2",children:[n.duration&&j("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:n.duration}),j(Ho,{color:ta(n.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:ea(n.status)})]})]}),n.thought&&j("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&&j("div",{className:"mt-2 text-xs",children:j("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:j("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&&Q("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))]})},hr=v(ra,{schema:Ae,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});import{useState as br,useEffect as na}from"react";import{Button as st,App as oa,InputNumber as aa}from"@chatbi-v/ui-shell";import{PlusOutlined as ia,MinusOutlined as sa,SaveOutlined as la,LoadingOutlined as ca}from"@ant-design/icons";import da from"react-highlight-words";import{jsx as D,jsxs as fe}from"react/jsx-runtime";var ma=t=>{let{message:e}=oa.useApp(),{label:n="\u62A5\u544A\u6458\u8981",value:r=0,step:o=1,unit:a="",actionId:s="update_summary",content:l="",highlightKeywords:d=[]}=t,[m,p]=br(Number(r)||0),[c,i]=br(!1);na(()=>{p(Number(r)||0)},[r]);let u=re(d),f=x=>{p(x)};return fe("div",{className:"flex flex-col",children:[l&&D("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:D(da,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:l})}),fe("div",{className:"flex items-center justify-between",children:[fe("div",{children:[D("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:n}),fe("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})]})]}),fe("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[D(st,{icon:D(sa,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m-Number(o)),disabled:c}),D(aa,{value:m,onChange:x=>f(Number(x)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:c}),D(st,{icon:D(ia,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>f(m+Number(o)),disabled:c}),D("div",{className:"w-px h-4 bg-border/50 mx-1"}),D(st,{type:"primary",size:"small",shape:"round",icon:c?D(ca,{}):D(la,{}),onClick:async()=>{i(!0);try{de.emit("action",{type:s,payload:{value:m,label:n,...t}}),await new Promise(x=>setTimeout(x,800)),e.success(`\u5DF2\u66F4\u65B0 ${n} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{i(!1)}},loading:c,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},xr=v(ma,{schema:Pe,getTitle:t=>t.label,skeleton:{rows:2}});import{jsx as ee}from"react/jsx-runtime";function bd(t){let e=t?.theme?{"data-theme":t.theme}:{};return ne({"metric-card":(o,a)=>ee(ir,{node:o,...e},a),"mini-kpi-strip":(o,a)=>ee(sr,{node:o,...e},a),"snapshot-table":(o,a)=>ee(cr,{node:o,...e},a),"insight-card":(o,a)=>ee(gr,{node:o,...e},a),"poster-card":(o,a)=>ee(fr,{node:o,...e},a),"thought-chain":(o,a)=>ee(hr,{node:o,...e},a),"interactive-summary":(o,a)=>ee(xr,{node:o,...e},a)},{})}export{je as AntVChartLoader,Mr as COMMON_PROPS,zt as DefaultEmptyPlaceholder,Vt as DefaultErrorPlaceholder,zi as ThemeProvider,$e as XCMLCardWrapper,Zs as XCMLChart,ze as XCMLEventBus,Rt as XCMLLayoutProvider,Ze as XCMLMarkdown,ce as XCML_SCHEMAS,qt as buildConfig,le as chartSchema,Wt as cleanPropsBySchema,Se as columnChartSchema,Et as columnStrategy,sl as createAntVRenderers,Ul as createBasicRenderers,bd as createExtendedRenderers,ne as createRenderersWithAliases,Ee as deepMerge,Ne as dualAxesChartSchema,It as dualAxesStrategy,Ga as extractBaseStyles,Le as funnelChartSchema,jt as funnelStrategy,Bt as getChartStrategy,_t as getTheme,we as lineChartSchema,Ot as lineStrategy,ft as mergePropsAndBody,gt as normalizeNodeData,Ve as normalizeTagName,mi as parse,re as parseArrayProp,Rr as parseInlineData,li as parseXCML,Me as pieChartSchema,$t as pieStrategy,bt as preprocessXCML,Qa as renderXCML,fn as strategies,pi as stringify,si as stringifyToXCML,nn as themeDark,et as themeLight,on as themeMap,me as toXCMLNodeFromElement,_e as toXCMLTag,Lr as toXTag,Oe as useTheme,yt as useXCMLComponent,Tt as useXCMLLayout,ut as useXCMLNode,ii as validateDataSchema,ei as validateXCMLNode,v as withXCMLCard,Li as xTagPlugin,de as xcmlBus};
28
+ `).trim()}import X from"react";import{XMarkdown as Vr}from"@ant-design/x-markdown";import{Button as Hr,Modal as Kr,Tooltip as Jr}from"@chatbi-v/ui-shell";import{CodeOutlined as Gr}from"@ant-design/icons";import Ge,{createContext as Mt,useContext as Nt,useState as $r,useCallback as wt}from"react";import{jsx as St}from"react/jsx-runtime";var Lt=Mt([]),kt=Mt({register:()=>{},unregister:()=>{}}),Br=()=>Nt(Lt),Ue=()=>Nt(kt),Pt=()=>{let t=Br(),{register:e,unregister:r}=Ue();return{items:t,register:e,unregister:r}},Rt=({children:t})=>{let[e,r]=$r(new Map),n=Ge.useRef(0),o=wt(c=>{r(m=>{let p=new Map(m),d=p.get(c.id);return d&&d.title===c.title&&d.level===c.level?m:(p.set(c.id,{...c,index:d?d.index:n.current++}),p)})},[]),a=wt(c=>{r(m=>{let p=new Map(m);return p.delete(c)?p:m})},[]),s=Ge.useMemo(()=>Array.from(e.values()).sort((c,m)=>c.index-m.index),[e]),l=Ge.useMemo(()=>({register:o,unregister:a}),[o,a]);return St(kt.Provider,{value:l,children:St(Lt.Provider,{value:s,children:t})})};import{createContext as jr,useContext as Dr,useState as Wr,useEffect as qr,useRef as Ye}from"react";import{jsx as Tt}from"react/jsx-runtime";var Xt=jr({containerWidth:0}),Ft=({children:t})=>{let[e,r]=Wr(0),n=Ye(null),o=Ye(0),a=Ye(0);return qr(()=>{let s=n.current;if(!s)return;let l=d=>{for(let i of d){let u=i.borderBoxSize?.[0]?.inlineSize??i.contentRect.width,g=Math.floor(u);Math.abs(g-o.current)>=1&&(cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{o.current=g,r(g)}))}},c=new ResizeObserver(l);c.observe(s);let p=s.getBoundingClientRect().width;return o.current=Math.floor(p),r(Math.floor(p)),()=>{c.disconnect(),cancelAnimationFrame(a.current)}},[]),Tt(Xt.Provider,{value:{containerWidth:e},children:Tt("div",{ref:n,className:"xcml-layout-container w-full min-w-0 relative block","data-container-width":e,children:t})})},At=()=>Dr(Xt);function Ri(t={}){let r=`(${(t.tags||["chart","table","metric","list","card","toc"]).join("|")})`,n=new RegExp(`<x-${r}([^>]*)>`,"i");return{level:"block",name:"x-tag",start(o){return o.indexOf("<x-")},tokenizer(o){let a=o.match(n);if(!a)return;let s=a[1],l=a[2]||"",c=a.index||0,m=new RegExp(`</x-${s}>`,"i"),p=o.slice(c+a[0].length),d=p.match(m);if(!d)return;let i=p.slice(0,d.index),u=o.slice(c,c+a[0].length+i.length+d[0].length),g=zr(l);return{type:"x-tag",raw:u,name:s,attrs:g,body:i}},renderer(o){let a=pe(o.name,o.attrs,o.body);return{type:a.type,props:a.props,body:a.body}}}}function zr(t){let e={},r=/(\w[\w-]*)(=\"([^\"]*)\"|=\'([^\']*)\'|=([^\s"']+))?/g,n;for(;n=r.exec(t);){let o=n[1],a=n[3]??n[4]??n[5]??!0;e[o]=a}return e}import{clsx as Ur}from"clsx";import{twMerge as et}from"tailwind-merge";import{jsx as T,jsxs as _t}from"react/jsx-runtime";function tt(t){let{content:e,stream:r,renderers:n,className:o,style:a,openLinksInNewTab:s,dompurifyConfig:l,enableHoverSource:c=!1,theme:m,onContentChange:p,onComponentRender:d}=t;X.useEffect(()=>{e&&p&&p(e)},[e,p]);let i=X.useDeferredValue(e),u=X.useMemo(()=>{let f=n?Object.keys(n).map(y=>y.startsWith("xcml:")?`x-${y.slice(5)}`:y):[];return i?vt(i,f):""},[i,n]),g=X.useMemo(()=>new WeakMap,[]),b=X.useMemo(()=>{let f={};if(n){let h=new Set;Object.keys(n).forEach(v=>{let M=v.startsWith("xcml:"),_=v.startsWith("x-");if(M||_){let L=M?`x-${v.slice(5)}`:v;h.add(L);let k=n[v];f[L]=B=>{let{domNode:S,className:F,streamStatus:O,node:q,children:A,...P}=B,z=g.get(S);if(!z){let Q="",Ve=P["data-xcml-raw"];if(Ve)try{Q=decodeURIComponent(escape(atob(Ve)))}catch(ut){console.error("[XCML] Failed to decode raw body:",ut),Q=Qe(S?.children||[])}else Q=Qe(S?.children||[]);let pt=M?v.slice(5):v.slice(2);z=pe(pt,P,Q),g.set(S,z)}let R={...z};P["data-xcml-loading"]==="true"?R.streamStatus="loading":R.streamStatus=O;let G=k(R,P.key??L);return T(Yr,{tag:L,node:R,className:F,enableHoverSource:c,onStatusChange:Q=>d?.(L,Q),children:G})}}})}f.pre=h=>{let{domNode:v,streamStatus:M,node:_,...L}=h,k=(v?.children||[]).find(F=>F?.name==="code"),B=[k?.attribs?.class,k?.attribs?.classname,k?.attribs?.className].filter(Boolean).join(" ");if(/language-mermaid/.test(B)){let F=Qe(k?.children||[]),O=F.split("").reduce((A,P)=>(A=(A<<5)-A+P.charCodeAt(0),A&A),0),q=`m-${Math.abs(O)}`;return T(Zr,{id:q,code:F,theme:m},h.key)}return X.createElement("pre",L,h.children)},f.p=h=>{let{domNode:v,node:M,children:_,streamStatus:L,...k}=h;return v?.children?.some(S=>S.type==="tag"&&(["div","p","pre","blockquote","table","ul","ol","h1","h2","h3","h4","h5","h6","form","fieldset","address"].includes(S.name)||S.name&&S.name.startsWith("x-")))||M?.children?.some(S=>S.tagName==="div"||S.tagName&&S.tagName.startsWith("x-"))?T("div",{...k,className:et("mb-4 w-full",k.className),children:_}):T("p",{...k,children:_})};let y=X.memo(({level:h,children:v,domNode:M,streamStatus:_,node:L,...k})=>{let{register:B,unregister:S}=Ue(),F=X.useCallback(R=>typeof R=="string"?R:Array.isArray(R)?R.map(F).join(""):X.isValidElement(R)?F(R.props.children):"",[]),O=F(v),q=X.useMemo(()=>O.trim().toLowerCase().replace(/\s+/g,"-"),[O]),A=k.id||q||`h${h}-${Math.random().toString(36).slice(2,9)}`,P=X.useRef(null);X.useEffect(()=>{if(!B)return;let R={id:A,title:O,level:h};return(!P.current||P.current.id!==R.id||P.current.title!==R.title||P.current.level!==R.level)&&(P.current&&S?.(P.current.id),B(R),P.current=R),()=>{P.current&&(S?.(P.current.id),P.current=null)}},[A,O,h,B,S]);let z=`h${h}`;return _t(z,{id:A,className:"scroll-mt-20 group relative",...k,children:[v,c&&T("a",{href:`#${A}`,className:"ml-2 opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity no-underline",children:"#"})]})});return f.h1=h=>T(y,{level:1,...h}),f.h2=h=>T(y,{level:2,...h}),f.h3=h=>T(y,{level:3,...h}),f.h4=h=>T(y,{level:4,...h}),f.h5=h=>T(y,{level:5,...h}),f.h6=h=>T(y,{level:6,...h}),f},[n,c,m]);return T(Ft,{children:T(Rt,{children:T(Vr,{content:u,streaming:r?{hasNextChunk:!0}:void 0,components:b,className:et(Ur("prose w-full max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-code:text-foreground prose-th:text-foreground prose-td:text-foreground prose-a:text-primary prose-code:bg-muted/50 prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-pre:bg-muted/50 prose-pre:text-foreground",o)),style:a,openLinksInNewTab:s,dompurifyConfig:l})})})}function Yr({children:t,tag:e,node:r,className:n,enableHoverSource:o,onStatusChange:a}){let[s,l]=X.useState(!1),[c,m]=X.useState(!1);X.useEffect(()=>{if(a){let i=r?.streamStatus||"success";a(i)}},[r?.streamStatus,a]);let p=i=>{i.stopPropagation(),m(!0)},d=X.useMemo(()=>{let i=Object.entries(r.attributes||{}).map(([u,g])=>`${u}="${g}"`).join(" ");return`<${e}${i?" "+i:""}>${r.children?`
29
+ `+r.children+`
30
+ `:""}</${e}>`},[e,r]);return _t("div",{className:et("not-prose w-full max-w-full overflow-x-hidden overflow-y-visible custom-scrollbar flex flex-col relative",n),onMouseEnter:()=>o&&l(!0),onMouseLeave:()=>o&&l(!1),children:[t,s&&o&&T(Jr,{title:"\u67E5\u770B\u6E90\u7801",children:T(Hr,{icon:T(Gr,{}),size:"small",className:"absolute top-1 right-1 z-10 opacity-80",onClick:p})}),T(Kr,{open:c,onCancel:()=>m(!1),footer:null,width:800,centered:!0,title:`${e} \u6E90\u7801`,destroyOnHidden:!0,children:T("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[500px] text-sm text-foreground",children:d})})]})}var Ze=new WeakMap;function Qe(t){if(!t)return"";if(Ze.has(t))return Ze.get(t);let e=[],r=o=>{o?.forEach(a=>{a&&(a.type==="text"&&typeof a.data=="string"&&e.push(a.data),Array.isArray(a.children)&&r(a.children))})};r(t);let n=e.join("");return Ze.set(t,n),n}var Zr=X.memo(({code:t,theme:e,id:r})=>{let n=X.useRef(null);return X.useEffect(()=>{!n.current||!t||import("mermaid").then(o=>{o.default.initialize({startOnLoad:!0,theme:e==="dark"?"dark":"default",securityLevel:"loose"});let a=r||`mermaid-${Math.random().toString(36).slice(2)}`;o.default.render(a,t).then(({svg:s})=>{n.current&&(n.current.innerHTML=s)})})},[t,e,r]),T("div",{ref:n,className:"mermaid w-full flex justify-center my-4"})});import Ln,{useMemo as it,Suspense as kn,forwardRef as Pn,useRef as Qt,useEffect as er,useCallback as Rn}from"react";import*as Tn from"@ant-design/plots";import{Skeleton as rr}from"@chatbi-v/ui-shell";import{createContext as Qr,useContext as $t,useEffect as en,useState as tn,useMemo as Et,useRef as rn}from"react";import{XProvider as nn}from"@chatbi-v/ui-shell";import{theme as Oe}from"@chatbi-v/ui-shell";import{jsx as rt}from"react/jsx-runtime";var Bt={theme:void 0,setTheme:()=>null,primaryColor:"#6366f1"},nt=Qr(Bt);function Ot(t){if(!t)return;let e=t;for(;e;){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";let r=e.getAttribute("data-theme");if(r)return r;e=e.parentElement}}var Ie={fontFamily:'"Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',borderRadius:8,wireframe:!1},It={light:{algorithm:Oe.defaultAlgorithm,token:{...Ie,colorPrimary:"#6366f1",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#e11d48",colorInfo:"#0ea5e9"}},dark:{algorithm:Oe.darkAlgorithm,token:{...Ie,colorPrimary:"#6366f1",colorBgContainer:"#0f0f11",colorBgLayout:"#0a0a0c"}},ocean:{algorithm:Oe.defaultAlgorithm,token:{...Ie,colorPrimary:"#3b82f6",colorBgContainer:"#f0f9ff",colorBgLayout:"#e0f2fe",colorTextBase:"#0f172a"}},sunset:{algorithm:Oe.defaultAlgorithm,token:{...Ie,colorPrimary:"#f97316",colorBgContainer:"#fff7ed",colorBgLayout:"#ffedd5",colorTextBase:"#431407"}}};function Ki({children:t,defaultTheme:e,theme:r,primaryColor:n,storageKey:o="xcml-ui-theme",scoped:a=!0,className:s,style:l,...c}){let m=$t(nt),p=m.setTheme!==Bt.setTheme,[d,i]=tn(()=>{if(typeof window>"u")return;let y=localStorage.getItem(o);return y||e||(p?m.theme:void 0)}),u=r??d,g=n??(p&&!r&&!e?m.primaryColor:u==="sunset"?"#ea580c":u==="ocean"?"#3b82f6":"#6366f1"),b=rn(null);en(()=>{let y=a?b.current:window.document.documentElement;if(!y)return;let h=u;if(a&&(u==="system"||u===void 0)&&!r&&!e&&!p){let M=Ot(y.parentElement);M&&(h=M)}if(g.startsWith("#")){let M=g.replace(/^#/,""),_=parseInt(M.substring(0,2),16),L=parseInt(M.substring(2,4),16),k=parseInt(M.substring(4,6),16);y.style.setProperty("--primary-rgb",`${_}, ${L}, ${k}`);let B=_/255,S=L/255,F=k/255,O=Math.max(B,S,F),q=Math.min(B,S,F),A=0,P=0,z=(O+q)/2;if(O!==q){let G=O-q;switch(P=z>.5?G/(2-O-q):G/(O+q),O){case B:A=(S-F)/G+(S<F?6:0);break;case S:A=(F-B)/G+2;break;case F:A=(B-S)/G+4;break}A/=6}let R=`${Math.round(A*360)} ${Math.round(P*100)}% ${Math.round(z*100)}%`;y.style.setProperty("--primary",R)}else y.style.setProperty("--primary",g);if(y.classList.remove("light","dark"),y.removeAttribute("data-theme"),!h||h==="inherit")return;let v=["ocean","sunset"];if(h==="system"){let M=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";y.classList.add(M);return}if(h==="dark"){y.classList.add("dark");return}if(h==="light"){y.classList.add("light");return}if(v.includes(h)){y.setAttribute("data-theme",h);return}},[u,a,g,r,e,p]);let x=Et(()=>({theme:u,setTheme:y=>{localStorage.setItem(o,y),i(y)},primaryColor:g}),[u,g,o]),f=Et(()=>{let y=u;if((!y||y==="system")&&(typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?y="dark":y="light",a&&!r&&!e&&!p)){let v=Ot(b.current?.parentElement||null);v&&(y=v)}(!y||y==="inherit"||!It[y])&&(y="light");let h=It[y];return{...h,token:{...h.token,colorPrimary:g}}},[u,g,a,r,e,p]);return rt(nt.Provider,{value:x,...c,children:rt(nn,{theme:f,children:rt("div",{ref:b,className:`xcml-scope text-inherit bg-inherit ${s||""}`,style:l,children:t})})})}var $e=()=>{let t=$t(nt);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var on={label:{style:{fillOpacity:.65,fontSize:12}},title:{style:{fontSize:12,fillOpacity:.85}},grid:{line:{style:{stroke:"#d0d0d0",lineWidth:1,lineDash:[4,4],strokeOpacity:.7}}}},an={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]}}}},ot={defaultColor:"#6366f1",colors10:["#6366f1","#ec4899","#0ea5e9","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6","#14b8a6","#f97316"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:on},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"}}}}}}},sn={defaultColor:"#818cf8",colors10:["#818cf8","#f472b6","#38bdf8","#fbbf24","#34d399","#f87171","#60a5fa","#a78bfa","#2dd4bf","#fb923c"],styleSheet:{backgroundColor:"transparent"},components:{axis:{common:an},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)"}}}}},ln={light:ot,dark:sn,default:ot};function jt(t){return ln[t||"default"]||ot}import cn from"react";var dn=cn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Line}))),Dt={type:"line",schema:Se,getComponent:()=>dn,transformProps:t=>{let e={...t};return e.seriesField&&!e.colorField&&(e.colorField=e.seriesField),e}};import mn from"react";var pn=mn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Column}))),Wt={type:"column",schema:Me,getComponent:()=>pn,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 un from"react";var yn=un.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Pie}))),qt={type:"pie",schema:Ne,getComponent:()=>yn,transformProps:t=>({...t})};import gn from"react";var fn=gn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.DualAxes}))),zt={type:"dual-axes",schema:Le,getComponent:()=>fn,transformProps:t=>{let e={...t};typeof e.width=="number"&&e.width<50&&delete e.width;let r=e.data||[],n=r.length>0?Object.keys(r[0]):[],o=!1;if(e.children&&e.children.length>0&&(o=e.children.every(l=>l.data&&l.data.length>0||n.length===0?!0:l.yField&&n.includes(l.yField)),!o&&n.length>0&&(e.children=[])),(!e.children||e.children.length===0)&&(Array.isArray(e.yField)&&e.yField.length>=2&&(n.length===0||e.yField.every(c=>n.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)&&r.length>0)){let l=e.xField,c=n.filter(m=>m!==l&&typeof r[0][m]=="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(l=>l.data&&Array.isArray(l.data)&&l.data.length>0);if(!a&&s){let{data:l,...c}=e;return c}return e}};import hn from"react";var bn=hn.lazy(()=>import("@ant-design/plots").then(t=>({default:t.Funnel}))),Vt={type:"funnel",schema:ke,getComponent:()=>bn,transformProps:t=>{let e={...t};!e.xField&&e.categoryField&&(e.xField=e.categoryField),!e.yField&&e.valueField&&(e.yField=e.valueField);let r=e.data||[];if(r.length>0){let o=r[0],a=Object.keys(o);e.xField||(e.xField=a.find(s=>typeof o[s]=="string")||"type"),e.yField||(e.yField=a.find(s=>typeof o[s]=="number")||"value"),e.colorField&&!(e.colorField in o)&&(e.xField&&e.xField in o?e.colorField=e.xField:delete e.colorField),e.seriesField&&!(e.seriesField in o)&&delete e.seriesField}e.axis&&delete e.axis;let n=["light","dark","academy"];return e.theme&&!n.includes(e.theme)&&delete e.theme,typeof e.width=="number"&&e.width<100&&delete e.width,e}};var xn={line:Dt,column:Wt,pie:qt,"dual-axes":zt,funnel:Vt};function Ht(t){return t&&xn[t.toLowerCase()]||null}import Cn from"react";import{Empty as Kt,Button as vn,Result as wn}from"@chatbi-v/ui-shell";import{jsx as ue}from"react/jsx-runtime";function Be(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;let r=Array.isArray(t)?[...t]:{...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],a=r[n];typeof o=="object"&&o!==null&&typeof a=="object"&&a!==null&&!Cn.isValidElement(o)?r[n]=Be(a,o):r[n]=o}return r}function Jt(t,e){if(!e)return t;let r={...t},n=[...e.props||[],...e.body||[]];return n.length===0?t:(n.forEach(o=>{let a=o.name;if(o.visibleIf&&!o.visibleIf(r)){delete r[a];return}if(o.default!==void 0&&r[a]===void 0?r[a]=o.default:o.default!==void 0&&typeof o.default=="object"&&o.default!==null&&(r[a]=Be(o.default,r[a])),o.transform){let s=r[a];r[a]=o.transform(s,r)}}),r)}function Gt(t){let{type:e,data:r,theme:n,title:o,__native__:a,...s}=t,l={data:r||[],height:t.height||300,theme:n||"light",autoFit:t.autoFit!==!1,padding:"auto",appendPadding:[20,30,30,20]},c=Be(Be(l,s),a||{});return c.seriesField&&!c.colorField&&(c.colorField=c.seriesField),c.__native__={...c},c}var Ut=()=>ue("div",{className:"w-full h-full flex items-center justify-center border border-dashed border-border rounded-lg bg-muted/30",children:ue(Kt,{image:Kt.PRESENTED_IMAGE_SIMPLE,description:"\u6682\u65E0\u6570\u636E"})}),Yt=({error:t,reset:e})=>ue("div",{className:"w-full h-full flex items-center justify-center p-4 border border-dashed border-destructive/20 rounded bg-destructive/5",children:ue(wn,{status:"error",title:"\u56FE\u8868\u52A0\u8F7D\u5931\u8D25",subTitle:t.message,extra:[ue(vn,{type:"primary",onClick:e,children:"\u91CD\u8BD5"},"retry")]})});import Mn from"react";import{Skeleton as Nn}from"@chatbi-v/ui-shell";import{clsx as Zt}from"clsx";import{twMerge as Sn}from"tailwind-merge";import{jsx as ye,jsxs as at}from"react/jsx-runtime";var je=({title:t,icon:e,children:r,source:n,summary:o,variant:a="card",theme:s,hoverable:l=!0,className:c,domNode:m,streamStatus:p,node:d,label:i,value:u,footer:g,precision:b,layout:x,note:f,trend:y,trendValue:h,unit:v,prefix:M,wow:_,yoy:L,sentiment:k,highlights:B,citations:S,actions:F,steps:O,columns:q,rows:A,charts:P,data:z,subTitle:R,themeColor:G,backgroundImage:Q,qrCode:Ve,author:pt,date:ut,...Lr})=>{let{theme:kr}=$e(),re=a==="plain",Pr=s??d?.props?.theme??d?.data?.theme??kr,Rr=Sn(Zt("xcml-card not-prose max-w-full min-w-0 group",re?"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",c,l&&!re?"hover:shadow-card-hover hover:border-primary/50 hover:bg-card/80":""));return at("div",{className:Rr,"data-theme":Pr,...Lr,children:[t&&at("div",{className:"relative mb-3",children:[!re&&ye("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"}),ye("div",{className:"flex items-center justify-between pb-2.5 border-b border-border/80",children:at("h3",{className:"text-lg font-bold text-foreground leading-snug tracking-tight flex items-center gap-3 whitespace-normal break-words flex-1",children:[!re&&ye("span",{className:"w-1.5 h-6 rounded-full bg-primary/80 shadow-sm shrink-0"}),!re&&e&&ye("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]})})]}),ye("div",{className:Zt("xcml-card-body",!re&&"mt-0.5"),children:r})]})};import{jsx as De}from"react/jsx-runtime";function w(t,e={}){let{schema:r,getTitle:n,getIcon:o,getVariant:a,renderLoading:s,skeleton:l=!0}=e,c=Mn.forwardRef((p,d)=>{let{merged:i,baseProps:u,isLoading:g,streamStatus:b}=ht(p,r);i.delta!==void 0&&i.trendValue===void 0&&(i.trendValue=i.delta);let{className:x,...f}=p,y=n?n(i):i.title,h;y&&(typeof y=="string"?h=y:typeof y=="object"&&(Array.isArray(y)?h=void 0:h=y.text||y.content||JSON.stringify(y)));let v=o?o(i):i.icon,M=a?a(i):u.variant||"card",_=i.hoverable!==void 0?i.hoverable:!0,L={title:h,icon:v,variant:M,hoverable:_,className:x,node:p.node,streamStatus:b,...f};return g?De(je,{...L,children:s?s(i):l?De(Nn,{active:!0,paragraph:{rows:typeof l=="object"?l.rows:2}}):null}):De(je,{...L,children:De(t,{...i,ref:d})})}),m=t.displayName||t.name||"Component";return c.displayName=`withXCMLCard(${m})`,c}import{jsx as V,jsxs as _n}from"react/jsx-runtime";import{createElement as En}from"react";var Xn=t=>typeof t!="string"||!t?"":t.split(/[-_ ]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),tr={"dual-axes":"DualAxes",column:"Column",line:"Line",pie:"Pie",funnel:"Funnel"},Fn=t=>{if(!t)return null;let e=tr[t.toLowerCase()]||tr[t],r=Tn;if(e&&e in r)return r[e];let n=Xn(t);return n&&n in r?r[n]:t in r?r[t]:null},st=class extends Ln.Component{constructor(r){super(r);this.reset=()=>{this.setState({hasError:!1,error:null})};this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error(`AntV Chart Error (${this.props.type}):`,r,n)}render(){return this.state.hasError&&this.state.error?this.props.errorPlaceholder?this.props.errorPlaceholder(this.state.error,this.reset):V(Yt,{error:this.state.error,reset:this.reset}):this.props.children}},An=Pn((t,e)=>{let{type:r="line",node:n,theme:o,...a}=t,{theme:s}=$e(),{containerWidth:l}=At(),c=Qt(null),m=Qt(null),p=it(()=>Ht(r),[r]),d=it(()=>p?.getComponent()||Fn(r),[p,r]),i=it(()=>{let f=t.theme||o||s||"light",h=f==="dark"||f==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",v=jt(h),M=t.data,_={...t,theme:v,data:M},L=Jt(_,p?.schema||ce),k=p?.transformProps?p.transformProps(L):L;return Gt(k)},[t,o,s,p]);er(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch(f){console.warn("[Chart] Resize failed:",f)}},[l,i.autoFit]),er(()=>{if(!c.current)return;let f=new ResizeObserver(()=>{if(m.current&&i.autoFit!==!1)try{m.current.render()}catch{}});return f.observe(c.current),()=>{f.disconnect()}},[i.autoFit]);let u=Rn(f=>{m.current=f,typeof e=="function"?e(f):e&&(e.current=f)},[e]);if(!d)return _n("div",{className:"w-full p-4 border border-dashed border-amber-200 text-amber-600 rounded bg-amber-50/50 text-xs",children:["\u672A\u627E\u5230\u56FE\u8868\u7C7B\u578B: ",r]});let g=i.data&&Array.isArray(i.data)&&i.data.length>0,b=Array.isArray(i.children)&&i.children.some(f=>f.data&&Array.isArray(f.data)&&f.data.length>0);return g||b?(delete i["data-xcml-raw"],delete i.__native__,V(st,{type:r,errorPlaceholder:i.errorPlaceholder,children:V(kn,{fallback:V(rr,{active:!0}),children:V("div",{ref:c,className:"w-full h-full min-h-[100px]",children:En(d,{...i,ref:u,key:r})})})})):V(Ut,{})}),We=w(An,{schema:ce,renderLoading:t=>{let e=t.height||300;return V("div",{className:"w-full flex justify-center items-center bg-muted/10 rounded-lg animate-pulse",style:{height:e},children:V(rr.Image,{active:!0})})}}),tl=t=>{let{node:e,...r}=t;if(e)return V(We,{node:e});let n={props:{},body:{...r,data:t.data}};return V(We,{node:n})};import{jsx as On}from"react/jsx-runtime";function dl(t){let e=t?.theme;return oe({chart:(n,o)=>On(We,{node:n,theme:e,className:n.props?.className},o)})}import{useMemo as nr}from"react";import{ArrowUpOutlined as In,ArrowDownOutlined as $n}from"@ant-design/icons";import{jsx as I,jsxs as U}from"react/jsx-runtime";var or=(t,e=1)=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:e}).format(t),Bn=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return null;let r=Math.min(...t),o=Math.max(...t)-r||1,a=80,s=32,l=t.map((d,i)=>({x:i/(t.length-1)*a,y:s-(d-r)/o*(s-8)-4})),c=l.reduce((d,i,u,g)=>{if(u===0)return`M ${i.x},${i.y}`;let b=g[u-1],x=(b.x+i.x)/2;return`${d} C ${x},${b.y} ${x},${i.y} ${i.x},${i.y}`},""),m=`${c} L ${a},${s} L 0,${s} Z`,p=`sparkline-gradient-${Math.random().toString(36).slice(2,9)}`;return I("div",{className:`relative group/sparkline ${e}`,children:U("svg",{width:a,height:s,className:"overflow-visible",children:[I("defs",{children:U("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[I("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.25"}),I("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),I("path",{d:m,fill:`url(#${p})`}),I("path",{d:c,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-all duration-300"}),I("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"3",fill:"currentColor",className:"animate-pulse shadow-sm"})]})})},jn=t=>{let{precision:e=0,layout:r="vertical",footer:n,value:o,note:a,trend:s,trendValue:l}=t,c=nr(()=>{if(l==null)return null;if(typeof l=="number"){let g=Math.abs(l)>=1e4?or(l,1):l.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e});return s==="up"&&!String(l).startsWith("+")?`+${g}`:s==="down"&&!String(l).startsWith("-")?`-${g}`:g}return String(l)},[l,e,s]),m=nr(()=>{if(o==null)return"-";let u=typeof o=="string"&&o!==""&&!isNaN(Number(o))?Number(o):o;return typeof u=="number"?Math.abs(u)>=1e6?or(u,1):u.toLocaleString(void 0,{minimumFractionDigits:e,maximumFractionDigits:e}):String(o)},[o,e]),p=s==="up",d=s==="down",i=Array.isArray(s);return U("div",{className:"flex flex-col h-full justify-between",children:[U("div",{className:`flex ${r==="horizontal"?"flex-row items-end justify-between":"flex-col"} gap-4`,children:[U("div",{className:"flex flex-col min-w-0",children:[U("div",{className:"flex items-baseline gap-2 mb-2 flex-wrap",children:[I("span",{className:"text-3xl font-bold text-foreground tracking-tight leading-none",children:m}),c&&U("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":d?"bg-destructive/5 text-destructive border-destructive/20":"bg-muted/5 text-muted-foreground border-muted/20"}`,children:[p&&I(In,{className:"mr-1 text-xs"}),d&&I($n,{className:"mr-1 text-xs"}),I("span",{className:"tabular-nums",children:c})]})]}),a&&I("div",{className:"text-sm text-muted-foreground leading-relaxed font-medium line-clamp-2",title:a,children:a})]}),i&&I("div",{className:"shrink-0 mb-1",children:I(Bn,{data:s,className:p?"text-success":d?"text-destructive":"text-primary"})})]}),n&&U("div",{className:"mt-4 pt-3 border-t border-border/50 flex items-center justify-between",children:[I("span",{className:"text-xs text-muted-foreground/70 font-medium tracking-wide",children:n}),I("div",{className:"w-1.5 h-1.5 rounded-full bg-primary/20 animate-pulse"})]})]})},ar=w(jn,{schema:be,skeleton:{rows:1}});import{jsx as ae,jsxs as Wn}from"react/jsx-runtime";var Dn=t=>{let{description:e,content:r,node:n}=t,o=!!e,a=!!n?.__source&&!(n?.body||n?.data),s=o&&e!==r,l=r||(o&&!s?"":e)||(a?n.__source:"");return Wn("div",{className:"flex flex-col gap-4",children:[s&&ae("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:ae(tt,{content:e})}),ae("div",{className:"text-muted-foreground leading-relaxed prose prose-sm max-w-none",children:l?ae(tt,{content:l}):!s&&ae("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:ae("span",{children:"\u6682\u65E0\u5185\u5BB9"})})})]})},ir=w(Dn,{schema:ve,skeleton:{rows:2}});import{CheckCircleOutlined as qn,MinusCircleOutlined as zn,BorderOutlined as Vn}from"@ant-design/icons";import{Fragment as Jn,jsx as D,jsxs as ie}from"react/jsx-runtime";var Hn=({item:t,layout:e,index:r,stripe:n})=>{let{title:o,desc:a,value:s,status:l,type:c="text"}=t;return c==="metric"?ie("div",{className:`bg-muted/30 rounded-lg p-card-half border border-border hover:border-primary/20 transition-colors group ${n?"bg-muted/50":""}`,children:[D("div",{className:"text-xs text-muted-foreground mb-1 font-medium",children:o}),D("div",{className:"text-xl font-bold text-card-foreground group-hover:text-primary transition-colors",children:s}),a&&D("div",{className:"text-xs text-muted-foreground/60 mt-1 whitespace-pre-wrap",children:a})]}):ie("div",{className:`flex items-start gap-3 p-card-half bg-muted/40 border border-border rounded-lg hover:shadow-card-hover hover:border-primary/30 transition-all group ${e==="list"?"w-full":""} ${n?"bg-muted/60":""}`,children:[ie("div",{className:"mt-1",children:[l==="done"&&D(qn,{className:"text-success"}),l==="doing"&&D(zn,{className:"text-primary animate-pulse"}),l==="todo"&&D(Vn,{className:"text-muted-foreground/30"}),!l&&D("div",{className:"w-4 h-4 rounded-full bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold group-hover:bg-primary/10 group-hover:text-primary transition-colors",children:r+1})]}),ie("div",{className:"flex-1 min-w-0",children:[D("div",{className:"text-sm font-medium text-card-foreground whitespace-normal break-words group-hover:text-primary transition-colors",children:o}),a&&D("div",{className:"text-xs text-muted-foreground mt-0.5 whitespace-normal break-words whitespace-pre-wrap",children:a})]})]})},Kn=t=>{let{header:e,footer:r,layout:n="grid",columns:o=3,items:a=[],type:s="text",stripe:l=!1}=t,c=n==="grid",p={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4",5:"grid-cols-2 md:grid-cols-5",6:"grid-cols-3 md:grid-cols-6"}[o]||"grid-cols-1 md:grid-cols-3";return ie(Jn,{children:[e&&D("div",{className:"mb-3 text-sm text-muted-foreground",children:e}),ie("div",{className:c?`grid ${p} gap-card-gap`:"flex flex-col space-y-card-gap",children:[a.map((d,i)=>D(Hn,{item:{type:s,...d},layout:n,index:i,stripe:l&&i%2===1},i)),a.length===0&&D("div",{className:"text-center py-8 text-muted-foreground/50 text-xs italic",children:"\u6682\u65E0\u5217\u8868\u9879"})]}),r&&D("div",{className:"mt-card-gap pt-3 border-t border-border/40 text-xs text-muted-foreground text-right",children:r})]})},sr=w(Kn,{schema:Ce,skeleton:{rows:3}});import Gn from"react";import{jsx as ge}from"react/jsx-runtime";var Un=()=>{let{items:t}=Pt(),e=Gn.useMemo(()=>t.filter(o=>o.level>1),[t]),r=(o,a)=>{o.preventDefault();let s=document.getElementById(a);s&&s.scrollIntoView({behavior:"smooth"})},n=o=>{switch(o){case 2:return"pl-4";case 3:return"pl-8";case 4:return"pl-12";case 5:return"pl-16";case 6:return"pl-20";default:return"pl-4"}};return ge("div",{className:"text-sm text-muted-foreground w-full",children:e.length===0?ge("div",{className:"text-muted-foreground text-xs",children:"\u6682\u65E0\u76EE\u5F55"}):ge("ul",{className:"list-none p-0 m-0 ml-2 border-l-2 border-border",children:e.map(o=>ge("li",{className:`mb-2 text-sm leading-relaxed relative ${n(o.level)}`,children:ge("a",{href:`#${o.id}`,onClick:a=>r(a,o.id),className:"text-foreground no-underline cursor-pointer transition-colors hover:text-primary hover:underline",children:o.title})},o.id))})})},lr=w(Un,{schema:we,getTitle:t=>t.title||"\u76EE\u5F55",skeleton:{rows:4}});import{useMemo as Yn}from"react";import{Badge as Zn,Tooltip as Qn,Table as se,Progress as eo}from"@chatbi-v/ui-shell";import{InfoCircleOutlined as cr}from"@ant-design/icons";import{jsx as N,jsxs as Y}from"react/jsx-runtime";var to=({data:t,className:e})=>{if(!Array.isArray(t)||t.length<2)return N("span",{className:"text-muted-foreground/30",children:"-"});let r=Math.min(...t),o=Math.max(...t)-r||1,a=60,s=24,l=t.map((m,p)=>({x:p/(t.length-1)*a,y:s-(m-r)/o*(s-4)-2})),c=l.reduce((m,p,d,i)=>{if(d===0)return`M ${p.x},${p.y}`;let u=i[d-1],g=(u.x+p.x)/2;return`${m} C ${g},${u.y} ${g},${p.y} ${p.x},${p.y}`},"");return N("div",{className:e||"text-primary",children:Y("svg",{width:a,height:s,className:"overflow-visible",children:[N("path",{d:c,fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),N("circle",{cx:l[l.length-1].x,cy:l[l.length-1].y,r:"2",fill:"currentColor"})]})})},ro=t=>{let{bordered:e=!0,size:r="middle",summary:n=!1,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,c=o.length>0&&l.length>0,m=Yn(()=>o.map(d=>({title:Y("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:d.title}),d.desc&&N(Qn,{title:d.desc,children:N(cr,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),dataIndex:d.key,key:d.key,align:d.align||"left",flex:1,render:i=>{switch(d.type){case"progress":{let u=typeof i=="string"?parseFloat(i):i,g=u<=1?u*100:u,b="normal";return g>=100?b="success":g<60&&(b="exception"),N("div",{className:"flex items-center gap-2 min-w-24",children:N(eo,{percent:Math.round(g),size:"small",status:b,showInfo:!0,strokeColor:g>=100?"var(--success)":g<60?"var(--destructive)":void 0,className:"mb-0"})})}case"trend":return N(to,{data:Array.isArray(i)?i:[]});case"badge":{let u="default",g=String(i).toLowerCase();return["success","\u5B8C\u6210","\u6B63\u5E38","ok","pass"].includes(g)?u="success":["error","fail","\u5931\u8D25","\u5F02\u5E38"].includes(g)?u="error":["warning","warn","\u8B66\u544A"].includes(g)?u="warning":["processing","running","\u8FDB\u884C\u4E2D"].includes(g)&&(u="processing"),N(Zn,{status:u,text:N("span",{className:"text-xs",children:i})})}case"image":return N("img",{src:i,alt:"",className:"h-8 w-8 rounded-sm object-cover border border-border/50 shadow-sm"});case"number":return Y("span",{className:"font-mono text-foreground/90 font-medium",children:[d.prefix,i?.toLocaleString?.()??i,d.suffix]});default:return Y("span",{className:"text-foreground/90",children:[d.prefix,i,d.suffix]})}}})),[o]);return Y("div",{className:"w-full xcml-table-container",children:[N(se,{dataSource:l,columns:m,pagination:!1,size:r==="large"?"middle":"small",bordered:e,className:"xcml-custom-table [&_.ant-table]:!bg-transparent [&_.ant-table]:text-sm [&_.ant-table-thead_tr_th]:!bg-muted/40 [&_.ant-table-thead_tr_th]:border-b [&_.ant-table-thead_tr_th]:border-border/60 [&_.ant-table-thead_tr_th]:!py-3 [&_.ant-table-thead_tr_th]:!px-4 [&_.ant-table-tbody_tr_td]:border-b [&_.ant-table-tbody_tr_td]:border-border/30 [&_.ant-table-tbody_tr_td]:!py-2.5 [&_.ant-table-tbody_tr_td]:!px-4 [&_.ant-table-tbody_tr_td]:transition-all [&_.ant-table-tbody_tr_td]:duration-150 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:rounded-md [&_.ant-table-container]:overflow-hidden",scroll:{x:"max-content"},rowKey:(d,i)=>i?.toString()??"",summary:n?d=>!n||!c?null:N(se.Summary,{fixed:!0,children:N(se.Summary.Row,{className:"bg-primary/5 font-bold",children:o.map((i,u)=>{if(u===0)return N(se.Summary.Cell,{index:0,children:N("span",{className:"text-primary font-bold",children:"\u5408\u8BA1"})},"summary-label");if(!(i.type==="number"||["amount","value","sales","total"].includes(i.key)))return N(se.Summary.Cell,{index:u},`summary-${i.key}`);let b=d.reduce((x,f)=>{let y=f[i.key],h=typeof y=="string"?parseFloat(y.replace(/[^0-9.-]/g,"")):y;return x+(typeof h=="number"&&!isNaN(h)?h:0)},0);return N(se.Summary.Cell,{index:u,align:i.align,children:Y("span",{className:"text-primary font-mono",children:[i.prefix,Number.isInteger(b)?b:b.toFixed(2),i.suffix]})},`summary-${i.key}`)})})}):void 0,locale:{emptyText:Y("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(cr,{className:"text-xl opacity-20"})}),N("span",{children:"\u6682\u65E0\u6570\u636E"})]})}}),!n&&c&&Y("div",{className:"py-2 text-xs text-muted-foreground/40 italic text-right px-4",children:["Total ",l.length," rows"]})]})},dr=w(ro,{schema:xe,skeleton:{rows:4}});import{jsx as fe}from"react/jsx-runtime";function Ql(t){let e=t?.theme?{"data-theme":t.theme}:{};return oe({metric:(n,o)=>fe(ar,{node:n,...e},o),card:(n,o)=>fe(ir,{node:n,...e},o),list:(n,o)=>fe(sr,{node:n,...e},o),toc:(n,o)=>fe(lr,{node:n,...e},o),table:(n,o)=>fe(dr,{node:n,...e},o)})}import{ArrowUpOutlined as no,ArrowDownOutlined as oo,MinusOutlined as ao}from"@ant-design/icons";import io from"react-countup";import{jsx as le,jsxs as qe}from"react/jsx-runtime";var mr=(t,e)=>{if(t==null)return null;let r=t>0,n=t===0,o=r?"text-success bg-success/5":n?"text-muted-foreground/40":"text-destructive bg-destructive/5",a=r?no:n?ao:oo;return qe("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:[le("span",{className:"opacity-70 mr-1",children:e}),le(a,{className:"mr-0.5 text-xs"}),Math.abs(t),"%"]})},so=t=>{let{value:e,wow:r,yoy:n,unit:o="",prefix:a="",footer:s,precision:l}=t;return qe("div",{className:"flex flex-col",children:[qe("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:[le("span",{className:"text-2xl mr-1 text-muted-foreground/60 font-bold align-baseline",children:a}),le(io,{end:Number(e)||0,decimals:l,separator:",",duration:2.5}),le("span",{className:"text-base ml-1 font-semibold text-muted-foreground/50 align-baseline",children:o})]}),qe("div",{className:"flex space-x-2 mt-2",children:[mr(r,"\u73AF\u6BD4"),mr(n,"\u540C\u6BD4")]}),s&&le("div",{className:"mt-card-gap pt-2 border-t border-border/40 text-xs text-muted-foreground italic whitespace-pre-wrap leading-normal",children:s})]})},pr=w(so,{schema:Te,getTitle:t=>t.title||t.label,skeleton:{rows:2}});import{useState as lo}from"react";import{Row as co,Col as mo}from"@chatbi-v/ui-shell";import{Line as po}from"@ant-design/plots";import{jsx as K,jsxs as lt}from"react/jsx-runtime";var uo=({item:t})=>{let[e,r]=lo(!1),{label:n,value:o,wow:a,trendData:s=[]}=t,c={data:s.map((m,p)=>({index:p,value:m})),xField:"index",yField:"value",height:30,padding:0,axis:!1,legend:!1,tooltip:!1,smooth:!0,line:{style:{stroke:"hsl(var(--primary))",lineWidth:2}}};return lt("div",{className:"p-3 border border-border/60 rounded-lg hover:shadow-card hover:border-primary/30 transition-all relative bg-muted/40 text-card-foreground min-h-[6rem] flex flex-col justify-between group overflow-hidden",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[K("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-transparent group-hover:bg-primary/20 transition-colors"}),lt("div",{className:"relative z-10",children:[K("div",{className:"text-muted-foreground text-xs mb-1 font-medium whitespace-normal break-words",children:n}),lt("div",{className:"flex items-end justify-between flex-wrap",children:[K("span",{className:"text-xl font-bold tracking-tight whitespace-normal break-words",children:o}),a!==void 0&&K("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&&K("div",{className:`absolute bottom-0 left-0 right-0 h-8 transition-opacity duration-300 ${e?"opacity-100":"opacity-40"}`,children:K(po,{...c})})]})},yo=t=>{let{items:e=[]}=t,r=e.length>0?Math.floor(24/Math.min(e.length,4)):6;return K(co,{gutter:[16,16],children:e.map((n,o)=>K(mo,{span:r,children:K(uo,{item:n})},o))})},ur=w(yo,{schema:Xe,skeleton:{rows:2}});import{useMemo as ct}from"react";import{Table as go,Button as fo,Tooltip as ho,Empty as yr}from"@chatbi-v/ui-shell";import{CSVLink as bo}from"react-csv";import{DownloadOutlined as xo,TableOutlined as Co,InfoCircleOutlined as vo}from"@ant-design/icons";import{jsx as E,jsxs as J}from"react/jsx-runtime";var wo=t=>{let{title:e,description:r,bordered:n=!0,columns:o=[],rows:a=[],dataSource:s=[]}=t,l=s.length>0?s:a,c=ct(()=>l.map((i,u)=>({...i,__xcml_row_key:i.__xcml_key||i.id||`row-${u}`})),[l]),m=ct(()=>o.map(i=>({...i,dataIndex:i.key||i.dataIndex,title:J("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[E("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground/70",children:i.title}),i.desc&&E(ho,{title:i.desc,children:E(vo,{className:"text-xs cursor-help opacity-40 hover:opacity-100 text-primary transition-opacity"})})]}),ellipsis:!0,align:i.align||"left",width:i.width,flex:1,render:u=>{if(u==null||u==="")return E("span",{className:"text-muted-foreground/30 italic",children:"-"});let g=typeof u=="number"||!isNaN(Number(u))&&String(u).trim()!=="";return E("div",{className:`whitespace-normal break-words ${g?"font-mono":""}`,children:g?u.toLocaleString():u})}})),[o]),p=ct(()=>o.map(i=>({label:i.title,key:i.key||i.dataIndex})),[o]),d=c.length>0;return J("div",{className:"flex flex-col gap-4 xcml-snapshot-table-container",children:[(r||d)&&J("div",{className:"flex items-center justify-between px-1",children:[J("div",{className:"flex flex-col gap-0.5",children:[!t.title&&e&&J("div",{className:"flex items-center gap-2",children:[E("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:E(Co,{className:"text-sm"})}),E("h4",{className:"text-sm font-bold text-foreground/90 m-0 leading-none",children:e})]}),r&&E("p",{className:`text-xs text-muted-foreground m-0 leading-relaxed ${!t.title&&e?"mt-1 pl-9":"pl-1"}`,children:r})]}),d&&E(bo,{data:c,headers:p,filename:`${e||"snapshot"}.csv`,children:E(fo,{size:"small",icon:E(xo,{}),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"})})]}),J("div",{className:"relative group",children:[E(go,{columns:m,dataSource:c,rowKey:"__xcml_row_key",pagination:c.length>10?{pageSize:10,size:"small",showSizeChanger:!1,className:"mt-4 px-2"}:!1,scroll:{x:"max-content"},className:"xcml-custom-snapshot-table [&_.ant-table]:!bg-transparent [&_.ant-table]:!text-xs [&_.ant-table-thead_tr_th]:!bg-muted/30 [&_.ant-table-thead_tr_th]:!border-b [&_.ant-table-thead_tr_th]:!border-border/60 [&_.ant-table-thead_tr_th]:!py-2.5 [&_.ant-table-thead_tr_th]:!px-3 [&_.ant-table-thead_tr_th]:!text-foreground/70 [&_.ant-table-tbody_tr_td]:!border-b [&_.ant-table-tbody_tr_td]:!border-border/30 [&_.ant-table-tbody_tr_td]:!py-2 [&_.ant-table-tbody_tr_td]:!px-3 hover:[&_.ant-table-tbody_tr_td]:!bg-primary/5 [&_.ant-table-container]:!rounded-md [&_.ant-table-container]:!overflow-hidden [&_.ant-table-bordered_.ant-table-container]:!border-border/50 [&_.ant-pagination-item-active]:!border-primary [&_.ant-pagination-item-active]:!bg-primary/5 [&_.ant-pagination-item-active_a]:!text-primary",bordered:n,size:"small",locale:{emptyText:E(yr,{image:yr.PRESENTED_IMAGE_SIMPLE,description:E("span",{className:"text-muted-foreground/50 italic",children:"\u6682\u65E0\u5FEB\u7167\u6570\u636E"}),className:"py-8"})}}),E("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"})]}),d&&J("div",{className:"flex items-center justify-between px-1 mt-1",children:[J("span",{className:"text-xs text-muted-foreground/50 italic flex items-center gap-1.5",children:[E("span",{className:"w-1 h-1 rounded-full bg-primary/40"}),"\u5171 ",c.length," \u6761\u8BB0\u5F55"]}),J("span",{className:"text-xs text-muted-foreground/30",children:["Last updated: ",new Date().toLocaleTimeString()]})]})]})},gr=w(wo,{schema:Ae,skeleton:{rows:5}});import So from"react";import{Button as dt,Tooltip as fr}from"@chatbi-v/ui-shell";import{clsx as hr}from"clsx";import{twMerge as Mo}from"tailwind-merge";import No from"react-highlight-words";import{LinkOutlined as Lo,ThunderboltOutlined as br,LikeOutlined as ko,DislikeOutlined as Po,InfoCircleOutlined as Ro,CheckCircleOutlined as To,CloseCircleOutlined as Xo,WarningOutlined as Fo,BulbOutlined as Cr,RiseOutlined as Ao,FallOutlined as _o}from"@ant-design/icons";import{jsx as C,jsxs as H}from"react/jsx-runtime";var xr={positive:{icon:C(Ao,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u589E\u957F"},negative:{icon:C(_o,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u98CE\u9669"},warning:{icon:C(Fo,{}),color:"text-warning",bg:"bg-warning/5",border:"border-warning/20",label:"\u8B66\u544A"},error:{icon:C(Xo,{}),color:"text-destructive",bg:"bg-destructive/5",border:"border-destructive/20",label:"\u5F02\u5E38"},success:{icon:C(To,{}),color:"text-success",bg:"bg-success/5",border:"border-success/20",label:"\u6210\u529F"},insight:{icon:C(Cr,{}),color:"text-primary",bg:"bg-primary/5",border:"border-primary/20",label:"\u53D1\u73B0"},neutral:{icon:C(Ro,{}),color:"text-muted-foreground",bg:"bg-muted/5",border:"border-muted/20",label:"\u63D0\u793A"}},Eo=t=>{let{content:e="",highlights:r=[],sentiment:n="insight",citations:o=[],actions:a=[]}=t,s=ne(r),l=ne(o),c=ne(a),m=xr[n]||xr.insight,p=i=>{me.emit("action_click",{action:i,source:"insight_card"})},d=i=>{me.emit("feedback",{type:i,source:"insight_card",content:e})};return H("div",{className:"flex flex-col gap-5",children:[H("div",{className:Mo("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"}),H("div",{className:"relative flex gap-4",children:[C("div",{className:hr("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:So.cloneElement(m.icon,{className:"text-lg"})}),H("div",{className:"flex-1 space-y-3",children:[H("div",{className:"flex items-center justify-between",children:[C("span",{className:hr("text-xs font-bold uppercase tracking-[0.15em]",m.color),children:m.label}),H("div",{className:"flex items-center gap-1",children:[C(fr,{title:"\u6709\u5E2E\u52A9",children:C(dt,{type:"text",size:"small",icon:C(ko,{}),className:"text-muted-foreground/40 hover:text-primary transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>d("up")})}),C(fr,{title:"\u65E0\u5E2E\u52A9",children:C(dt,{type:"text",size:"small",icon:C(Po,{}),className:"text-muted-foreground/40 hover:text-destructive transition-colors h-6 w-6 flex items-center justify-center",onClick:()=>d("down")})})]})]}),C("div",{className:"text-sm leading-relaxed font-medium text-foreground/90",children:C(No,{highlightClassName:"bg-primary/10 text-primary border-b-2 border-primary/30 font-bold px-0.5 mx-0.5",searchWords:s,autoEscape:!0,textToHighlight:e})}),l.length>0&&C("div",{className:"flex flex-wrap gap-2 pt-2",children:l.map((i,u)=>H("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"}),i]},u))})]})]})]}),c.length>0&&H("div",{className:"space-y-3 px-1",children:[H("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(br,{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:c.map((i,u)=>C(dt,{type:"default",className:"group relative h-9 px-4 rounded-xl border-dashed border-primary/30 hover:border-primary hover:bg-primary/5 transition-all overflow-hidden",onClick:()=>p(i),children:H("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:i}),C(br,{className:"text-amber-400 opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all"})]})},u))})]})]})},vr=w(Eo,{schema:Pe,getTitle:t=>t.title||"\u6570\u636E\u6D1E\u5BDF",getIcon:t=>C(Cr,{}),getVariant:()=>"plain",skeleton:{rows:4}});import{useRef as Oo,useState as Io}from"react";import{Button as $o,QRCode as Bo,Select as jo,Space as Do}from"@chatbi-v/ui-shell";import{DownloadOutlined as Wo,BgColorsOutlined as qo}from"@ant-design/icons";import zo from"html2canvas";import{Column as Vo,Line as Ho,Pie as Ko}from"@ant-design/plots";import{jsx as $,jsxs as Z}from"react/jsx-runtime";var ze=[{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"}],Jo=t=>{let{title:e="\u6570\u636E\u6D77\u62A5",subTitle:r="Data Insight Poster",charts:n=[],qrCode:o="https://ant.design",author:a="ChatBI",date:s=new Date().toLocaleDateString(),backgroundImage:l,themeColor:c}=t,m=typeof l=="string"?l.trim().replace(/^[`'" ]|[`'" ]$/g,"").trim().replace(/^[`'" ]|[`'" ]$/g,""):void 0,p=Oo(null),[d,i]=Io(ze[0]),u=c||d.value,g=c?`${c}10`:d.bg,b=async()=>{if(p.current)try{let y=(await zo(p.current,{useCORS:!0,scale:2,backgroundColor:d.bg})).toDataURL("image/png"),h=document.createElement("a");h.href=y,h.download=`poster-${Date.now()}.png`,h.click()}catch(f){console.error("Poster generation failed",f)}},x=(f,y)=>{let h={data:f.data,height:200,autoFit:!0};return f.type==="column"||f.type==="bar"?$(Vo,{...h,xField:"label",yField:"value"},y):f.type==="line"?$(Ho,{...h,xField:"label",yField:"value"},y):f.type==="pie"?$(Ko,{...h,angleField:"value",colorField:"label"},y):null};return Z("div",{className:"flex flex-col",children:[Z("div",{className:"flex justify-between items-center mb-4",children:[$(Do,{children:$(jo,{value:d.value,onChange:f=>i(ze.find(y=>y.value===f)||ze[0]),options:ze,className:"w-32",suffixIcon:$(qo,{})})}),$($o,{type:"primary",icon:$(Wo,{}),onClick:b,children:"\u751F\u6210\u6D77\u62A5"})]}),$("div",{className:"flex-1 overflow-auto border border-border rounded-lg shadow-sm bg-muted/10 min-h-0 flex flex-col",children:Z("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:g,backgroundImage:m?`url(${m})`:void 0},children:[Z("div",{className:"mb-6 text-center",children:[$("h1",{className:"text-2xl font-bold mb-2",style:{color:u},children:e}),$("p",{className:"text-sm opacity-70",children:r})]}),$("div",{className:"space-y-6 mb-8",children:n.map((f,y)=>Z("div",{className:"bg-white p-4 rounded-lg shadow-sm opacity-90",children:[$("h4",{className:"font-medium mb-2 text-center",children:f.title}),x(f,y)]},y))}),Z("div",{className:"flex items-center justify-between mt-auto pt-8 border-t border-border/40 border-dashed",children:[Z("div",{className:"text-xs text-muted-foreground",children:[Z("p",{children:["Created by ",a]}),$("p",{children:s})]}),$("div",{className:"bg-white p-1 rounded",children:$(Bo,{value:o,size:64,bordered:!1})})]})]})})]})},wr=w(Jo,{schema:Fe,skeleton:{rows:4}});import{Tag as Go,Typography as Uo}from"@chatbi-v/ui-shell";import{CheckCircleFilled as Yo,CloseCircleFilled as Zo,LoadingOutlined as Qo,ClockCircleFilled as ea}from"@ant-design/icons";import{jsx as j,jsxs as ee}from"react/jsx-runtime";var{Text:ta}=Uo,ra=t=>{switch(t){case"success":return j(Yo,{className:"text-success bg-card rounded-full relative z-10 shadow-sm"});case"failure":return j(Zo,{className:"text-destructive bg-card rounded-full relative z-10 shadow-sm"});case"running":return j(Qo,{className:"text-primary bg-card rounded-full relative z-10"});default:return j(ea,{className:"text-muted-foreground/40 bg-card rounded-full relative z-10"})}},na=t=>{switch(t){case"success":return"\u6210\u529F";case"failure":return"\u5931\u8D25";case"running":return"\u6267\u884C\u4E2D";default:return t}},oa=t=>{switch(t){case"success":return"success";case"failure":return"error";case"running":return"processing";default:return"default"}},aa=t=>{let{steps:e=[]}=t;return ee("div",{className:"relative pl-2 py-2",children:[j("div",{className:"absolute top-4 bottom-4 left-[15px] w-0.5 bg-gradient-to-b from-primary/10 via-primary/30 to-primary/10"}),e.map((r,n)=>ee("div",{className:"relative flex mb-6 last:mb-0 group",children:[j("div",{className:"mr-4 mt-0.5 text-lg transition-transform duration-300 group-hover:scale-110",children:ra(r.status)}),ee("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:[ee("div",{className:"flex items-center justify-between mb-2",children:[ee("div",{className:"flex items-center gap-2",children:[j("span",{className:"font-bold text-sm text-foreground",children:r.tool||`\u6B65\u9AA4 ${n+1}`}),j(ta,{type:"secondary",className:"text-xs text-muted-foreground",children:r.action})]}),ee("div",{className:"flex items-center gap-2",children:[r.duration&&j("span",{className:"text-xs font-mono text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded-md",children:r.duration}),j(Go,{color:oa(r.status),bordered:!1,className:"mr-0 text-xs px-1.5 rounded-full",children:na(r.status)})]})]}),r.thought&&j("div",{className:"mb-2 text-xs text-muted-foreground italic border-l-2 border-primary/30 pl-2 py-1 bg-primary/5 rounded-r-md whitespace-pre-wrap leading-normal",children:r.thought}),r.result&&j("div",{className:"mt-2 text-xs",children:j("div",{className:"bg-muted/30 border border-border/40 rounded-lg p-2 overflow-x-auto custom-scrollbar",children:j("pre",{className:"m-0 whitespace-pre-wrap font-mono text-xs text-muted-foreground leading-relaxed",children:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2)})})}),r.error&&ee("div",{className:"mt-2 text-xs text-destructive bg-destructive/5 p-2 rounded-lg border border-destructive/20 whitespace-pre-wrap",children:["\u9519\u8BEF: ",r.error]})]})]},n))]})},Sr=w(aa,{schema:_e,getTitle:t=>t.title||"\u601D\u7EF4\u94FE",skeleton:!0});import{useState as Mr,useEffect as ia}from"react";import{Button as mt,App as sa,InputNumber as la}from"@chatbi-v/ui-shell";import{PlusOutlined as ca,MinusOutlined as da,SaveOutlined as ma,LoadingOutlined as pa}from"@ant-design/icons";import ua from"react-highlight-words";import{jsx as W,jsxs as he}from"react/jsx-runtime";var ya=t=>{let{message:e}=sa.useApp(),{label:r="\u62A5\u544A\u6458\u8981",value:n=0,step:o=1,unit:a="",actionId:s="update_summary",content:l="",highlightKeywords:c=[]}=t,[m,p]=Mr(Number(n)||0),[d,i]=Mr(!1);ia(()=>{p(Number(n)||0)},[n]);let u=ne(c),g=x=>{p(x)};return he("div",{className:"flex flex-col",children:[l&&W("div",{className:"mb-4 text-muted-foreground leading-normal whitespace-pre-wrap",children:W(ua,{highlightClassName:"bg-primary/20 text-primary rounded px-1 font-medium",searchWords:u,autoEscape:!0,textToHighlight:l})}),he("div",{className:"flex items-center justify-between",children:[he("div",{children:[W("div",{className:"text-muted-foreground mb-1 text-xs font-medium uppercase tracking-wider",children:r}),he("div",{className:"text-3xl font-black text-foreground flex items-baseline tracking-tight",children:[m,W("span",{className:"text-sm font-semibold text-muted-foreground/60 ml-1.5",children:a})]})]}),he("div",{className:"flex items-center space-x-1 bg-muted/40 p-1.5 rounded-xl border border-border/30 shadow-inner",children:[W(mt,{icon:W(da,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>g(m-Number(o)),disabled:d}),W(la,{value:m,onChange:x=>g(Number(x)),variant:"borderless",className:"w-20 text-center bg-transparent font-bold text-foreground",controls:!1,disabled:d}),W(mt,{icon:W(ca,{}),size:"small",shape:"circle",type:"text",className:"hover:bg-background hover:text-primary hover:shadow-sm",onClick:()=>g(m+Number(o)),disabled:d}),W("div",{className:"w-px h-4 bg-border/50 mx-1"}),W(mt,{type:"primary",size:"small",shape:"round",icon:d?W(pa,{}):W(ma,{}),onClick:async()=>{i(!0);try{me.emit("action",{type:s,payload:{value:m,label:r,...t}}),await new Promise(x=>setTimeout(x,800)),e.success(`\u5DF2\u66F4\u65B0 ${r} \u8BBE\u5B9A\u503C`)}catch{e.error("\u63D0\u4EA4\u5931\u8D25")}finally{i(!1)}},loading:d,className:"ml-1 px-3 shadow-md shadow-primary/20 hover:shadow-primary/40 transition-all",children:"\u4FDD\u5B58"})]})]})]})},Nr=w(ya,{schema:Re,getTitle:t=>t.label,skeleton:{rows:2}});import{jsx as te}from"react/jsx-runtime";function vd(t){let e=t?.theme?{"data-theme":t.theme}:{};return oe({"metric-card":(o,a)=>te(pr,{node:o,...e},a),"mini-kpi-strip":(o,a)=>te(ur,{node:o,...e},a),"snapshot-table":(o,a)=>te(gr,{node:o,...e},a),"insight-card":(o,a)=>te(vr,{node:o,...e},a),"poster-card":(o,a)=>te(wr,{node:o,...e},a),"thought-chain":(o,a)=>te(Sr,{node:o,...e},a),"interactive-summary":(o,a)=>te(Nr,{node:o,...e},a)},{})}export{We as AntVChartLoader,Tr as COMMON_PROPS,Ut as DefaultEmptyPlaceholder,Yt as DefaultErrorPlaceholder,Ki as ThemeProvider,je as XCMLCardWrapper,tl as XCMLChart,Ke as XCMLEventBus,Ft as XCMLLayoutProvider,tt as XCMLMarkdown,de as XCML_SCHEMAS,Gt as buildConfig,ce as chartSchema,Jt as cleanPropsBySchema,Me as columnChartSchema,Wt as columnStrategy,dl as createAntVRenderers,Ql as createBasicRenderers,vd as createExtendedRenderers,oe as createRenderersWithAliases,Be as deepMerge,Le as dualAxesChartSchema,zt as dualAxesStrategy,Za as extractBaseStyles,ke as funnelChartSchema,Vt as funnelStrategy,Ht as getChartStrategy,jt as getTheme,Se as lineChartSchema,Dt as lineStrategy,xt as mergePropsAndBody,bt as normalizeNodeData,Je as normalizeTagName,yi as parse,ne as parseArrayProp,Er as parseInlineData,mi as parseXCML,Ne as pieChartSchema,qt as pieStrategy,vt as preprocessXCML,ri as renderXCML,xn as strategies,gi as stringify,di as stringifyToXCML,sn as themeDark,ot as themeLight,ln as themeMap,pe as toXCMLNodeFromElement,Ee as toXCMLTag,Fr as toXTag,$e as useTheme,ht as useXCMLComponent,At as useXCMLLayout,ft as useXCMLNode,ci as validateDataSchema,ni as validateXCMLNode,w as withXCMLCard,Ri as xTagPlugin,me as xcmlBus};