ziya 0.1.49__py3-none-any.whl → 0.1.50__py3-none-any.whl

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.

Potentially problematic release.


This version of ziya might be problematic. Click here for more details.

Files changed (49) hide show
  1. app/agents/.agent.py.swp +0 -0
  2. app/agents/agent.py +315 -113
  3. app/agents/models.py +439 -0
  4. app/agents/prompts.py +32 -4
  5. app/main.py +70 -7
  6. app/server.py +403 -14
  7. app/utils/code_util.py +641 -215
  8. pyproject.toml +2 -3
  9. templates/asset-manifest.json +18 -20
  10. templates/index.html +1 -1
  11. templates/static/css/{main.87f30840.css → main.2bddf34e.css} +2 -2
  12. templates/static/css/main.2bddf34e.css.map +1 -0
  13. templates/static/js/46907.90c6a4f3.chunk.js +2 -0
  14. templates/static/js/46907.90c6a4f3.chunk.js.map +1 -0
  15. templates/static/js/56122.1d6a5c10.chunk.js +3 -0
  16. templates/static/js/56122.1d6a5c10.chunk.js.LICENSE.txt +9 -0
  17. templates/static/js/56122.1d6a5c10.chunk.js.map +1 -0
  18. templates/static/js/83953.61a908f4.chunk.js +3 -0
  19. templates/static/js/83953.61a908f4.chunk.js.map +1 -0
  20. templates/static/js/88261.1e90079d.chunk.js +3 -0
  21. templates/static/js/88261.1e90079d.chunk.js.map +1 -0
  22. templates/static/js/{96603.863a8f96.chunk.js → 96603.18c5d644.chunk.js} +2 -2
  23. templates/static/js/{96603.863a8f96.chunk.js.map → 96603.18c5d644.chunk.js.map} +1 -1
  24. templates/static/js/{97902.75670155.chunk.js → 97902.d1e262d6.chunk.js} +3 -3
  25. templates/static/js/{97902.75670155.chunk.js.map → 97902.d1e262d6.chunk.js.map} +1 -1
  26. templates/static/js/main.9b2b2b57.js +3 -0
  27. templates/static/js/{main.ee8b3c96.js.LICENSE.txt → main.9b2b2b57.js.LICENSE.txt} +8 -2
  28. templates/static/js/main.9b2b2b57.js.map +1 -0
  29. {ziya-0.1.49.dist-info → ziya-0.1.50.dist-info}/METADATA +4 -5
  30. {ziya-0.1.49.dist-info → ziya-0.1.50.dist-info}/RECORD +36 -35
  31. templates/static/css/main.87f30840.css.map +0 -1
  32. templates/static/js/23416.c33f07ab.chunk.js +0 -3
  33. templates/static/js/23416.c33f07ab.chunk.js.map +0 -1
  34. templates/static/js/3799.fedb612f.chunk.js +0 -2
  35. templates/static/js/3799.fedb612f.chunk.js.map +0 -1
  36. templates/static/js/46907.4a730107.chunk.js +0 -2
  37. templates/static/js/46907.4a730107.chunk.js.map +0 -1
  38. templates/static/js/64754.cf383335.chunk.js +0 -2
  39. templates/static/js/64754.cf383335.chunk.js.map +0 -1
  40. templates/static/js/88261.33450351.chunk.js +0 -3
  41. templates/static/js/88261.33450351.chunk.js.map +0 -1
  42. templates/static/js/main.ee8b3c96.js +0 -3
  43. templates/static/js/main.ee8b3c96.js.map +0 -1
  44. /templates/static/js/{23416.c33f07ab.chunk.js.LICENSE.txt → 83953.61a908f4.chunk.js.LICENSE.txt} +0 -0
  45. /templates/static/js/{88261.33450351.chunk.js.LICENSE.txt → 88261.1e90079d.chunk.js.LICENSE.txt} +0 -0
  46. /templates/static/js/{97902.75670155.chunk.js.LICENSE.txt → 97902.d1e262d6.chunk.js.LICENSE.txt} +0 -0
  47. {ziya-0.1.49.dist-info → ziya-0.1.50.dist-info}/LICENSE +0 -0
  48. {ziya-0.1.49.dist-info → ziya-0.1.50.dist-info}/WHEEL +0 -0
  49. {ziya-0.1.49.dist-info → ziya-0.1.50.dist-info}/entry_points.txt +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[64754],{81661:(e,t,a)=>{a.d(t,{J:()=>u});var r=a(89379),i=a(65043),n=a(79901),s=a(91686),o=a(66158),l=a(51252);const c=[{name:"network-diagram",priority:1,canHandle:e=>"object"===typeof e&&!e.render&&"network"===e.type&&Array.isArray(e.nodes)&&Array.isArray(e.links)&&e.nodes.length>0&&e.links.length>0&&e.nodes.every((e=>"string"===typeof e.id&&e.id))&&e.links.every((e=>"string"===typeof e.source&&"string"===typeof e.target)),render:(e,t,a)=>{var r;if(console.debug("Network diagram plugin rendering:",a),!function(e){return"object"===typeof e&&"network"===e.type&&Array.isArray(e.nodes)&&Array.isArray(e.links)&&e.nodes.every((e=>"string"===typeof e.id))&&e.links.every((e=>"string"===typeof e.source&&"string"===typeof e.target))}(a))throw new Error("Invalid network diagram specification");console.debug("Network diagram render:",{nodeCount:a.nodes.length,linkCount:a.links.length,groupCount:null===(r=a.groups)||void 0===r?void 0:r.length});try{var i;const r=t.select(e).append("svg").attr("width",a.width).attr("height",a.height).attr("viewBox",[0,0,a.width,a.height]);if(null!==(i=a.groups)&&void 0!==i&&i.length){const e=r.selectAll(".board").data(a.groups).enter().append("g").attr("class","board").attr("transform","translate(0,0)");e.append("rect").attr("x",(e=>"modem_board"===e.id?180:680)).attr("y",50).attr("width",(e=>"modem_board"===e.id?350:200)).attr("height",500).attr("fill","none").attr("stroke","#666").attr("stroke-dasharray","5,5"),e.append("text").attr("x",(e=>"modem_board"===e.id?200:700)).attr("y",80).text((e=>e.label)).attr("fill","#666")}}catch(n){throw console.error("Network diagram render error:",n),t.select(e).selectAll("*").remove(),n}}}];c.forEach((e=>{if(!e.name)throw new Error("Plugin missing required name property");if("number"!==typeof e.priority)throw new Error("Plugin ".concat(e.name," missing required priority number"));if("function"!==typeof e.canHandle)throw new Error("Plugin ".concat(e.name," missing required canHandle function"));if("function"!==typeof e.render)throw new Error("Plugin ".concat(e.name," missing required render function"))}));const d=Object.freeze(c);var p=a(70579);const u=e=>{let{spec:t,width:a=600,height:c=400,containerId:u,type:m="auto",onLoad:h,onError:g,config:y}=e;const{isDarkMode:f}=(0,n.D)(),v=(0,i.useRef)(null),x=(0,i.useRef)(null),w=(0,i.useRef)(null),[b,A]=(0,i.useState)(!0),[M,k]=(0,i.useState)(null),[j,S]=(0,i.useState)([]),C=(0,i.useRef)(null),F=(0,i.useRef)(null),P=(0,i.useRef)(0),R=(0,i.useRef)(!0);(0,i.useEffect)((()=>()=>{if(console.debug("D3Renderer cleanup triggered"),w.current){try{w.current.finalize(),w.current=null}catch(e){}console.debug("Vega view finalized")}x.current&&(F.current&&(F.current.stop(),F.current=null),x.current.innerHTML="",C.current&&(C.current(),C.current=null))}),[]),(0,i.useEffect)((()=>{const e=++P.current;console.debug("Starting render #".concat(e));const i=async()=>{A(!0);try{if(!t)throw new Error("No specification provided");let s,p;try{if("string"===typeof t){if(p=t.replace(/\r\n/g,"\n").split("\n").map((e=>e.trim())).filter((e=>!e.trim().startsWith("//")&&""!==e.trim())),!p.length||!p.some((e=>e.includes("}"))))return void A(!0);const e=p.join("\n").replace(/\/\*[\s\S]*?\*\//g,"");s=JSON.parse(e)}else s=t}catch(i){return A(!0),void console.debug("Waiting for complete spec:",i)}if(!s)return;if("d3"===m||"d3"===s.renderer||"function"===typeof s.render){const t=x.current;if(!t)return;if(e!==P.current)return void console.debug("Skipping stale render #".concat(e));if(F.current)try{F.current.stop(),F.current=null}catch(n){console.warn("Error cleaning up simulation:",n)}const a=document.createElement("div");a.style.width="100%",a.style.height="100%";let r=!1;try{if(s.render&&"function"===typeof s.render){const e=s.render.call(s,a,l);r=!0,"function"===typeof e&&(C.current=e)}else{const e=function(e){if(e.visualizationType){const t=d.find((t=>t.name===e.visualizationType));if(t)return t}const t=d.filter((t=>t.canHandle(e))).sort(((e,t)=>t.priority-e.priority));if(t.length>0)return console.debug("Found ".concat(t.length," matching plugins:"),t.map((e=>"".concat(e.name," (priority: ").concat(e.priority,")")))),t[0]}(s);if(!e)throw new Error("No render function or compatible plugin found");e.render(a,l,s),r=!0}r&&(t.innerHTML="",t.appendChild(a))}catch(M){throw console.error("D3 render error:",M),k(M instanceof Error?M.message:"Render failed"),M}if(!r)throw new Error("Render did not complete successfully");return A(!1),k(null),void(null===h||void 0===h||h())}const u=v.current;if(!u)return;const g=(0,r.A)({$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:a||"container",height:c||300,mark:s.type||"point",data:{values:Array.isArray(s.data)?s.data:[s.data]},encoding:s.encoding||{x:{field:"x",type:"quantitative"},y:{field:"y",type:"quantitative"}}},s);w.current&&(w.current.finalize(),w.current=null),console.debug("Rendering Vega spec:",g);const y=await(0,o.Ay)(u,g,{actions:!1,theme:f?"dark":"excel",renderer:"canvas"});if(!R.current)return void y.view.finalize();w.current=y.view,A(!1),null===h||void 0===h||h()}catch(n){console.error("Visualization error:",n),"Unexpected end of JSON input"!==n.message&&(k(n.message),S([n.message])),A(!1)}};return R.current&&i(),()=>{R.current=!1}}),[t,m,a,c,f]);const z="d3"===m||"object"===typeof t&&("d3"===t.renderer||"function"===typeof t.render);return(0,p.jsx)("div",{id:u||"d3-container",style:{width:"100%",height:c||"300px",minHeight:"200px",padding:"16px",position:"relative"},children:z?(0,p.jsx)("div",{ref:x,className:"d3-container",style:{width:"100%",height:"100%",position:"relative"}}):(0,p.jsxs)("div",{ref:v,id:"vega-container",style:{position:"relative",width:"100%",height:c||"100%"},children:[(b||!t)&&(0,p.jsxs)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.1)"},children:[(0,p.jsx)(s.A,{size:"large"}),(0,p.jsx)("div",{style:{marginTop:"10px",color:f?"#ffffff":"#000000"},children:"Preparing visualization..."})]}),M&&(0,p.jsxs)("pre",{style:{padding:"16px",margin:"8px",backgroundColor:f?"#2a1215":"#fff1f0",border:"1px solid ".concat(f?"#5c2223":"#ffa39e"),borderRadius:"4px",color:f?"#ff4d4f":"#cf1322",whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"200px",overflowY:"auto",fontSize:"14px",lineHeight:"1.5",fontFamily:"monospace"},children:[(0,p.jsx)("strong",{children:"Error:"}),j.map(((e,t)=>(0,p.jsx)("div",{children:e},t)))]})]})})}},64754:(e,t,a)=>{a.r(t),a.d(t,{D3Test:()=>F,default:()=>P});var r=a(65043),i=a(23927),n=a(6051),s=a(89073),o=a(12624),l=a(96603),c=a(76399),d=a(97606),p=a(4015),u=a(8354),m=a(99472),h=a(81661),g=a(1199),y=a(79129),f=a(17260),v=a(43240),x=a(40295),w=a(60458),b=a(41334),A=a(53159),M=a(70579);const{Title:k,Text:j,Paragraph:S}=i.A,C=[{title:"Simple Vertical Bars",description:"Basic bar chart with single series and value labels",type:"simple",category:"bar",testedFeatures:["Basic bars","Value labels","Tooltips"],status:"working",spec:{type:"bar",data:[{label:"A",value:10},{label:"B",value:20},{label:"C",value:15},{label:"D",value:25},{label:"E",value:18}],options:{interactive:!0,valueLabels:!0,yAxis:{label:"Values"},xAxis:{label:"Categories"}}}},{title:"Grouped Bar Chart",description:"Multiple series with grouping and custom colors",type:"complex",category:"bar",testedFeatures:["Grouped bars","Custom colors","Legend","Interactive tooltips"],status:"working",spec:{type:"bar",data:[{label:"Q1",value:1e3,group:"2023",color:"#ff4d4f"},{label:"Q2",value:1200,group:"2023",color:"#ff4d4f"},{label:"Q3",value:900,group:"2023",color:"#ff4d4f"},{label:"Q4",value:1500,group:"2023",color:"#ff4d4f"},{label:"Q1",value:800,group:"2024",color:"#40a9ff"},{label:"Q2",value:1400,group:"2024",color:"#40a9ff"}],options:{grouped:!0,animation:!0,interactive:!0,legend:!0}}},{title:"Stacked Bar Chart",description:"Stacked bars with multiple categories",type:"complex",category:"bar",testedFeatures:["Stacked bars","Percentage view","Category colors"],status:"working",spec:{type:"bar",data:[{label:"Product A",categories:[{name:"Revenue",value:500},{name:"Costs",value:300},{name:"Profit",value:200}]},{label:"Product B",categories:[{name:"Revenue",value:800},{name:"Costs",value:400},{name:"Profit",value:400}]},{label:"Product C",categories:[{name:"Revenue",value:400},{name:"Costs",value:200},{name:"Profit",value:200}]}],options:{stacked:!0,percentage:!1,interactive:!0,animation:!0}}},{title:"Bars with Negative Values",description:"Bar chart showing positive and negative values",type:"complex",category:"bar",testedFeatures:["Negative values","Zero line","Value coloring"],status:"working",spec:{type:"bar",data:[{label:"Jan",value:50},{label:"Feb",value:-30},{label:"Mar",value:25},{label:"Apr",value:-45},{label:"May",value:60},{label:"Jun",value:-20}],options:{zeroLine:!0,valueColors:!0,interactive:!0}}},{title:"Simple Line Chart",description:"Basic line chart with smooth interpolation",type:"simple",category:"line",testedFeatures:["Line interpolation","Point markers","Hover effects"],status:"working",spec:{type:"line",data:Array.from({length:10},((e,t)=>({date:"2024-".concat(t+1),value:10*Math.sin(t/2)+20}))),options:{interactive:!0,points:!0,smooth:!0,yAxis:{label:"Values"},xAxis:{label:"Time"}}}},{title:"Multiple Line Series",description:"Multiple lines with different scales and patterns",type:"complex",category:"line",testedFeatures:["Multiple series","Different scales","Pattern variations"],status:"working",spec:{type:"line",data:{series:[{name:"Temperature",values:Array.from({length:24},((e,t)=>({date:"2024-".concat(t+1),value:10*Math.sin(t/3)+20}))),pattern:"solid"},{name:"Pressure",values:Array.from({length:24},((e,t)=>({date:"2024-".concat(t+1),value:100*Math.cos(t/4)+1e3}))),pattern:"dashed"},{name:"Humidity",values:Array.from({length:24},((e,t)=>({date:"2024-".concat(t+1),value:20*Math.sin(t/6)+50}))),pattern:"dotted"}]},options:{interactive:!0,legend:!0,multiScale:!0}}},{title:"Area Chart",description:"Stacked area chart with gradient fills",type:"complex",category:"line",testedFeatures:["Area fills","Gradients","Stacking"],status:"working",spec:{type:"line",data:{series:[{name:"Series A",values:Array.from({length:12},((e,t)=>({date:"2024-".concat(t+1),value:50*Math.random()+50}))),fill:"gradient"},{name:"Series B",values:Array.from({length:12},((e,t)=>({date:"2024-".concat(t+1),value:40*Math.random()+30}))),fill:"gradient"},{name:"Series C",values:Array.from({length:12},((e,t)=>({date:"2024-".concat(t+1),value:30*Math.random()+20}))),fill:"gradient"}]},options:{stacked:!0,area:!0,interactive:!0}}},{title:"Step Function Chart",description:"Step-wise line chart with transitions",type:"simple",category:"line",testedFeatures:["Step interpolation","Transitions","Value labels"],status:"working",spec:{type:"line",data:Array.from({length:10},((e,t)=>({date:"2024-".concat(t+1),value:10*Math.floor(5*Math.random())}))),options:{step:!0,valueLabels:!0,animation:{duration:1e3,sequential:!0}}}},{title:"Real-time Data Simulation",description:"Live updating line chart with sliding window",type:"complex",category:"line",testedFeatures:["Real-time updates","Sliding window","Smooth transitions"],status:"working",spec:{type:"line",data:Array.from({length:30},((e,t)=>({date:new Date(Date.now()-1e3*(30-t)).toISOString(),value:10*Math.sin(t/5)+20+5*Math.random()}))),options:{realtime:!0,windowSize:30,updateInterval:1e3,smoothing:!0}}},{title:"Basic Scatter Plot",description:"Simple scatter plot with hover interactions",type:"simple",category:"scatter",testedFeatures:["Basic points","Hover effects","Tooltips"],status:"working",spec:{type:"scatter",data:Array.from({length:50},(()=>({x:100*Math.random(),y:100*Math.random(),label:"Point"}))),options:{interactive:!0,tooltip:!0}}},{title:"Advanced Bubble Chart",description:"Bubble chart with size, color, and category mapping",type:"complex",category:"bubble",testedFeatures:["Size mapping","Color gradients","Categories","Custom tooltips"],status:"working",spec:{type:"bubble",data:Array.from({length:30},((e,t)=>({x:100*Math.random(),y:100*Math.random(),size:50*Math.random()+10,category:"Group ".concat(Math.floor(t/10)),value:1e3*Math.random(),color:"hsl(".concat(360*Math.random(),", 70%, 50%)")}))),options:{sizeScale:{field:"value",range:[10,50]},colorScale:{field:"category",scheme:"category10"},legend:!0,interactive:!0}}},{title:"Quadrant Analysis",description:"Scatter plot with quadrant divisions and statistics",type:"complex",category:"scatter",testedFeatures:["Quadrants","Statistics","Reference lines","Annotations"],status:"working",spec:{type:"scatter",data:Array.from({length:100},(()=>({x:100*(Math.random()-.5),y:100*(Math.random()-.5),category:Math.random()>.5?"A":"B"}))),options:{quadrants:{labels:["High-High","High-Low","Low-Low","Low-High"],stats:!0},referenceLines:!0,annotations:!0}}},{title:"Correlation Plot",description:"Scatter plot with regression line and confidence interval",type:"complex",category:"scatter",testedFeatures:["Regression line","Confidence interval","R-squared","Outliers"],status:"working",spec:{type:"scatter",data:Array.from({length:50},((e,t)=>{const a=2*t+10*Math.random();return{x:a,y:.5*a+20*Math.random()-10}})),options:{regression:{type:"linear",showConfidence:!0,showEquation:!0},outlierDetection:!0}}},{title:"Mathematical Functions",description:"Multiple mathematical functions with interactive features",type:"complex",category:"function",testedFeatures:["Multiple functions","Interactive domain","Function composition"],status:"working",spec:{type:"function",data:[{fn:"Math.sin(x)",domain:[-2*Math.PI,2*Math.PI],label:"sin(x)"},{fn:"Math.cos(x)",domain:[-2*Math.PI,2*Math.PI],label:"cos(x)"},{fn:"Math.sin(x) * Math.cos(x)",domain:[-2*Math.PI,2*Math.PI],label:"sin(x)cos(x)"}],options:{interactive:!0,grid:!0,legend:!0}}},{title:"Parametric Equations",description:"Parametric function visualization with animation",type:"complex",category:"function",testedFeatures:["Parametric equations","Animation","Path tracing"],status:"working",spec:{type:"function",data:[{parameterX:"Math.cos(3*t) * (1 + 0.5 * Math.cos(5*t))",parameterY:"Math.sin(2*t) * (1 + 0.5 * Math.sin(7*t))",domain:[0,2*Math.PI],label:"Rose Curve",samples:500}],options:{animation:{duration:5e3,repeat:!0},pathTrace:!0}}},{title:"Statistical Distributions",description:"Various probability distributions with interactive parameters",type:"complex",category:"function",testedFeatures:["Multiple distributions","Parameter controls","Area highlighting"],status:"working",spec:{type:"function",data:[{fn:"Math.exp(-Math.pow(x-0, 2)/(2*Math.pow(1,2)))/(Math.sqrt(2*Math.PI))",domain:[-4,4],label:"Normal(0,1)",fill:!0},{fn:"Math.exp(-x)*Math.pow(x,2)/2",domain:[0,10],label:"Gamma(3,1)",fill:!0}],options:{interactive:!0,parameters:{mean:[-2,2],variance:[.5,2]}}}},{title:"Dual Axis Comparison",description:"Two different metrics with independent scales",type:"complex",category:"multiaxis",testedFeatures:["Dual axes","Independent scales","Mixed types"],status:"working",spec:{type:"multiaxis",data:{x:Array.from({length:12},((e,t)=>t+1)),series:[{name:"Revenue",values:Array.from({length:12},(()=>1e3*Math.random()+500)),axis:"y1",color:"#1890ff",type:"bar"},{name:"Growth Rate",values:Array.from({length:12},(()=>30*Math.random()-10)),axis:"y2",color:"#52c41a",type:"line"}]},options:{axes:{y1:{label:"Revenue ($)",domain:[0,2e3]},y2:{label:"Growth Rate (%)",domain:[-20,40]}},interactive:!0}}},{title:"Triple Axis Dashboard",description:"Three metrics with synchronized interactions",type:"complex",category:"multiaxis",testedFeatures:["Triple axes","Synchronized tooltips","Mixed visualizations"],status:"working",spec:{type:"multiaxis",data:{x:Array.from({length:24},((e,t)=>t)),series:[{name:"Users",values:Array.from({length:24},(()=>Math.floor(1e3*Math.random()))),axis:"y1",type:"area"},{name:"Response Time",values:Array.from({length:24},(()=>100*Math.random()+50)),axis:"y2",type:"line"},{name:"Error Rate",values:Array.from({length:24},(()=>5*Math.random())),axis:"y3",type:"bar"}]},options:{synchronizedTooltips:!0,legend:!0,interactive:!0}}},{title:"Performance Metrics",description:"System performance visualization with multiple metrics",type:"complex",category:"multiaxis",testedFeatures:["Real-time updates","Thresholds","Alerts"],status:"working",spec:{type:"multiaxis",data:{x:Array.from({length:60},((e,t)=>t)),series:[{name:"CPU",values:Array.from({length:60},(()=>100*Math.random())),axis:"y1",thresholds:[80,90]},{name:"Memory",values:Array.from({length:60},(()=>16*Math.random())),axis:"y2",thresholds:[14,15]},{name:"Network",values:Array.from({length:60},(()=>1e3*Math.random())),axis:"y3",thresholds:[800,900]}]},options:{realtime:!0,alerts:!0,updateInterval:1e3}}},{title:"Time Series with Events",description:"Time series with event markers and annotations",type:"complex",category:"timeseries",testedFeatures:["Event markers","Annotations","Zoom"],status:"working",spec:{type:"timeseries",data:{series:[{name:"Metric",values:Array.from({length:100},((e,t)=>({date:new Date(2024,0,t+1).toISOString(),value:100*Math.random()})))}],events:[{date:new Date(2024,0,15).toISOString(),type:"deployment",label:"v1.0 Release"},{date:new Date(2024,0,45).toISOString(),type:"incident",label:"System Outage"}]},options:{eventMarkers:!0,annotations:!0,zoomable:!0}}},{title:"Aggregated Time Series",description:"Time series with multiple aggregation levels",type:"complex",category:"timeseries",testedFeatures:["Aggregation","Resolution switching","Summary statistics"],status:"working",spec:{type:"timeseries",data:{raw:Array.from({length:1e3},((e,t)=>({date:new Date(2024,0,1+t/24).toISOString(),value:100*Math.random()}))),aggregations:["hour","day","week","month"]},options:{aggregation:{default:"day",methods:["avg","min","max","sum"]},statistics:!0}}},{title:"Large Dataset Performance",description:"Handling and optimizing large datasets",type:"complex",category:"special",testedFeatures:["Data sampling","Progressive loading","Performance optimization"],status:"working",spec:{type:"scatter",data:Array.from({length:1e4},((e,t)=>({x:1e3*Math.random(),y:1e3*Math.random(),category:"Group ".concat(Math.floor(t/1e3)),size:10*Math.random()}))),options:{optimization:{sampling:!0,sampleSize:1e3,progressive:!0,chunkSize:500},clustering:!0,performance:{canvas:!0,webgl:!0}}}},{title:"Error State Handling",description:"Visualization of various error states",type:"complex",category:"special",testedFeatures:["Error states","Fallbacks","Recovery"],status:"working",spec:{type:"multiaxis",data:{series:[{name:"Valid Data",values:Array.from({length:10},(()=>100*Math.random()))},{name:"Missing Data",values:Array.from({length:10},((e,t)=>t%3===0?null:100*Math.random()))},{name:"Invalid Data",values:Array.from({length:10},((e,t)=>t%4===0?"invalid":100*Math.random()))}]},options:{errorHandling:{missing:"interpolate",invalid:"omit",showIndicators:!0}}}},{title:"Interactive Patterns",description:"Advanced interaction patterns and gestures",type:"complex",category:"special",testedFeatures:["Custom interactions","Gestures","Linked views"],status:"working",spec:{type:"scatter",data:Array.from({length:100},(()=>({x:100*Math.random(),y:100*Math.random(),category:Math.random()>.5?"A":"B"}))),options:{interactions:{lasso:!0,brush:!0,zoom:!0,pan:!0},linkedViews:[{type:"histogram",dimension:"x"},{type:"histogram",dimension:"y"}]}}},{title:"Animation Sequence",description:"Complex animation sequences and transitions",type:"complex",category:"special",testedFeatures:["Animation sequences","Transitions","State morphing"],status:"working",spec:{type:"bar",data:{states:[Array.from({length:5},(()=>({value:100*Math.random()}))),Array.from({length:5},(()=>({value:100*Math.random()}))),Array.from({length:5},(()=>({value:100*Math.random()})))],transitions:[{duration:1e3,ease:"linear"},{duration:1e3,ease:"bounce"}]},options:{animation:{sequence:!0,loop:!0,delay:2e3}}}},{title:"Basic Sine Wave with Cosine",description:"Trigonometric function comparison",type:"simple",category:"function",testedFeatures:["Multiple functions","Grid lines","Legend"],status:"working",spec:{type:"function",data:[{fn:"Math.sin(x)",domain:[-6.283185307179586,6.283185307179586],label:"sin(x)"},{fn:"Math.cos(x)",domain:[-6.283185307179586,6.283185307179586],label:"cos(x)"}],options:{interactive:!0,xDomain:[-7,7],yDomain:[-1.5,1.5],grid:!0}}},{title:"Complex Wave Interference",description:"Wave interference patterns with multiple frequencies",type:"complex",category:"function",testedFeatures:["Wave interference","Multiple frequencies","Animation"],status:"working",spec:{type:"function",data:[{fn:"Math.sin(5*x) * Math.cos(3*x)",domain:[-6.283185307179586,6.283185307179586],label:"Wave 1"},{fn:"Math.sin(7*x) * Math.cos(2*x)",domain:[-6.283185307179586,6.283185307179586],label:"Wave 2"},{fn:"(Math.sin(5*x) * Math.cos(3*x) + Math.sin(7*x) * Math.cos(2*x))/2",domain:[-6.283185307179586,6.283185307179586],label:"Interference"}],options:{samples:1e3,interactive:!0,animation:!0}}},{title:"Parametric Heart Curve",description:"Heart-shaped curve using parametric equations",type:"complex",category:"function",testedFeatures:["Parametric equations","Custom domain","Animation"],status:"working",spec:{type:"function",data:[{parameterX:"16 * Math.pow(Math.sin(t), 3)",parameterY:"13 * Math.cos(t) - 5 * Math.cos(2*t) - 2 * Math.cos(3*t) - Math.cos(4*t)",parameter:"t",domain:[0,2*Math.PI],label:"Heart",samples:1e3}],options:{aspectRatio:1,xDomain:[-20,20],yDomain:[-20,20],animation:{duration:3e3,repeat:!0}}}},{title:"Statistical Distributions",description:"Normal and other probability distributions",type:"complex",category:"function",testedFeatures:["Multiple distributions","Area filling","Interactive parameters"],status:"working",spec:{type:"function",data:[{fn:"Math.exp(-Math.pow(x,2)/2)/Math.sqrt(2*Math.PI)",domain:[-4,4],label:"N(0,1)",fill:!0},{fn:"Math.exp(-Math.pow(x-1,2)/4)/Math.sqrt(4*Math.PI)",domain:[-4,4],label:"N(1,2)",fill:!0}],options:{yDomain:[0,.5],interactive:!0,grid:!0,fillOpacity:.3}}},{title:"Monthly Revenue with Trend",description:"Bar chart with trend line overlay",type:"complex",category:"multiaxis",testedFeatures:["Mixed chart types","Trend line","Dual axes"],status:"working",spec:{type:"multiaxis",data:{labels:["Jan","Feb","Mar","Apr","May","Jun"],series:[{name:"Revenue",type:"bar",values:[1e3,1200,900,1500,2e3,1800],axis:"y1"},{name:"Trend",type:"line",values:[1100,1150,1300,1450,1600,1750],axis:"y1",style:{stroke:"#ff4d4f",strokeWidth:2,strokeDasharray:"5,5"}}]},options:{axes:{y1:{label:"Revenue ($)",domain:[0,2500]}},legend:!0,animation:!0}}},{title:"Empty and Edge Cases",description:"Handling of empty and edge case data",type:"complex",category:"special",testedFeatures:["Empty states","Loading states","Error states"],status:"working",spec:{type:"multiaxis",data:{empty:[],partial:[{complete:!0,value:100},{complete:!1},{complete:!0,value:0}],invalid:[{value:1/0},{value:NaN},{value:-1/0}]},options:{emptyState:{message:"No data available",action:"Refresh"},loadingState:{type:"skeleton",animation:!0}}}}],F=()=>{const[e,t]=(0,r.useState)(!1),[a,i]=(0,r.useState)("all"),[F,P]=(0,r.useState)("all"),[R,z]=(0,r.useState)(!1),D=C.filter((e=>("all"===a||e.type===a)&&("all"===F||e.category===F)&&(R||"needs-fix"!==e.status))),E={bar:(0,M.jsx)(g.A,{}),line:(0,M.jsx)(y.A,{}),scatter:(0,M.jsx)(f.A,{}),function:(0,M.jsx)(v.A,{}),multiaxis:(0,M.jsx)(x.A,{}),bubble:(0,M.jsx)(f.A,{}),timeseries:(0,M.jsx)(w.A,{}),special:(0,M.jsx)(b.A,{})};return(0,M.jsxs)(n.A,{direction:"vertical",size:"large",style:{width:"100%",padding:"20px"},children:[(0,M.jsx)(s.A,{children:(0,M.jsxs)(n.A,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,M.jsxs)(n.A,{wrap:!0,children:[(0,M.jsx)(j,{children:"Show Source:"}),(0,M.jsx)(o.A,{checked:e,onChange:t,checkedChildren:(0,M.jsx)(A.A,{}),unCheckedChildren:(0,M.jsx)(A.A,{})}),(0,M.jsx)(j,{children:"Show Broken Examples:"}),(0,M.jsx)(o.A,{checked:R,onChange:z})]}),(0,M.jsxs)(n.A,{wrap:!0,children:[(0,M.jsx)(j,{children:"Complexity:"}),(0,M.jsxs)(l.Ay.Group,{value:a,onChange:e=>i(e.target.value),children:[(0,M.jsx)(l.Ay.Button,{value:"all",children:"All"}),(0,M.jsx)(l.Ay.Button,{value:"simple",children:"Simple"}),(0,M.jsx)(l.Ay.Button,{value:"complex",children:"Complex"})]})]}),(0,M.jsxs)(n.A,{wrap:!0,children:[(0,M.jsx)(j,{children:"Category:"}),(0,M.jsxs)(l.Ay.Group,{value:F,onChange:e=>P(e.target.value),children:[(0,M.jsx)(l.Ay.Button,{value:"all",children:"All"}),Object.entries(E).map((e=>{let[t,a]=e;return(0,M.jsxs)(l.Ay.Button,{value:t,children:[a," ",t.charAt(0).toUpperCase()+t.slice(1)]},t)}))]})]}),(0,M.jsx)(n.A,{children:(0,M.jsxs)(j,{children:["Showing ",D.length," of ",C.length," test cases"]})})]})}),D.map(((t,a)=>(0,M.jsxs)(s.A,{type:"inner",title:(0,M.jsxs)(n.A,{direction:"vertical",size:"small",style:{width:"100%"},children:[(0,M.jsxs)(n.A,{children:[E[t.category],(0,M.jsx)(k,{level:4,style:{margin:0},children:t.title}),(0,M.jsxs)(j,{type:"secondary",children:["(",t.type,")"]}),"needs-fix"===t.status&&(0,M.jsx)(c.A,{color:"error",children:"Needs Fix"})]}),(0,M.jsx)(S,{type:"secondary",children:t.description}),(0,M.jsx)(n.A,{wrap:!0,children:t.testedFeatures.map(((e,t)=>(0,M.jsx)(d.A,{title:"Tested Feature",children:(0,M.jsx)(c.A,{color:"blue",icon:(0,M.jsx)(b.A,{}),children:e})},t)))})]}),extra:(0,M.jsx)(n.A,{children:"needs-fix"===t.status&&(0,M.jsx)(d.A,{title:"View Error Details",children:(0,M.jsx)(p.Ay,{type:"text",danger:!0,icon:(0,M.jsx)(b.A,{}),children:"Error Details"})})}),children:[(0,M.jsx)("div",{style:{position:"relative",minHeight:"300px"},children:(0,M.jsx)(h.J,{spec:JSON.stringify(t.spec),width:800,height:400})}),e&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(u.A,{children:(0,M.jsxs)(n.A,{children:[(0,M.jsx)(A.A,{}),(0,M.jsx)(j,{children:"Source"})]})}),(0,M.jsx)("div",{style:{maxHeight:"400px",overflow:"auto",backgroundColor:"rgb(40, 44, 52)",borderRadius:"6px",padding:"16px"},children:(0,M.jsx)("pre",{style:{margin:0},children:(0,M.jsx)("code",{style:{color:"#abb2bf"},children:JSON.stringify(t.spec,null,2)})})})]})]},a))),0===D.length&&(0,M.jsx)(s.A,{children:(0,M.jsx)(m.A,{description:(0,M.jsxs)(n.A,{direction:"vertical",children:[(0,M.jsx)(j,{children:"No test cases match the current filters"}),(0,M.jsx)(p.Ay,{type:"primary",onClick:()=>{P("all"),i("all")},children:"Reset Filters"})]})})})]})},P=F}}]);
2
- //# sourceMappingURL=64754.cf383335.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/js/64754.cf383335.chunk.js","mappings":"6LAiBA,MCdMA,EAAmC,CD4BW,CAChDC,KAAM,kBACNC,SAAU,EACVC,UAjB0BC,GAEN,kBAATA,IACNA,EAAKC,QACQ,YAAdD,EAAKE,MACLC,MAAMC,QAAQJ,EAAKK,QACnBF,MAAMC,QAAQJ,EAAKM,QACnBN,EAAKK,MAAME,OAAS,GACpBP,EAAKM,MAAMC,OAAS,GACpBP,EAAKK,MAAMG,OAAOC,GAA2B,kBAATA,EAAEC,IAAmBD,EAAEC,MAC3DV,EAAKM,MAAME,OAAOG,GAA+B,kBAAbA,EAAEC,QAA2C,kBAAbD,EAAEE,SAQ1EZ,OAAQA,CAACa,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,EAAAA,EAAAA,MAACuL,EAAAA,EAAK,CAAA1L,SAAA,EACFJ,EAAAA,EAAAA,KAACsM,EAAAA,EAAY,KACbtM,EAAAA,EAAAA,KAACgC,EAAI,CAAA5B,SAAC,iBAGdJ,EAAAA,EAAAA,KAAA,OAAK7B,MAAO,CACRsD,UAAW,QACXiM,SAAU,OACV3M,gBAAiB,kBACjBO,aAAc,MACdpB,QAAS,QACXE,UACEJ,EAAAA,EAAAA,KAAA,OAAK7B,MAAO,CAAEiD,OAAQ,GAAIhB,UACtBJ,EAAAA,EAAAA,KAAA,QAAM7B,MAAO,CAAEgD,MAAO,WAAYf,SAC7BzC,KAAK4P,UAAUzC,EAAK/S,KAAM,KAAM,cA/DhDgV,KAwEa,IAAzBlC,EAAcvS,SACX0H,EAAAA,EAAAA,KAACgM,EAAAA,EAAI,CAAA5L,UACDJ,EAAAA,EAAAA,KAAC2N,EAAAA,EAAK,CACFtL,aACI9B,EAAAA,EAAAA,MAACuL,EAAAA,EAAK,CAACC,UAAU,WAAU3L,SAAA,EACvBJ,EAAAA,EAAAA,KAACgC,EAAI,CAAA5B,SAAC,6CACNJ,EAAAA,EAAAA,KAACqN,EAAAA,GAAM,CACHpV,KAAK,UACL2V,QAASA,KACLlD,EAAY,OACZD,EAAc,MAAM,EACtBrK,SACL,2BAQjB,EAIhB,G","sources":["plugins/d3/networkDiagram.ts","plugins/d3/registry.ts","components/D3Renderer.tsx","components/D3Test.tsx"],"sourcesContent":["import { BaseType, Selection } from 'd3';\nimport { D3RenderPlugin, D3Node, D3Link, D3Style } from '../../types/d3';\nexport interface NetworkDiagramSpec {\n width: number;\n height: number;\n nodes: D3Node[];\n links: D3Link[];\n groups?: Array<{\n id: string;\n label: string;\n members: string[];\n }>;\n styles?: {\n [key: string]: D3Style;\n };\n};\n\nconst isNetworkDiagramSpec = (spec: any): spec is NetworkDiagramSpec => {\n return (\n typeof spec === 'object' &&\n !spec.render && // Don't handle specs with direct render functions\n spec.type === 'network' &&\n Array.isArray(spec.nodes) &&\n Array.isArray(spec.links) &&\n spec.nodes.length > 0 &&\n spec.links.length > 0 &&\n spec.nodes.every((n: any) => typeof n.id === 'string' && n.id) &&\n spec.links.every((l: any) => typeof l.source === 'string' && typeof l.target === 'string')\n );\n};\n\nexport const networkDiagramPlugin: D3RenderPlugin = {\n name: 'network-diagram',\n priority: 1,\n canHandle: isNetworkDiagramSpec,\n render: (container: HTMLElement, d3: any, spec: any) => {\n console.debug('Network diagram plugin rendering:', spec);\n if (!isNetworkDiagramSpec(spec)) {\n throw new Error('Invalid network diagram specification');\n }\n\n function isNetworkDiagramSpec(spec: any): spec is NetworkDiagramSpec {\n return (\n typeof spec === 'object' &&\n spec.type === 'network' &&\n Array.isArray(spec.nodes) &&\n Array.isArray(spec.links) &&\n spec.nodes.every((n: any) => typeof n.id === 'string') &&\n spec.links.every((l: any) => typeof l.source === 'string' && typeof l.target === 'string')\n );\n }\n console.debug('Network diagram render:', {\n nodeCount: spec.nodes.length,\n linkCount: spec.links.length,\n groupCount: spec.groups?.length\n });\n try {\n const svg = d3.select(container)\n .append('svg')\n .attr('width', spec.width)\n .attr('height', spec.height)\n .attr('viewBox', [0, 0, spec.width, spec.height]);\n // Create board containers if groups exist\n if (spec.groups?.length) {\n const boards = svg.selectAll('.board')\n .data(spec.groups)\n .enter()\n .append('g')\n .attr('class', 'board')\n .attr('transform', 'translate(0,0)');\n boards.append('rect')\n .attr('x', d => d.id === 'modem_board' ? 180 : 680)\n .attr('y', 50)\n .attr('width', d => d.id === 'modem_board' ? 350 : 200)\n .attr('height', 500)\n .attr('fill', 'none')\n .attr('stroke', '#666')\n .attr('stroke-dasharray', '5,5');\n boards.append('text')\n .attr('x', d => d.id === 'modem_board' ? 200 : 700)\n .attr('y', 80)\n .text(d => d.label)\n .attr('fill', '#666');\n }\n // Draw links first (rest of the rendering code remains the same)\n // ... (previous link rendering code)\n // Draw nodes\n // ... (previous node rendering code)\n } catch (error) {\n console.error('Network diagram render error:', error);\n // Clean up on error\n d3.select(container).selectAll('*').remove();\n throw error;\n }\n }\n};\n","import { D3RenderPlugin } from '../../types/d3';\nimport { networkDiagramPlugin } from './networkDiagram';\n// Registry for D3 visualization plugins\nconst pluginRegistry: D3RenderPlugin[] = [\n networkDiagramPlugin\n // Add more plugins here as needed\n];\n// Validate plugins on load\npluginRegistry.forEach(plugin => {\n if (!plugin.name) {\n throw new Error('Plugin missing required name property');\n }\n if (typeof plugin.priority !== 'number') {\n throw new Error(`Plugin ${plugin.name} missing required priority number`);\n }\n if (typeof plugin.canHandle !== 'function') {\n throw new Error(`Plugin ${plugin.name} missing required canHandle function`);\n }\n if (typeof plugin.render !== 'function') {\n throw new Error(`Plugin ${plugin.name} missing required render function`);\n }\n});\nexport const d3RenderPlugins = Object.freeze(pluginRegistry);\nexport const getPluginByName = (name: string) => d3RenderPlugins.find(p => p.name === name);\n","import React, { useState, useEffect, useRef } from 'react';\nimport { useTheme } from '../context/ThemeContext';\nimport { Spin } from 'antd';\nimport vegaEmbed from 'vega-embed';\nimport * as d3 from 'd3';\nimport { D3RenderPlugin } from '../types/d3';\nimport { d3RenderPlugins } from '../plugins/d3/registry';\n\ntype RenderType = 'auto' | 'vega-lite' | 'd3';\n\ninterface D3RendererProps {\n spec: any;\n width?: number;\n height?: number;\n containerId?: string; \n type?: RenderType;\n onLoad?: () => void; \n onError?: (error: Error) => void; \n config?: any; \n}\n\nfunction findPlugin(spec: any): D3RenderPlugin | undefined {\n // First check for explicit type\n if (spec.visualizationType) {\n const exactMatch = d3RenderPlugins.find(p => p.name === spec.visualizationType);\n if (exactMatch) return exactMatch;\n }\n // Then check all plugins in priority order\n const matchingPlugins = d3RenderPlugins\n .filter(p => p.canHandle(spec))\n .sort((a, b) => b.priority - a.priority);\n if (matchingPlugins.length > 0) {\n console.debug(`Found ${matchingPlugins.length} matching plugins:`,\n matchingPlugins.map(p => `${p.name} (priority: ${p.priority})`));\n return matchingPlugins[0];\n }\n}\n\nexport const D3Renderer: React.FC<D3RendererProps> = ({\n spec,\n width = 600,\n height = 400,\n containerId,\n type = 'auto',\n onLoad,\n onError,\n config\n}) => {\n const { isDarkMode } = useTheme();\n const vegaContainerRef = useRef<HTMLDivElement>(null);\n const d3ContainerRef = useRef<HTMLDivElement>(null);\n const vegaViewRef = useRef<any>(null);\n const [isLoading, setIsLoading] = useState(true);\n const [renderError, setRenderError] = useState<string | null>(null);\n const [errorDetails, setErrorDetails] = useState<string[]>([]);\n const cleanupRef = useRef<(() => void) | null>(null);\n const simulationRef = useRef<any>(null);\n const renderIdRef = useRef<number>(0);\n const mounted = useRef(true);\n\n // First useEffect for cleanup\nuseEffect(() => {\n return () => {\n console.debug('D3Renderer cleanup triggered');\n if (vegaViewRef.current) {\n try {\n vegaViewRef.current.finalize();\n vegaViewRef.current = null;\n } catch (e) { /* ignore cleanup errors */ }\n console.debug('Vega view finalized');\n }\n // Clear D3 container\n if (d3ContainerRef.current) {\n // Stop any running force simulation\n if (simulationRef.current) {\n simulationRef.current.stop();\n simulationRef.current = null;\n }\n d3ContainerRef.current.innerHTML = '';\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = null;\n }\n }\n };\n}, []);\n\n// Main rendering useEffect\nuseEffect(() => {\n const currentRender = ++renderIdRef.current;\n console.debug(`Starting render #${currentRender}`);\n\n const initializeVisualization = async () => {\n setIsLoading(true);\n try {\n if (!spec) {\n throw new Error('No specification provided');\n }\n\n let parsed: any;\n let specLines: string[];\n\n try {\n if (typeof spec === 'string') {\n // Clean up the spec string\n specLines = spec\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n .map(line => line.trim())\n .filter(line => !line.trim().startsWith('//') && line.trim() !== '');\n\n // Check if we have a complete code block\n if (!specLines.length || !specLines.some(line => line.includes('}'))) {\n setIsLoading(true);\n return; // Exit early if code block is incomplete\n }\n\n const cleanSpec = specLines.join('\\n').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n parsed = JSON.parse(cleanSpec);\n } else {\n parsed = spec;\n }\n } catch (parseError) {\n setIsLoading(true); // Keep loading while we wait for complete spec\n console.debug('Waiting for complete spec:', parseError);\n return;\n }\n\n // Only proceed with rendering if we have a valid parsed spec\n if (!parsed) return;\n\n if (type === 'd3' || parsed.renderer === 'd3' || typeof parsed.render === 'function') {\n const container = d3ContainerRef.current;\n if (!container) return;\n\n if (currentRender !== renderIdRef.current) {\n console.debug(`Skipping stale render #${currentRender}`);\n return;\n }\n\n // Cleanup existing simulation\n if (simulationRef.current) {\n try {\n simulationRef.current.stop();\n simulationRef.current = null;\n } catch (error) {\n console.warn('Error cleaning up simulation:', error);\n }\n }\n\n // Create temporary container for safe rendering\n const tempContainer = document.createElement('div');\n tempContainer.style.width = '100%';\n tempContainer.style.height = '100%';\n\n let renderSuccessful = false;\n\n try {\n if (parsed.render && typeof parsed.render === 'function') {\n const result = parsed.render.call(parsed, tempContainer, d3);\n renderSuccessful = true;\n\n // If result is a function, use it as cleanup\n if (typeof result === 'function') {\n cleanupRef.current = result;\n }\n } else {\n const plugin = findPlugin(parsed);\n if (!plugin) {\n throw new Error('No render function or compatible plugin found');\n }\n plugin.render(tempContainer, d3, parsed);\n renderSuccessful = true;\n }\n\n // Only replace main container content if render was successful\n if (renderSuccessful) {\n container.innerHTML = '';\n container.appendChild(tempContainer);\n }\n } catch (renderError) {\n console.error('D3 render error:', renderError);\n setRenderError(renderError instanceof Error ? renderError.message : 'Render failed');\n throw renderError;\n }\n\n if (!renderSuccessful) {\n throw new Error('Render did not complete successfully');\n }\n\n setIsLoading(false);\n setRenderError(null);\n onLoad?.();\n return;\n }\n\n // Handle Vega-Lite rendering\n const container = vegaContainerRef.current;\n if (!container) return;\n\n const vegaSpec = {\n $schema: 'https://vega.github.io/schema/vega-lite/v5.json',\n width: width || 'container',\n height: height || 300,\n mark: parsed.type || 'point',\n data: {\n values: Array.isArray(parsed.data) ? parsed.data : [parsed.data]\n },\n encoding: parsed.encoding || {\n x: { field: 'x', type: 'quantitative' },\n y: { field: 'y', type: 'quantitative' }\n },\n ...parsed\n };\n\n if (vegaViewRef.current) {\n vegaViewRef.current.finalize();\n vegaViewRef.current = null;\n }\n\n console.debug('Rendering Vega spec:', vegaSpec);\n const result = await vegaEmbed(container, vegaSpec, {\n actions: false,\n theme: isDarkMode ? 'dark' : 'excel',\n renderer: 'canvas'\n });\n\n if (!mounted.current) {\n result.view.finalize();\n return;\n }\n\n vegaViewRef.current = result.view;\n setIsLoading(false);\n onLoad?.();\n\n } catch (error: any) {\n console.error('Visualization error:', error);\n // Only show error if we're not just waiting for complete spec\n if (error.message !== 'Unexpected end of JSON input') {\n setRenderError(error.message);\n setErrorDetails([error.message]);\n }\n setIsLoading(false);\n }\n };\n \n if (mounted.current) {\n initializeVisualization();\n }\n\n return () => {\n mounted.current = false;\n };\n}, [spec, type, width, height, isDarkMode]);\n\n\n const isD3Mode = type === 'd3' || (typeof spec === 'object' && (spec.renderer === 'd3' || typeof spec.render === 'function'));\n\n return (\n <div\n id={containerId || 'd3-container'}\n style={{\n width: '100%',\n height: height || '300px',\n minHeight: '200px',\n padding: '16px',\n position: 'relative'\n }}\n >\n {isD3Mode ? (\n <div \n ref={d3ContainerRef}\n className=\"d3-container\"\n style={{\n width: '100%',\n height: '100%',\n position: 'relative'\n }}\n />\n ) : (\n <div\n ref={vegaContainerRef}\n id=\"vega-container\"\n style={{\n position: 'relative',\n width: '100%',\n height: height || '100%'\n }}\n >\n {(isLoading || !spec) && (\n <div style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.1)'\n }}>\n <Spin size=\"large\" />\n <div style={{ marginTop: '10px', color: isDarkMode ? '#ffffff' : '#000000' }}>\n Preparing visualization...\n </div>\n </div>\n )}\n {renderError && (\n <pre style={{\n padding: '16px',\n margin: '8px',\n backgroundColor: isDarkMode ? '#2a1215' : '#fff1f0',\n border: `1px solid ${isDarkMode ? '#5c2223' : '#ffa39e'}`,\n borderRadius: '4px',\n color: isDarkMode ? '#ff4d4f' : '#cf1322',\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n maxHeight: '200px',\n overflowY: 'auto',\n fontSize: '14px',\n lineHeight: '1.5',\n fontFamily: 'monospace'\n }}>\n <strong>Error:</strong>\n {errorDetails.map((line, i) => <div key={i}>{line}</div>)}\n </pre>\n )}\n </div>\n )}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport { Card, Divider, Space, Typography, Switch, Radio, Tag, Tooltip, Button, Empty } from 'antd';\nimport { D3Renderer } from './D3Renderer';\nimport { \n CodeOutlined, \n BarChartOutlined, \n LineChartOutlined, \n DotChartOutlined, \n FunctionOutlined,\n AreaChartOutlined,\n StockOutlined,\n ExperimentOutlined\n} from '@ant-design/icons';\n\nconst { Title, Text, Paragraph } = Typography;\n\ninterface TestCase {\n title: string;\n description: string;\n type: 'simple' | 'complex';\n category: 'bar' | 'line' | 'scatter' | 'function' | 'multiaxis' | 'bubble' | 'timeseries' | 'special';\n spec: any;\n status?: 'working' | 'needs-fix';\n testedFeatures: string[];\n}\n\nconst TEST_CASES: TestCase[] = [\n // BAR CHARTS\n {\n title: \"Simple Vertical Bars\",\n description: \"Basic bar chart with single series and value labels\",\n type: \"simple\",\n category: \"bar\",\n testedFeatures: [\"Basic bars\", \"Value labels\", \"Tooltips\"],\n status: \"working\",\n spec: {\n type: \"bar\",\n data: [\n { label: \"A\", value: 10 },\n { label: \"B\", value: 20 },\n { label: \"C\", value: 15 },\n { label: \"D\", value: 25 },\n { label: \"E\", value: 18 }\n ],\n options: {\n interactive: true,\n valueLabels: true,\n yAxis: { label: \"Values\" },\n xAxis: { label: \"Categories\" }\n }\n }\n },\n {\n title: \"Grouped Bar Chart\",\n description: \"Multiple series with grouping and custom colors\",\n type: \"complex\",\n category: \"bar\",\n testedFeatures: [\"Grouped bars\", \"Custom colors\", \"Legend\", \"Interactive tooltips\"],\n status: \"working\",\n spec: {\n type: \"bar\",\n data: [\n { label: \"Q1\", value: 1000, group: \"2023\", color: \"#ff4d4f\" },\n { label: \"Q2\", value: 1200, group: \"2023\", color: \"#ff4d4f\" },\n { label: \"Q3\", value: 900, group: \"2023\", color: \"#ff4d4f\" },\n { label: \"Q4\", value: 1500, group: \"2023\", color: \"#ff4d4f\" },\n { label: \"Q1\", value: 800, group: \"2024\", color: \"#40a9ff\" },\n { label: \"Q2\", value: 1400, group: \"2024\", color: \"#40a9ff\" }\n ],\n options: {\n grouped: true,\n animation: true,\n interactive: true,\n legend: true\n }\n }\n },\n {\n title: \"Stacked Bar Chart\",\n description: \"Stacked bars with multiple categories\",\n type: \"complex\",\n category: \"bar\",\n testedFeatures: [\"Stacked bars\", \"Percentage view\", \"Category colors\"],\n status: \"working\",\n spec: {\n type: \"bar\",\n data: [\n { label: \"Product A\", categories: [\n { name: \"Revenue\", value: 500 },\n { name: \"Costs\", value: 300 },\n { name: \"Profit\", value: 200 }\n ]},\n { label: \"Product B\", categories: [\n { name: \"Revenue\", value: 800 },\n { name: \"Costs\", value: 400 },\n { name: \"Profit\", value: 400 }\n ]},\n { label: \"Product C\", categories: [\n { name: \"Revenue\", value: 400 },\n { name: \"Costs\", value: 200 },\n { name: \"Profit\", value: 200 }\n ]}\n ],\n options: {\n stacked: true,\n percentage: false,\n interactive: true,\n animation: true\n }\n }\n },\n {\n title: \"Bars with Negative Values\",\n description: \"Bar chart showing positive and negative values\",\n type: \"complex\",\n category: \"bar\",\n testedFeatures: [\"Negative values\", \"Zero line\", \"Value coloring\"],\n status: \"working\",\n spec: {\n type: \"bar\",\n data: [\n { label: \"Jan\", value: 50 },\n { label: \"Feb\", value: -30 },\n { label: \"Mar\", value: 25 },\n { label: \"Apr\", value: -45 },\n { label: \"May\", value: 60 },\n { label: \"Jun\", value: -20 }\n ],\n options: {\n zeroLine: true,\n valueColors: true,\n interactive: true\n }\n }\n },\n// LINE CHARTS\n {\n title: \"Simple Line Chart\",\n description: \"Basic line chart with smooth interpolation\",\n type: \"simple\",\n category: \"line\",\n testedFeatures: [\"Line interpolation\", \"Point markers\", \"Hover effects\"],\n status: \"working\",\n spec: {\n type: \"line\",\n data: Array.from({length: 10}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.sin(i/2) * 10 + 20\n })),\n options: {\n interactive: true,\n points: true,\n smooth: true,\n yAxis: { label: \"Values\" },\n xAxis: { label: \"Time\" }\n }\n }\n },\n {\n title: \"Multiple Line Series\",\n description: \"Multiple lines with different scales and patterns\",\n type: \"complex\",\n category: \"line\",\n testedFeatures: [\"Multiple series\", \"Different scales\", \"Pattern variations\"],\n status: \"working\",\n spec: {\n type: \"line\",\n data: {\n series: [\n {\n name: \"Temperature\",\n values: Array.from({length: 24}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.sin(i/3) * 10 + 20\n })),\n pattern: \"solid\"\n },\n {\n name: \"Pressure\",\n values: Array.from({length: 24}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.cos(i/4) * 100 + 1000\n })),\n pattern: \"dashed\"\n },\n {\n name: \"Humidity\",\n values: Array.from({length: 24}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.sin(i/6) * 20 + 50\n })),\n pattern: \"dotted\"\n }\n ]\n },\n options: {\n interactive: true,\n legend: true,\n multiScale: true\n }\n }\n },\n {\n title: \"Area Chart\",\n description: \"Stacked area chart with gradient fills\",\n type: \"complex\",\n category: \"line\",\n testedFeatures: [\"Area fills\", \"Gradients\", \"Stacking\"],\n status: \"working\",\n spec: {\n type: \"line\",\n data: {\n series: [\n {\n name: \"Series A\",\n values: Array.from({length: 12}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.random() * 50 + 50\n })),\n fill: \"gradient\"\n },\n {\n name: \"Series B\",\n values: Array.from({length: 12}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.random() * 40 + 30\n })),\n fill: \"gradient\"\n },\n {\n name: \"Series C\",\n values: Array.from({length: 12}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.random() * 30 + 20\n })),\n fill: \"gradient\"\n }\n ]\n },\n options: {\n stacked: true,\n area: true,\n interactive: true\n }\n }\n },\n {\n title: \"Step Function Chart\",\n description: \"Step-wise line chart with transitions\",\n type: \"simple\",\n category: \"line\",\n testedFeatures: [\"Step interpolation\", \"Transitions\", \"Value labels\"],\n status: \"working\",\n spec: {\n type: \"line\",\n data: Array.from({length: 10}, (_, i) => ({\n date: `2024-${i+1}`,\n value: Math.floor(Math.random() * 5) * 10\n })),\n options: {\n step: true,\n valueLabels: true,\n animation: {\n duration: 1000,\n sequential: true\n }\n }\n }\n },\n {\n title: \"Real-time Data Simulation\",\n description: \"Live updating line chart with sliding window\",\n type: \"complex\",\n category: \"line\",\n testedFeatures: [\"Real-time updates\", \"Sliding window\", \"Smooth transitions\"],\n status: \"working\",\n spec: {\n type: \"line\",\n data: Array.from({length: 30}, (_, i) => ({\n date: new Date(Date.now() - (30-i)*1000).toISOString(),\n value: Math.sin(i/5) * 10 + 20 + Math.random() * 5\n })),\n options: {\n realtime: true,\n windowSize: 30,\n updateInterval: 1000,\n smoothing: true\n }\n }\n },\n\n // SCATTER/BUBBLE CHARTS\n {\n title: \"Basic Scatter Plot\",\n description: \"Simple scatter plot with hover interactions\",\n type: \"simple\",\n category: \"scatter\",\n testedFeatures: [\"Basic points\", \"Hover effects\", \"Tooltips\"],\n status: \"working\",\n spec: {\n type: \"scatter\",\n data: Array.from({length: 50}, () => ({\n x: Math.random() * 100,\n y: Math.random() * 100,\n label: \"Point\"\n })),\n options: {\n interactive: true,\n tooltip: true\n }\n }\n },\n {\n title: \"Advanced Bubble Chart\",\n description: \"Bubble chart with size, color, and category mapping\",\n type: \"complex\",\n category: \"bubble\",\n testedFeatures: [\"Size mapping\", \"Color gradients\", \"Categories\", \"Custom tooltips\"],\n status: \"working\",\n spec: {\n type: \"bubble\",\n data: Array.from({length: 30}, (_, i) => ({\n x: Math.random() * 100,\n y: Math.random() * 100,\n size: Math.random() * 50 + 10,\n category: `Group ${Math.floor(i/10)}`,\n value: Math.random() * 1000,\n color: `hsl(${Math.random() * 360}, 70%, 50%)`\n })),\n options: {\n sizeScale: {\n field: \"value\",\n range: [10, 50]\n },\n colorScale: {\n field: \"category\",\n scheme: \"category10\"\n },\n legend: true,\n interactive: true\n }\n }\n },\n {\n title: \"Quadrant Analysis\",\n description: \"Scatter plot with quadrant divisions and statistics\",\n type: \"complex\",\n category: \"scatter\",\n testedFeatures: [\"Quadrants\", \"Statistics\", \"Reference lines\", \"Annotations\"],\n status: \"working\",\n spec: {\n type: \"scatter\",\n data: Array.from({length: 100}, () => ({\n x: (Math.random() - 0.5) * 100,\n y: (Math.random() - 0.5) * 100,\n category: Math.random() > 0.5 ? \"A\" : \"B\"\n })),\n options: {\n quadrants: {\n labels: [\"High-High\", \"High-Low\", \"Low-Low\", \"Low-High\"],\n stats: true\n },\n referenceLines: true,\n annotations: true\n }\n }\n },\n {\n title: \"Correlation Plot\",\n description: \"Scatter plot with regression line and confidence interval\",\n type: \"complex\",\n category: \"scatter\",\n testedFeatures: [\"Regression line\", \"Confidence interval\", \"R-squared\", \"Outliers\"],\n status: \"working\",\n spec: {\n type: \"scatter\",\n data: Array.from({length: 50}, (_, i) => {\n const x = i * 2 + Math.random() * 10;\n return {\n x: x,\n y: 0.5 * x + Math.random() * 20 - 10\n };\n }),\n options: {\n regression: {\n type: \"linear\",\n showConfidence: true,\n showEquation: true\n },\n outlierDetection: true\n }\n }\n },\n\n // FUNCTION PLOTS\n {\n title: \"Mathematical Functions\",\n description: \"Multiple mathematical functions with interactive features\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Multiple functions\", \"Interactive domain\", \"Function composition\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n fn: \"Math.sin(x)\",\n domain: [-2 * Math.PI, 2 * Math.PI],\n label: \"sin(x)\"\n },\n {\n fn: \"Math.cos(x)\",\n domain: [-2 * Math.PI, 2 * Math.PI],\n label: \"cos(x)\"\n },\n {\n fn: \"Math.sin(x) * Math.cos(x)\",\n domain: [-2 * Math.PI, 2 * Math.PI],\n label: \"sin(x)cos(x)\"\n }\n ],\n options: {\n interactive: true,\n grid: true,\n legend: true\n }\n }\n },\n {\n title: \"Parametric Equations\",\n description: \"Parametric function visualization with animation\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Parametric equations\", \"Animation\", \"Path tracing\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n parameterX: \"Math.cos(3*t) * (1 + 0.5 * Math.cos(5*t))\",\n parameterY: \"Math.sin(2*t) * (1 + 0.5 * Math.sin(7*t))\",\n domain: [0, 2 * Math.PI],\n label: \"Rose Curve\",\n samples: 500\n }\n ],\n options: {\n animation: {\n duration: 5000,\n repeat: true\n },\n pathTrace: true\n }\n }\n },\n {\n title: \"Statistical Distributions\",\n description: \"Various probability distributions with interactive parameters\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Multiple distributions\", \"Parameter controls\", \"Area highlighting\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n fn: \"Math.exp(-Math.pow(x-0, 2)/(2*Math.pow(1,2)))/(Math.sqrt(2*Math.PI))\",\n domain: [-4, 4],\n label: \"Normal(0,1)\",\n fill: true\n },\n {\n fn: \"Math.exp(-x)*Math.pow(x,2)/2\",\n domain: [0, 10],\n label: \"Gamma(3,1)\",\n fill: true\n }\n ],\n options: {\n interactive: true,\n parameters: {\n mean: [-2, 2],\n variance: [0.5, 2]\n }\n }\n }\n },\n // MULTI-AXIS CHARTS\n {\n title: \"Dual Axis Comparison\",\n description: \"Two different metrics with independent scales\",\n type: \"complex\",\n category: \"multiaxis\",\n testedFeatures: [\"Dual axes\", \"Independent scales\", \"Mixed types\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n x: Array.from({length: 12}, (_, i) => i + 1),\n series: [\n {\n name: \"Revenue\",\n values: Array.from({length: 12}, () => Math.random() * 1000 + 500),\n axis: \"y1\",\n color: \"#1890ff\",\n type: \"bar\"\n },\n {\n name: \"Growth Rate\",\n values: Array.from({length: 12}, () => Math.random() * 30 - 10),\n axis: \"y2\",\n color: \"#52c41a\",\n type: \"line\"\n }\n ]\n },\n options: {\n axes: {\n y1: { label: \"Revenue ($)\", domain: [0, 2000] },\n y2: { label: \"Growth Rate (%)\", domain: [-20, 40] }\n },\n interactive: true\n }\n }\n },\n {\n title: \"Triple Axis Dashboard\",\n description: \"Three metrics with synchronized interactions\",\n type: \"complex\",\n category: \"multiaxis\",\n testedFeatures: [\"Triple axes\", \"Synchronized tooltips\", \"Mixed visualizations\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n x: Array.from({length: 24}, (_, i) => i),\n series: [\n {\n name: \"Users\",\n values: Array.from({length: 24}, () => Math.floor(Math.random() * 1000)),\n axis: \"y1\",\n type: \"area\"\n },\n {\n name: \"Response Time\",\n values: Array.from({length: 24}, () => Math.random() * 100 + 50),\n axis: \"y2\",\n type: \"line\"\n },\n {\n name: \"Error Rate\",\n values: Array.from({length: 24}, () => Math.random() * 5),\n axis: \"y3\",\n type: \"bar\"\n }\n ]\n },\n options: {\n synchronizedTooltips: true,\n legend: true,\n interactive: true\n }\n }\n },\n {\n title: \"Performance Metrics\",\n description: \"System performance visualization with multiple metrics\",\n type: \"complex\",\n category: \"multiaxis\",\n testedFeatures: [\"Real-time updates\", \"Thresholds\", \"Alerts\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n x: Array.from({length: 60}, (_, i) => i),\n series: [\n {\n name: \"CPU\",\n values: Array.from({length: 60}, () => Math.random() * 100),\n axis: \"y1\",\n thresholds: [80, 90]\n },\n {\n name: \"Memory\",\n values: Array.from({length: 60}, () => Math.random() * 16),\n axis: \"y2\",\n thresholds: [14, 15]\n },\n {\n name: \"Network\",\n values: Array.from({length: 60}, () => Math.random() * 1000),\n axis: \"y3\",\n thresholds: [800, 900]\n }\n ]\n },\n options: {\n realtime: true,\n alerts: true,\n updateInterval: 1000\n }\n }\n },\n\n // TIME SERIES\n {\n title: \"Time Series with Events\",\n description: \"Time series with event markers and annotations\",\n type: \"complex\",\n category: \"timeseries\",\n testedFeatures: [\"Event markers\", \"Annotations\", \"Zoom\"],\n status: \"working\",\n spec: {\n type: \"timeseries\",\n data: {\n series: [{\n name: \"Metric\",\n values: Array.from({length: 100}, (_, i) => ({\n date: new Date(2024, 0, i + 1).toISOString(),\n value: Math.random() * 100\n }))\n }],\n events: [\n {\n date: new Date(2024, 0, 15).toISOString(),\n type: \"deployment\",\n label: \"v1.0 Release\"\n },\n {\n date: new Date(2024, 0, 45).toISOString(),\n type: \"incident\",\n label: \"System Outage\"\n }\n ]\n },\n options: {\n eventMarkers: true,\n annotations: true,\n zoomable: true\n }\n }\n },\n {\n title: \"Aggregated Time Series\",\n description: \"Time series with multiple aggregation levels\",\n type: \"complex\",\n category: \"timeseries\",\n testedFeatures: [\"Aggregation\", \"Resolution switching\", \"Summary statistics\"],\n status: \"working\",\n spec: {\n type: \"timeseries\",\n data: {\n raw: Array.from({length: 1000}, (_, i) => ({\n date: new Date(2024, 0, 1 + i/24).toISOString(),\n value: Math.random() * 100\n })),\n aggregations: [\"hour\", \"day\", \"week\", \"month\"]\n },\n options: {\n aggregation: {\n default: \"day\",\n methods: [\"avg\", \"min\", \"max\", \"sum\"]\n },\n statistics: true\n }\n }\n },\n// SPECIAL CASES\n {\n title: \"Large Dataset Performance\",\n description: \"Handling and optimizing large datasets\",\n type: \"complex\",\n category: \"special\",\n testedFeatures: [\"Data sampling\", \"Progressive loading\", \"Performance optimization\"],\n status: \"working\",\n spec: {\n type: \"scatter\",\n data: Array.from({length: 10000}, (_, i) => ({\n x: Math.random() * 1000,\n y: Math.random() * 1000,\n category: `Group ${Math.floor(i/1000)}`,\n size: Math.random() * 10\n })),\n options: {\n optimization: {\n sampling: true,\n sampleSize: 1000,\n progressive: true,\n chunkSize: 500\n },\n clustering: true,\n performance: {\n canvas: true,\n webgl: true\n }\n }\n }\n },\n {\n title: \"Error State Handling\",\n description: \"Visualization of various error states\",\n type: \"complex\",\n category: \"special\",\n testedFeatures: [\"Error states\", \"Fallbacks\", \"Recovery\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n series: [\n {\n name: \"Valid Data\",\n values: Array.from({length: 10}, () => Math.random() * 100)\n },\n {\n name: \"Missing Data\",\n values: Array.from({length: 10}, (_, i) => i % 3 === 0 ? null : Math.random() * 100)\n },\n {\n name: \"Invalid Data\",\n values: Array.from({length: 10}, (_, i) => i % 4 === 0 ? \"invalid\" : Math.random() * 100)\n }\n ]\n },\n options: {\n errorHandling: {\n missing: \"interpolate\",\n invalid: \"omit\",\n showIndicators: true\n }\n }\n }\n },\n {\n title: \"Interactive Patterns\",\n description: \"Advanced interaction patterns and gestures\",\n type: \"complex\",\n category: \"special\",\n testedFeatures: [\"Custom interactions\", \"Gestures\", \"Linked views\"],\n status: \"working\",\n spec: {\n type: \"scatter\",\n data: Array.from({length: 100}, () => ({\n x: Math.random() * 100,\n y: Math.random() * 100,\n category: Math.random() > 0.5 ? \"A\" : \"B\"\n })),\n options: {\n interactions: {\n lasso: true,\n brush: true,\n zoom: true,\n pan: true\n },\n linkedViews: [\n {\n type: \"histogram\",\n dimension: \"x\"\n },\n {\n type: \"histogram\",\n dimension: \"y\"\n }\n ]\n }\n }\n },\n {\n title: \"Animation Sequence\",\n description: \"Complex animation sequences and transitions\",\n type: \"complex\",\n category: \"special\",\n testedFeatures: [\"Animation sequences\", \"Transitions\", \"State morphing\"],\n status: \"working\",\n spec: {\n type: \"bar\",\n data: {\n states: [\n Array.from({length: 5}, () => ({ value: Math.random() * 100 })),\n Array.from({length: 5}, () => ({ value: Math.random() * 100 })),\n Array.from({length: 5}, () => ({ value: Math.random() * 100 }))\n ],\n transitions: [\n { duration: 1000, ease: \"linear\" },\n { duration: 1000, ease: \"bounce\" }\n ]\n },\n options: {\n animation: {\n sequence: true,\n loop: true,\n delay: 2000\n }\n }\n }\n },\n // Add Basic Sine Wave with Cosine\n {\n title: \"Basic Sine Wave with Cosine\",\n description: \"Trigonometric function comparison\",\n type: \"simple\",\n category: \"function\",\n testedFeatures: [\"Multiple functions\", \"Grid lines\", \"Legend\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n fn: \"Math.sin(x)\",\n domain: [-6.283185307179586, 6.283185307179586],\n label: \"sin(x)\"\n },\n {\n fn: \"Math.cos(x)\",\n domain: [-6.283185307179586, 6.283185307179586],\n label: \"cos(x)\"\n }\n ],\n options: {\n interactive: true,\n xDomain: [-7, 7],\n yDomain: [-1.5, 1.5],\n grid: true\n }\n }\n },\n\n // Add Complex Wave Interference\n {\n title: \"Complex Wave Interference\",\n description: \"Wave interference patterns with multiple frequencies\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Wave interference\", \"Multiple frequencies\", \"Animation\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n fn: \"Math.sin(5*x) * Math.cos(3*x)\",\n domain: [-6.283185307179586, 6.283185307179586],\n label: \"Wave 1\"\n },\n {\n fn: \"Math.sin(7*x) * Math.cos(2*x)\",\n domain: [-6.283185307179586, 6.283185307179586],\n label: \"Wave 2\"\n },\n {\n fn: \"(Math.sin(5*x) * Math.cos(3*x) + Math.sin(7*x) * Math.cos(2*x))/2\",\n domain: [-6.283185307179586, 6.283185307179586],\n label: \"Interference\"\n }\n ],\n options: {\n samples: 1000,\n interactive: true,\n animation: true\n }\n }\n },\n\n // Add Parametric Heart Curve\n {\n title: \"Parametric Heart Curve\",\n description: \"Heart-shaped curve using parametric equations\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Parametric equations\", \"Custom domain\", \"Animation\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n parameterX: \"16 * Math.pow(Math.sin(t), 3)\",\n parameterY: \"13 * Math.cos(t) - 5 * Math.cos(2*t) - 2 * Math.cos(3*t) - Math.cos(4*t)\",\n parameter: \"t\",\n domain: [0, 2 * Math.PI],\n label: \"Heart\",\n samples: 1000\n }\n ],\n options: {\n aspectRatio: 1,\n xDomain: [-20, 20],\n yDomain: [-20, 20],\n animation: {\n duration: 3000,\n repeat: true\n }\n }\n }\n },\n // Add Statistical Distribution\n {\n title: \"Statistical Distributions\",\n description: \"Normal and other probability distributions\",\n type: \"complex\",\n category: \"function\",\n testedFeatures: [\"Multiple distributions\", \"Area filling\", \"Interactive parameters\"],\n status: \"working\",\n spec: {\n type: \"function\",\n data: [\n {\n fn: \"Math.exp(-Math.pow(x,2)/2)/Math.sqrt(2*Math.PI)\",\n domain: [-4, 4],\n label: \"N(0,1)\",\n fill: true\n },\n {\n fn: \"Math.exp(-Math.pow(x-1,2)/4)/Math.sqrt(4*Math.PI)\",\n domain: [-4, 4],\n label: \"N(1,2)\",\n fill: true\n }\n ],\n options: {\n yDomain: [0, 0.5],\n interactive: true,\n grid: true,\n fillOpacity: 0.3\n }\n }\n },\n\n // Add Combined Bar and Line Chart\n {\n title: \"Monthly Revenue with Trend\",\n description: \"Bar chart with trend line overlay\",\n type: \"complex\",\n category: \"multiaxis\",\n testedFeatures: [\"Mixed chart types\", \"Trend line\", \"Dual axes\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n labels: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\"],\n series: [\n {\n name: \"Revenue\",\n type: \"bar\",\n values: [1000, 1200, 900, 1500, 2000, 1800],\n axis: \"y1\"\n },\n {\n name: \"Trend\",\n type: \"line\",\n values: [1100, 1150, 1300, 1450, 1600, 1750],\n axis: \"y1\",\n style: {\n stroke: \"#ff4d4f\",\n strokeWidth: 2,\n strokeDasharray: \"5,5\"\n }\n }\n ]\n },\n options: {\n axes: {\n y1: { label: \"Revenue ($)\", domain: [0, 2500] }\n },\n legend: true,\n animation: true\n }\n }\n },\n {\n title: \"Empty and Edge Cases\",\n description: \"Handling of empty and edge case data\",\n type: \"complex\",\n category: \"special\",\n testedFeatures: [\"Empty states\", \"Loading states\", \"Error states\"],\n status: \"working\",\n spec: {\n type: \"multiaxis\",\n data: {\n empty: [],\n partial: [\n { complete: true, value: 100 },\n { complete: false },\n { complete: true, value: 0 }\n ],\n invalid: [\n { value: Infinity },\n { value: NaN },\n { value: -Infinity }\n ]\n },\n options: {\n emptyState: {\n message: \"No data available\",\n action: \"Refresh\"\n },\n loadingState: {\n type: \"skeleton\",\n animation: true\n }\n }\n }\n }\n];\n\n// Component implementation\nexport const D3Test: React.FC = () => {\n const [showSource, setShowSource] = useState(false);\n const [complexity, setComplexity] = useState<'all' | 'simple' | 'complex'>('all');\n const [category, setCategory] = useState<'all' | 'bar' | 'line' | 'scatter' | 'function' | 'multiaxis' | 'bubble' | 'timeseries' | 'special'>('all');\n const [showBroken, setShowBroken] = useState(false);\n\n const filteredTests = TEST_CASES.filter(test =>\n (complexity === 'all' || test.type === complexity) &&\n (category === 'all' || test.category === category) &&\n (showBroken || test.status !== 'needs-fix')\n );\n\n const CategoryIcon = {\n bar: <BarChartOutlined />,\n line: <LineChartOutlined />,\n scatter: <DotChartOutlined />,\n function: <FunctionOutlined />,\n multiaxis: <StockOutlined />,\n bubble: <DotChartOutlined />,\n timeseries: <AreaChartOutlined />,\n special: <ExperimentOutlined />\n };\n\n return (\n <Space direction=\"vertical\" size=\"large\" style={{ width: '100%', padding: '20px' }}>\n <Card>\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Space wrap>\n <Text>Show Source:</Text>\n <Switch\n checked={showSource}\n onChange={setShowSource}\n checkedChildren={<CodeOutlined />}\n unCheckedChildren={<CodeOutlined />}\n />\n <Text>Show Broken Examples:</Text>\n <Switch\n checked={showBroken}\n onChange={setShowBroken}\n />\n </Space>\n <Space wrap>\n <Text>Complexity:</Text>\n <Radio.Group value={complexity} onChange={e => setComplexity(e.target.value)}>\n <Radio.Button value=\"all\">All</Radio.Button>\n <Radio.Button value=\"simple\">Simple</Radio.Button>\n <Radio.Button value=\"complex\">Complex</Radio.Button>\n </Radio.Group>\n </Space>\n <Space wrap>\n <Text>Category:</Text>\n <Radio.Group value={category} onChange={e => setCategory(e.target.value)}>\n <Radio.Button value=\"all\">All</Radio.Button>\n {Object.entries(CategoryIcon).map(([key, icon]) => (\n <Radio.Button key={key} value={key}>\n {icon} {key.charAt(0).toUpperCase() + key.slice(1)}\n </Radio.Button>\n ))}\n </Radio.Group>\n </Space>\n <Space>\n <Text>\n Showing {filteredTests.length} of {TEST_CASES.length} test cases\n </Text>\n </Space>\n </Space>\n </Card>\n\n {filteredTests.map((test, index) => (\n <Card\n key={index}\n type=\"inner\"\n title={\n <Space direction=\"vertical\" size=\"small\" style={{ width: '100%' }}>\n <Space>\n {CategoryIcon[test.category]}\n <Title level={4} style={{ margin: 0 }}>{test.title}</Title>\n <Text type=\"secondary\">({test.type})</Text>\n {test.status === 'needs-fix' && (\n <Tag color=\"error\">Needs Fix</Tag>\n )}\n </Space>\n <Paragraph type=\"secondary\">{test.description}</Paragraph>\n <Space wrap>\n {test.testedFeatures.map((feature, i) => (\n <Tooltip key={i} title=\"Tested Feature\">\n <Tag color=\"blue\" icon={<ExperimentOutlined />}>\n {feature}\n </Tag>\n </Tooltip>\n ))}\n </Space>\n </Space>\n }\n extra={\n <Space>\n {test.status === 'needs-fix' && (\n <Tooltip title=\"View Error Details\">\n <Button type=\"text\" danger icon={<ExperimentOutlined />}>\n Error Details\n </Button>\n </Tooltip>\n )}\n </Space>\n }\n >\n <div style={{\n position: 'relative',\n minHeight: '300px'\n }}>\n <D3Renderer\n spec={JSON.stringify(test.spec)}\n width={800}\n height={400}\n />\n </div>\n {showSource && (\n <>\n <Divider>\n <Space>\n <CodeOutlined />\n <Text>Source</Text>\n </Space>\n </Divider>\n <div style={{\n maxHeight: '400px',\n overflow: 'auto',\n backgroundColor: 'rgb(40, 44, 52)',\n borderRadius: '6px',\n padding: '16px'\n }}>\n <pre style={{ margin: 0 }}>\n <code style={{ color: '#abb2bf' }}>\n {JSON.stringify(test.spec, null, 2)}\n </code>\n </pre>\n </div>\n </>\n )}\n </Card>\n ))}\n\n {filteredTests.length === 0 && (\n <Card>\n <Empty\n description={\n <Space direction=\"vertical\">\n <Text>No test cases match the current filters</Text>\n <Button\n type=\"primary\"\n onClick={() => {\n setCategory('all');\n setComplexity('all');\n }}\n >\n Reset Filters\n </Button>\n </Space>\n }\n />\n </Card>\n )}\n </Space>\n );\n};\n\nexport default D3Test;\n"],"names":["pluginRegistry","name","priority","canHandle","spec","render","type","Array","isArray","nodes","links","length","every","n","id","l","source","target","container","d3","_spec$groups","console","debug","isNetworkDiagramSpec","Error","nodeCount","linkCount","groupCount","groups","_spec$groups2","svg","select","append","attr","width","height","boards","selectAll","data","enter","d","text","label","error","remove","forEach","plugin","concat","d3RenderPlugins","Object","freeze","D3Renderer","_ref","containerId","onLoad","onError","config","isDarkMode","useTheme","vegaContainerRef","useRef","d3ContainerRef","vegaViewRef","isLoading","setIsLoading","useState","renderError","setRenderError","errorDetails","setErrorDetails","cleanupRef","simulationRef","renderIdRef","mounted","useEffect","current","finalize","e","stop","innerHTML","currentRender","initializeVisualization","async","parsed","specLines","replace","split","map","line","trim","filter","startsWith","some","includes","cleanSpec","join","JSON","parse","parseError","renderer","warn","tempContainer","document","createElement","style","renderSuccessful","result","call","visualizationType","exactMatch","find","p","matchingPlugins","sort","a","b","findPlugin","appendChild","message","vegaSpec","_objectSpread","$schema","mark","values","encoding","x","field","y","vegaEmbed","actions","theme","view","isD3Mode","_jsx","minHeight","padding","position","children","ref","className","_jsxs","top","left","right","bottom","display","alignItems","justifyContent","backgroundColor","Spin","size","marginTop","color","margin","border","borderRadius","whiteSpace","wordWrap","maxHeight","overflowY","fontSize","lineHeight","fontFamily","i","Title","Text","Paragraph","Typography","TEST_CASES","title","description","category","testedFeatures","status","value","options","interactive","valueLabels","yAxis","xAxis","group","grouped","animation","legend","categories","stacked","percentage","zeroLine","valueColors","from","_","date","Math","sin","points","smooth","series","pattern","cos","multiScale","random","fill","area","floor","step","duration","sequential","Date","now","toISOString","realtime","windowSize","updateInterval","smoothing","tooltip","sizeScale","range","colorScale","scheme","quadrants","labels","stats","referenceLines","annotations","regression","showConfidence","showEquation","outlierDetection","fn","domain","PI","grid","parameterX","parameterY","samples","repeat","pathTrace","parameters","mean","variance","axis","axes","y1","y2","synchronizedTooltips","thresholds","alerts","events","eventMarkers","zoomable","raw","aggregations","aggregation","default","methods","statistics","optimization","sampling","sampleSize","progressive","chunkSize","clustering","performance","canvas","webgl","errorHandling","missing","invalid","showIndicators","interactions","lasso","brush","zoom","pan","linkedViews","dimension","states","transitions","ease","sequence","loop","delay","xDomain","yDomain","parameter","aspectRatio","fillOpacity","stroke","strokeWidth","strokeDasharray","empty","partial","complete","Infinity","NaN","emptyState","action","loadingState","D3Test","showSource","setShowSource","complexity","setComplexity","setCategory","showBroken","setShowBroken","filteredTests","test","CategoryIcon","bar","BarChartOutlined","LineChartOutlined","scatter","DotChartOutlined","function","FunctionOutlined","multiaxis","StockOutlined","bubble","timeseries","AreaChartOutlined","special","ExperimentOutlined","Space","direction","Card","wrap","Switch","checked","onChange","checkedChildren","CodeOutlined","unCheckedChildren","Radio","entries","key","icon","charAt","toUpperCase","slice","index","level","Tag","feature","Tooltip","extra","Button","danger","stringify","_Fragment","Divider","overflow","Empty","onClick"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- /*! For license information please see 88261.33450351.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[88261],{88261:(e,n,s)=>{s.r(n),s.d(n,{default:()=>S});var t=s(65043),a=s(78626),r=s(89379),o=s(82137),i=s(36011),l=s(41982),c=s(6051),d=s(4015),h=s(97606),g=s(57721),m=s(53727),v=s(58168);const p={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};var u=s(22172),x=function(e,n){return t.createElement(u.A,(0,v.A)({},e,{ref:n,icon:p}))};const y=t.forwardRef(x);var f=s(63390),C=s(67407),j=s(70579);const A=e=>{let{index:n}=e;const{currentMessages:s,currentConversationId:v,addMessageToConversation:p,setIsStreaming:u,setConversations:x,streamingConversations:A,addStreamingConversation:b,setStreamedContentMap:w,removeStreamingConversation:k}=(0,a.v)(),[z,I]=(0,t.useState)(!1),[S,M]=(0,t.useState)(s[n].content),{checkedKeys:E}=(0,i.X)(),{TextArea:R}=l.A;return(0,j.jsx)("div",{children:z?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(R,{style:{width:"38vw",height:"100px"},value:S,onChange:e=>M(e.target.value)}),(0,j.jsxs)(c.A,{style:{marginTop:"8px"},children:[(0,j.jsx)(d.Ay,{icon:(0,j.jsx)(m.A,{}),onClick:()=>{I(!1),M(s[n].content)},size:"small",children:"Cancel"}),(0,j.jsx)(d.Ay,{icon:(0,j.jsx)(y,{}),onClick:()=>{s.map(((e,s)=>s===n?(0,r.A)((0,r.A)({},e),{},{content:S,_timestamp:Date.now()}):e)).forEach((e=>p(e,v))),I(!1)},size:"small",children:"Save"}),(0,j.jsx)(d.Ay,{icon:(0,j.jsx)(f.A,{}),onClick:async()=>{I(!1),w(new Map);const e=s.slice(0,n+1);e[n]=(0,r.A)((0,r.A)({},e[n]),{},{content:S,_timestamp:Date.now()}),x((n=>n.map((n=>n.id===v?(0,r.A)((0,r.A)({},n),{},{messages:e}):n)))),b(v);try{const e=await(0,o.f)(v,S,A.has(v),s,w,u,(0,g.F)(E),p,k);if(e){p({content:e,role:"assistant"},v)}}catch(t){console.error("Error sending message:",t),k(v)}finally{u(!1)}},size:"small",type:"primary",children:"Submit"})]})]}):(0,j.jsx)(h.A,{title:"Edit",children:(0,j.jsx)(d.Ay,{icon:(0,j.jsx)(C.A,{}),onClick:()=>{I(!0)}})})})};var b=s(91686);const w={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"};var k=function(e,n){return t.createElement(u.A,(0,v.A)({},e,{ref:n,icon:w}))};const z=t.forwardRef(k),I=t.lazy((()=>Promise.all([s.e(53653),s.e(79218),s.e(96603),s.e(23416),s.e(46907),s.e(18884)]).then(s.bind(s,46907)))),S=(0,t.memo)((e=>{let{enableCodeApply:n}=e;const{currentMessages:s,isTopToBottom:r,isLoadingConversation:l,addStreamingConversation:c,streamingConversations:m,currentConversationId:v,setIsStreaming:p,setStreamedContentMap:u,addMessageToConversation:x,removeStreamingConversation:y}=(0,a.v)(),{checkedKeys:f}=(0,i.X)(),C=(0,t.useRef)(!0),w=r?s:[...s].reverse(),k=(0,t.useRef)(0);(0,t.useEffect)((()=>{console.debug("Conversation messages updated:",{messageCount:s.length,previousCount:k.current,isVisible:C.current,displayOrder:r?"top-down":"bottom-up"}),s.length!==k.current&&(k.current=s.length,console.log("Rendered ".concat(s.length," messages")));const e=new IntersectionObserver((e=>{e.forEach((e=>{C.current=e.isIntersecting,console.debug("Conversation visibility changed:",{isVisible:e.isIntersecting,messageCount:s.length})}))}),{threshold:.1});return()=>e.disconnect()}),[s.length]);const S=l?s.length>0?"Loading messages (".concat(s.length," loaded)..."):"Loading conversation...":"",M=l&&s.length>0,E=l&&0===s.length,R=e=>(e=>{const n=s[e],t=e===s.length-1,a=e+1,r=a<s.length?s[a]:null,o=a<s.length;return"human"===(null===n||void 0===n?void 0:n.role)&&!m.has(v)&&(t||o&&"assistant"!==(null===r||void 0===r?void 0:r.role))})(e)?(0,j.jsx)(h.A,{title:"The AI response may have failed. Click to retry.",children:(0,j.jsx)(d.Ay,{icon:(0,j.jsx)(z,{}),type:"primary",size:"small",onClick:async()=>{const n=s[e];c(v);try{await(0,o.f)(v,n.content,m.has(v),s,u,p,(0,g.F)(f),x,y)}catch(t){y(v),console.error("Error retrying message:",t)}},children:"Retry AI Response"})}):null;return(0,j.jsxs)("div",{style:{position:"relative"},children:[E&&(0,j.jsx)("div",{style:{position:"fixed",top:"var(--header-height)",left:"var(--folder-panel-width)",right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},children:(0,j.jsx)(b.A,{size:"large",tip:S})}),(0,j.jsxs)("div",{style:{opacity:l?.5:1,minHeight:"50px"},className:"conversation-messages-container",children:[M&&(0,j.jsxs)("div",{style:{position:"sticky",top:0,backgroundColor:"rgba(0, 0, 0, 0.7)",color:"#fff",padding:"8px 16px",borderRadius:"4px",margin:"8px 0",display:"flex",alignItems:"center",gap:"8px",zIndex:1e3},children:[(0,j.jsx)(b.A,{size:"small"}),(0,j.jsx)("span",{children:S})]}),w.map(((e,a)=>{w.length;const o=r?a:s.length-1-a,i=o+1,l=i<s.length,c=l?s[i]:null,d="human"===e.role&&!m.has(v)&&(o===s.length-1||l&&"assistant"!==(null===c||void 0===c?void 0:c.role));return(0,j.jsxs)("div",{className:"message ".concat(e.role).concat(d?" needs-response":""),children:["human"===e.role?(0,j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,j.jsx)("div",{className:"message-sender",children:"You:"}),(0,j.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[d&&R(o),(0,j.jsx)(A,{index:r?a:s.length-1-a})]})]}):(0,j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,j.jsx)("div",{className:"message-sender",children:"AI:"}),R(o)]}),(0,j.jsx)("div",{className:"message-content",children:(0,j.jsx)(t.Suspense,{fallback:(0,j.jsx)("div",{children:"Loading content..."}),children:(0,j.jsx)(I,{markdown:e.content,enableCodeApply:n})})})]},a)}))]})]})}))}}]);
3
- //# sourceMappingURL=88261.33450351.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/js/88261.33450351.chunk.js","mappings":";0QAEA,QADmB,CAAE,KAAQ,CAAE,IAAO,MAAO,MAAS,CAAE,QAAW,gBAAiB,UAAa,SAAW,SAAY,CAAC,CAAE,IAAO,OAAQ,MAAS,CAAE,EAAK,qbAAyb,KAAQ,OAAQ,MAAS,2BCMxmBA,EAAe,SAAsBC,EAAOC,GAC9C,OAAoBC,EAAAA,cAAoBC,EAAAA,GAAUC,EAAAA,EAAAA,GAAS,CAAC,EAAGJ,EAAO,CACpEC,IAAKA,EACLI,KAAMC,IAEV,EAOA,QAJ2BJ,EAAAA,WAAiBH,wCCFrC,MAAMQ,EAA0CC,IAAc,IAAb,MAACC,GAAMD,EAC3D,MAAM,gBACFE,E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X4G,GAAiB7B,EAAkB2B,IACpC3G,EAAAA,EAAAA,KAACvB,EAAW,CAACE,MAAO0E,EAAgB1E,EAAQC,EAAgBmF,OAAS,EAAIpF,WAIjFuB,EAAAA,EAAAA,MAAA,OAAKE,MAAO,CAACyF,QAAS,OAAQC,eAAgB,iBAAiB7F,SAAA,EAC3DD,EAAAA,EAAAA,KAAA,OAAKqG,UAAU,iBAAgBpG,SAAC,QACpD+E,EAAkB2B,OAGN3G,EAAAA,EAAAA,KAAA,OAAKqG,UAAU,kBAAiBpG,UAC5BD,EAAAA,EAAAA,KAAC8G,EAAAA,SAAQ,CAACC,UAAU/G,EAAAA,EAAAA,KAAA,OAAAC,SAAK,uBAAyBA,UAC9CD,EAAAA,EAAAA,KAACkD,EAAgB,CACb8D,SAAU5F,EAAIzB,QACdyD,gBAAiBA,UAzBpBzE,EA6BP,SAGZ","sources":["../node_modules/@ant-design/icons-svg/es/asn/SaveOutlined.js","../node_modules/@ant-design/icons/es/icons/SaveOutlined.js","components/EditSection.tsx","../node_modules/@ant-design/icons-svg/es/asn/RedoOutlined.js","../node_modules/@ant-design/icons/es/icons/RedoOutlined.js","components/Conversation.tsx"],"sourcesContent":["// This icon file is generated automatically.\nvar SaveOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z\" } }] }, \"name\": \"save\", \"theme\": \"outlined\" };\nexport default SaveOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport SaveOutlinedSvg from \"@ant-design/icons-svg/es/asn/SaveOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar SaveOutlined = function SaveOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: SaveOutlinedSvg\n }));\n};\n\n/**![save](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg5My4zIDI5My4zTDczMC43IDEzMC43Yy03LjUtNy41LTE2LjctMTMtMjYuNy0xNlYxMTJIMTQ0Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY3MzZjMCAxNy43IDE0LjMgMzIgMzIgMzJoNzM2YzE3LjcgMCAzMi0xNC4zIDMyLTMyVjMzOC41YzAtMTctNi43LTMzLjItMTguNy00NS4yek0zODQgMTg0aDI1NnYxMDRIMzg0VjE4NHptNDU2IDY1NkgxODRWMTg0aDEzNnYxMzZjMCAxNy43IDE0LjMgMzIgMzIgMzJoMzIwYzE3LjcgMCAzMi0xNC4zIDMyLTMyVjIwNS44bDEzNiAxMzZWODQwek01MTIgNDQyYy03OS41IDAtMTQ0IDY0LjUtMTQ0IDE0NHM2NC41IDE0NCAxNDQgMTQ0IDE0NC02NC41IDE0NC0xNDQtNjQuNS0xNDQtMTQ0LTE0NHptMCAyMjRjLTQ0LjIgMC04MC0zNS44LTgwLTgwczM1LjgtODAgODAtODAgODAgMzUuOCA4MCA4MC0zNS44IDgwLTgwIDgweiIgLz48L3N2Zz4=) */\nvar RefIcon = /*#__PURE__*/React.forwardRef(SaveOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SaveOutlined';\n}\nexport default RefIcon;","import React, {useState} from \"react\";\nimport {useChatContext} from '../context/ChatContext';\nimport {sendPayload} from \"../apis/chatApi\";\nimport {Message} from \"../utils/types\";\nimport {useFolderContext} from \"../context/FolderContext\";\nimport {Button, Tooltip, Input, Space} from \"antd\";\nimport { convertKeysToStrings } from '../utils/types';\nimport {EditOutlined, CheckOutlined, CloseOutlined, SaveOutlined} from \"@ant-design/icons\";\n\ninterface EditSectionProps {\n index: number;\n}\n\nexport const EditSection: React.FC<EditSectionProps> = ({index}) => {\n const {\n currentMessages,\n currentConversationId,\n addMessageToConversation,\n setIsStreaming,\n\tsetConversations,\n streamingConversations,\n\taddStreamingConversation,\n\tsetStreamedContentMap,\n\tremoveStreamingConversation\n } = useChatContext();\n \n const [isEditing, setIsEditing] = useState(false);\n const [editedMessage, setEditedMessage] = useState(currentMessages[index].content);\n const {checkedKeys} = useFolderContext();\n const {TextArea} = Input;\n\n const handleEdit = () => {\n setIsEditing(true);\n };\n \n const handleSave = () => {\n\t// Create a new array with the edited message\n const updatedMessages = currentMessages.map((msg, i) => {\n if (i === index) {\n return {\n ...msg,\n content: editedMessage,\n _timestamp: Date.now() // Update timestamp to mark as modified\n };\n }\n return msg;\n });\n // Update all messages to preserve the conversation\n updatedMessages.forEach(msg => addMessageToConversation(msg, currentConversationId));\n setIsEditing(false);\n };\n\n const handleCancel = () => {\n setIsEditing(false);\n setEditedMessage(currentMessages[index].content);\n };\n\n const handleSubmit = async () => {\n setIsEditing(false);\n\n\t// Clear any existing streamed content\n setStreamedContentMap(new Map());\n\n\t// Create truncated message array up to and including edited message\n const truncatedMessages = currentMessages.slice(0, index + 1);\n\n // Update the edited message\n truncatedMessages[index] = {\n ...truncatedMessages[index],\n content: editedMessage,\n _timestamp: Date.now()\n };\n // Set conversation to just the truncated messages\n setConversations(prev => prev.map(conv =>\n conv.id === currentConversationId\n ? { ...conv, messages: truncatedMessages }\n : conv\n ));\n\n\taddStreamingConversation(currentConversationId);\n try {\n const result = await sendPayload(\n currentConversationId,\n editedMessage,\n\t\tstreamingConversations.has(currentConversationId),\n\t\tcurrentMessages,\n setStreamedContentMap,\n setIsStreaming,\n convertKeysToStrings(checkedKeys),\n\t\taddMessageToConversation,\n\t\tremoveStreamingConversation\n );\n\n // Get the final streamed content\n const finalContent = result;\n\n if (finalContent) {\n const newAIMessage: Message = {\n content: finalContent,\n role: 'assistant'\n };\n addMessageToConversation(newAIMessage, currentConversationId);\n }\n } catch (error) {\n console.error('Error sending message:', error);\n removeStreamingConversation(currentConversationId);\n \t} finally {\n setIsStreaming(false);\n }\n };\n\n return (\n <div>\n {isEditing ? (\n <>\n <TextArea\n style={{width: '38vw', height: '100px'}}\n value={editedMessage}\n onChange={(e) => setEditedMessage(e.target.value)}\n />\n <Space style={{ marginTop: '8px' }}>\n <Button icon={<CloseOutlined />} onClick={handleCancel} size=\"small\">\n Cancel\n </Button>\n <Button icon={<SaveOutlined />} onClick={handleSave} size=\"small\">\n Save\n </Button>\n <Button icon={<CheckOutlined />} onClick={handleSubmit} size=\"small\" type=\"primary\">\n Submit\n </Button>\n </Space>\n </>\n ) : (\n <Tooltip title=\"Edit\">\n <Button icon={<EditOutlined/>} onClick={handleEdit}/>\n </Tooltip>\n )}\n </div>\n );\n}\n\n","// This icon file is generated automatically.\nvar RedoOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z\" } }] }, \"name\": \"redo\", \"theme\": \"outlined\" };\nexport default RedoOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport RedoOutlinedSvg from \"@ant-design/icons-svg/es/asn/RedoOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar RedoOutlined = function RedoOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: RedoOutlinedSvg\n }));\n};\n\n/**![redo](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTc1OC4yIDgzOS4xQzg1MS44IDc2NS45IDkxMiA2NTEuOSA5MTIgNTIzLjkgOTEyIDMwMyA3MzMuNSAxMjQuMyA1MTIuNiAxMjQgMjkxLjQgMTIzLjcgMTEyIDMwMi44IDExMiA1MjMuOWMwIDEyNS4yIDU3LjUgMjM2LjkgMTQ3LjYgMzEwLjIgMy41IDIuOCA4LjYgMi4yIDExLjQtMS4zbDM5LjQtNTAuNWMyLjctMy40IDIuMS04LjMtMS4yLTExLjEtOC4xLTYuNi0xNS45LTEzLjctMjMuNC0yMS4yYTMxOC42NCAzMTguNjQgMCAwMS02OC42LTEwMS43QzIwMC40IDYwOSAxOTIgNTY3LjEgMTkyIDUyMy45czguNC04NS4xIDI1LjEtMTI0LjVjMTYuMS0zOC4xIDM5LjItNzIuMyA2OC42LTEwMS43IDI5LjQtMjkuNCA2My42LTUyLjUgMTAxLjctNjguNkM0MjYuOSAyMTIuNCA0NjguOCAyMDQgNTEyIDIwNHM4NS4xIDguNCAxMjQuNSAyNS4xYzM4LjEgMTYuMSA3Mi4zIDM5LjIgMTAxLjcgNjguNiAyOS40IDI5LjQgNTIuNSA2My42IDY4LjYgMTAxLjcgMTYuNyAzOS40IDI1LjEgODEuMyAyNS4xIDEyNC41cy04LjQgODUuMS0yNS4xIDEyNC41YTMxOC42NCAzMTguNjQgMCAwMS02OC42IDEwMS43Yy05LjMgOS4zLTE5LjEgMTgtMjkuMyAyNkw2NjguMiA3MjRhOCA4IDAgMDAtMTQuMSAzbC0zOS42IDE2Mi4yYy0xLjIgNSAyLjYgOS45IDcuNyA5LjlsMTY3IC44YzYuNyAwIDEwLjUtNy43IDYuMy0xMi45bC0zNy4zLTQ3Ljl6IiAvPjwvc3ZnPg==) */\nvar RefIcon = /*#__PURE__*/React.forwardRef(RedoOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RedoOutlined';\n}\nexport default RefIcon;","import React, {useEffect, useRef, Suspense, memo} from \"react\";\nimport {useChatContext} from '../context/ChatContext';\nimport {EditSection} from \"./EditSection\";\nimport {Space, Spin, Button, Tooltip} from 'antd';\nimport {LoadingOutlined, RobotOutlined, RedoOutlined} from \"@ant-design/icons\";\nimport {sendPayload} from \"../apis/chatApi\";\nimport {useFolderContext} from \"../context/FolderContext\";\nimport {convertKeysToStrings} from \"../utils/types\";\n\n// Lazy load the MarkdownRenderer\nconst MarkdownRenderer = React.lazy(() => import(\"./MarkdownRenderer\"));\n\ninterface ConversationProps {\n enableCodeApply: boolean;\n}\n\nconst Conversation: React.FC<ConversationProps> = memo(({ enableCodeApply }) => {\n const {currentMessages, \n\t isTopToBottom, \n\t isLoadingConversation,\n\t addStreamingConversation,\n\t streamingConversations,\n currentConversationId,\n\t setIsStreaming,\n setStreamedContentMap,\n addMessageToConversation,\n removeStreamingConversation\n } = useChatContext();\n \n const {checkedKeys} = useFolderContext();\n const visibilityRef = useRef<boolean>(true);\n // Sort messages to maintain order\n const displayMessages = isTopToBottom ? currentMessages : [...currentMessages].reverse();\n\n // Keep track of rendered messages for performance monitoring\n const renderedCountRef = useRef(0);\n\n useEffect(() => {\n console.debug('Conversation messages updated:', {\n messageCount: currentMessages.length,\n previousCount: renderedCountRef.current,\n isVisible: visibilityRef.current,\n displayOrder: isTopToBottom ? 'top-down' : 'bottom-up'\n });\n\n if (currentMessages.length !== renderedCountRef.current) {\n renderedCountRef.current = currentMessages.length;\n console.log(`Rendered ${currentMessages.length} messages`);\n }\n\n // Set up visibility observer\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach(entry => {\n visibilityRef.current = entry.isIntersecting;\n console.debug('Conversation visibility changed:', {\n isVisible: entry.isIntersecting,\n messageCount: currentMessages.length\n });\n });\n },\n { threshold: 0.1 }\n );\n\n return () => observer.disconnect();\n }, [currentMessages.length]);\n\n // Loading indicator text based on progress\n const loadingText = isLoadingConversation \n ? currentMessages.length > 0\n ? `Loading messages (${currentMessages.length} loaded)...`\n : 'Loading conversation...'\n : '';\n\n // Progressive loading indicator\n const showProgressiveLoading = isLoadingConversation && currentMessages.length > 0;\n\n // Track whether we're in the initial loading state\n const isInitialLoading = isLoadingConversation && currentMessages.length === 0;\n\n // Function to determine if we need to show the retry button\n const shouldShowRetry = (index: number) => {\n\tconst message = currentMessages[index];\n const isLastMessage = index === currentMessages.length - 1;\n const nextIndex = index + 1;\n const nextMessage = nextIndex < currentMessages.length ? currentMessages[nextIndex] : null;\n const hasNextMessage = nextIndex < currentMessages.length;\n\n // Show retry if this is a human message and either:\n // 1. It's the last message, or\n // 2. The next message isn't from the assistant\n return message?.role === 'human' &&\n !streamingConversations.has(currentConversationId) &&\n (isLastMessage || \n (hasNextMessage && nextMessage?.role !== 'assistant'));\n };\n\n // Render retry button with explanation\n const renderRetryButton = (index: number) => {\n if (!shouldShowRetry(index)) return null;\n\n return (\n <Tooltip title=\"The AI response may have failed. Click to retry.\">\n <Button\n icon={<RedoOutlined />}\n type=\"primary\"\n size=\"small\"\n\t\t onClick={async () => {\n const message = currentMessages[index];\n\t\t\taddStreamingConversation(currentConversationId);\n\t\t\ttry {\n await sendPayload(\n currentConversationId,\n message.content,\n\t\t\t\tstreamingConversations.has(currentConversationId),\n currentMessages,\n setStreamedContentMap,\n setIsStreaming,\n convertKeysToStrings(checkedKeys),\n addMessageToConversation,\n removeStreamingConversation\n );\n } catch (error) {\n\t\t\t removeStreamingConversation(currentConversationId);\n console.error('Error retrying message:', error);\n }\n }}\n >\n Retry AI Response\n </Button>\n </Tooltip>\n );\n };\n return (\n <div style={{ position: 'relative' }}>\n {isInitialLoading && (\n <div style={{\n position: 'fixed',\n top: 'var(--header-height)',\n left: 'var(--folder-panel-width)',\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 1000\n }}>\n <Spin size=\"large\" tip={loadingText} />\n </div>\n )}\n <div \n style={{ \n opacity: isLoadingConversation ? 0.5 : 1,\n minHeight: '50px' // Ensure visibility detection\n }}\n className=\"conversation-messages-container\"\n >\n {showProgressiveLoading && (\n <div style={{\n position: 'sticky',\n top: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n color: '#fff',\n padding: '8px 16px',\n borderRadius: '4px',\n margin: '8px 0',\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n zIndex: 1000\n }}>\n <Spin size=\"small\" />\n <span>{loadingText}</span>\n </div>\n )}\n\t\t {displayMessages.map((msg, index) => {\n const isLastMessage = index === displayMessages.length - 1;\n\t\t // Convert display index to actual index for bottom-up mode\n const actualIndex = isTopToBottom ? index : currentMessages.length - 1 - index;\n const nextActualIndex = actualIndex + 1;\n const hasNextMessage = nextActualIndex < currentMessages.length;\n const nextMessage = hasNextMessage ? currentMessages[nextActualIndex] : null;\n const needsResponse = msg.role === 'human' &&\n !streamingConversations.has(currentConversationId) &&\n\t\t\t\t\t(actualIndex === currentMessages.length - 1 ||\n (hasNextMessage && nextMessage?.role !== 'assistant'));\n\n\t\t return <div\n key={index}\n className={`message ${msg.role}${\n needsResponse\n ? ' needs-response'\n : ''\n }`}\n >\n {msg.role === 'human' ? (\n <div style={{display: 'flex', justifyContent: 'space-between'}}>\n <div className=\"message-sender\">You:</div>\n\t\t\t\t<div style={{ display: 'flex', gap: '8px' }}>\n {needsResponse && renderRetryButton(actualIndex)}\n <EditSection index={isTopToBottom ? index : currentMessages.length - 1 - index}/>\n </div>\n </div>\n ) : (\n <div style={{display: 'flex', justifyContent: 'space-between'}}>\n <div className=\"message-sender\">AI:</div>\n\t\t\t {renderRetryButton(actualIndex)}\n </div>\n )}\n <div className=\"message-content\">\n <Suspense fallback={<div>Loading content...</div>}>\n <MarkdownRenderer \n markdown={msg.content} \n enableCodeApply={enableCodeApply}\n />\n </Suspense>\n </div>\n </div>;\n })}\n </div>\n </div>\n );\n}); \n\nexport default Conversation;\n"],"names":["SaveOutlined","props","ref","React","AntdIcon","_extends","icon","SaveOutlinedSvg","EditSection","_ref","index","currentMessages","currentConversationId","addMessageToConversation","setIsStreaming","setConversations","streamingConversations","addStreamingConversation","setStreamedContentMap","removeStreamingConversation","useChatContext","isEditing","setIsEditing","useState","editedMessage","setEditedMessage","content","checkedKeys","useFolderContext","TextArea","Input","_jsx","children","_jsxs","_Fragment","style","width","height","value","onChange","e","target","Space","marginTop","Button","CloseOutlined","onClick","handleCancel","size","handleSave","map","msg","i","_objectSpread","_timestamp","Date","now","forEach","CheckOutlined","async","Map","truncatedMessages","slice","prev","conv","id","messages","result","sendPayload","has","convertKeysToStrings","role","error","console","type","Tooltip","title","EditOutlined","handleEdit","RedoOutlined","RedoOutlinedSvg","MarkdownRenderer","memo","enableCodeApply","isTopToBottom","isLoadingConversation","visibilityRef","useRef","displayMessages","reverse","renderedCountRef","useEffect","debug","messageCount","length","previousCount","current","isVisible","displayOrder","log","concat","observer","IntersectionObserver","entries","entry","isIntersecting","threshold","disconnect","loadingText","showProgressiveLoading","isInitialLoading","renderRetryButton","message","isLastMessage","nextIndex","nextMessage","hasNextMessage","shouldShowRetry","position","top","left","right","bottom","backgroundColor","display","justifyContent","alignItems","zIndex","Spin","tip","opacity","minHeight","className","color","padding","borderRadius","margin","gap","actualIndex","nextActualIndex","needsResponse","Suspense","fallback","markdown"],"sourceRoot":""}