@chatbi-v/xcml 2.1.0 → 2.1.2

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