PageSourceSearch

https://toolbreezy.com/_next/static/chunks/26300-8a273f7f4e0be1c4.js

js toolbreezy.com collected 2026-10-02 01:48:23 UTC 59,661 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26300],{26300:(e,t,a)=>{a.r(t),a.d(t,{buildShareLink:()=>el,default:()=>er});var l=a(45993),r=a(75837),s=a(77771),n=a(30845),i=a(35323),o=a(73950),d=a(22925),c=a(35578),h=a(78606),u=a(35943),m=a(14851),g=a(99935),p=a(72150),x=a(4361),f=a(14552),b=a(17832),v=a(35339);let w=[{id:"okabe",name:"Colorblind safe (Okabe-Ito)",colors:["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#666666"]},{id:"vivid",name:"Vivid",colors:["#2563eb","#f97316","#16a34a","#dc2626","#9333ea","#0891b2","#ca8a04","#db2777","#4f46e5","#65a30d"]},{id:"ocean",name:"Ocean",colors:["#0f4c81","#1d7fa8","#3aa8c1","#6fc6d1","#0e7490","#155e75","#134e4a","#2dd4bf"]},{id:"sunset",name:"Sunset",colors:["#7c2d12","#c2410c","#ea580c","#f97316","#fb923c","#be123c","#e11d48","#f43f5e"]},{id:"forest",name:"Forest",colors:["#14532d","#166534","#15803d","#22c55e","#4ade80","#3f6212","#65a30d","#a3e635"]},{id:"pastel",name:"Pastel",colors:["#a5b4fc","#fca5a5","#86efac","#fcd34d","#f9a8d4","#7dd3fc","#c4b5fd","#fdba74"]},{id:"ramp",name:"Blue ramp (ordered data)",colors:["#dbeafe","#bfdbfe","#93c5fd","#60a5fa","#3b82f6","#2563eb","#1d4ed8","#1e40af"]},{id:"print",name:"Print gray",colors:["#111827","#374151","#6b7280","#9ca3af","#d1d5db","#4b5563","#1f2937","#e5e7eb"]}],y=[{id:"arial",name:"Arial / Helvetica",stack:"Arial, Helvetica, sans-serif"},{id:"verdana",name:"Verdana",stack:"Verdana, Geneva, sans-serif"},{id:"trebuchet",name:"Trebuchet MS",stack:"'Trebuchet MS', Tahoma, sans-serif"},{id:"georgia",name:"Georgia",stack:"Georgia, 'Times New Roman', serif"},{id:"times",name:"Times New Roman",stack:"'Times New Roman', Times, serif"},{id:"courier",name:"Courier New",stack:"'Courier New', Courier, monospace"}],j=[{id:"standard",name:"Standard",w:1200,h:750},{id:"slide",name:"Slide 16:9",w:1280,h:720},{id:"social",name:"Social 16:9 wide",w:1600,h:900},{id:"square",name:"Square",w:1e3,h:1e3},{id:"a4land",name:"A4 landscape",w:1754,h:1240},{id:"a4port",name:"A4 portrait",w:1240,h:1754},{id:"word",name:"Word column 6.5 in",w:975,h:610}],k=[{id:"en-US",name:"1,234.56 (US)"},{id:"en-GB",name:"1,234.56 (UK)"},{id:"de-DE",name:"1.234,56 (German)"},{id:"fr-FR",name:"1 234,56 (French)"},{id:"en-IN",name:"1,23,456 (Indian)"}],N=[{name:"Sales by region",title:"Revenue by region",text:"Region	Q1	Q2	Q3	Q4\nNorth	128400	141200	139800	162300\nSouth	96100	102400	118900	127600\nEast	74800	81300	79200	93500\nWest	112700	108900	121400	134800"},{name:"Survey answers",title:"How often do you cook at home?",text:"Answer, Responses\nAlmost every day, 142\nA few times a week, 96\nAbout once a week, 41\nRarely, 18\nNever, 6"},{name:"One row per combination",title:"Signups by channel",text:"Month	Channel	Signups\nJan	Organic	1840\nJan	Paid	920\nFeb	Organic	2110\nFeb	Paid	1040\nMar	Organic	2380\nMar	Paid	880"},{name:"Scores that look close",title:"Customer satisfaction by store",text:"Store	Score\nDowntown	92\nRiverside	94\nAirport	91\nUptown	95",axisMin:"90"}],M=/[$€£¥₹₽¢₩₪₺₫]/g,$=/[    ']/g;function S(e){let t=e.trim();if(!t)return null;let a=!1;if(t.startsWith("-")?(a=!0,t=t.slice(1).trim()):t.startsWith("+")&&(t=t.slice(1).trim()),t=t.replace($,""),!/^[\d.,]+$/.test(t))return null;let l=t.includes("."),r=t.includes(",");if(l&&r?t=t.lastIndexOf(",")>t.lastIndexOf(".")?t.replace(/\./g,"").replace(",","."):t.replace(/,/g,""):r&&(t=/^\d{1,3}(,\d{3})+$/.test(t)?t.replace(/,/g,""):t.replace(",",".")),!/^\d+(\.\d+)?$/.test(t)&&!/^\.\d+$/.test(t))return null;let s=Number(t);return Number.isFinite(s)?a?-s:s:null}function C(e){let t=e.trim().replace(/^"(.*)"$/s,"$1").replace(/^'(.*)'$/s,"$1").trim();if(!t)return null;if(/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(t)){let e=Number(t);return Number.isFinite(e)?e:null}let a=!1;/^\(.*\)$/.test(t)&&(a=!0,t=t.slice(1,-1).trim()),(t=t.replace(M,"").trim()).endsWith("%")&&(t=t.slice(0,-1).trim());let l=1,r=t.match(/^(.+?)(bn|mm|[kmbt])$/i);if(r&&null!==S(r[1])){let e=r[2].toLowerCase();l="k"===e?1e3:"m"===e||"mm"===e?1e6:"b"===e||"bn"===e?1e9:1e12,t=r[1]}else{let e=t.match(/^([\d.,'+\-    ]+)\s*([A-Za-z°/]{1,6})$/);e&&null!==S(e[1])&&(t=e[1])}let s=S(t);if(null===s)return null;let n=s*l;return a?-n:n}function z(e){return""!==e.trim()&&null!==C(e)}let F=["	",";","|",","];function T(e){let t=[];for(let a of e){let e=t[t.length-1];void 0!==e&&/^\d{3}$/.test(a.trim())&&/\d$/.test(e.trim())?t[t.length-1]=`${e.trim()}${a.trim()}`:t.push(a)}return t}function I(e){return e.trim().replace(/^"(.*)"$/s,"$1").replace(/""/g,'"').trim()}function P(e){if(e.length<4||!e.every(e=>3===e.length))return!1;let t=e.filter(e=>z(e[1]??"")).length,a=e.filter(e=>z(e[2]??"")).length;return 0===t&&a>=Math.ceil(.8*e.length)}function A(e,t){let a=e.length>2e5,l=(a?e.slice(0,2e5):e).replace(/\r\n?/g,"\n").split("\n").map(e=>
1e.trim()).filter(Boolean);if(!l.length)return{grid:[],delimiter:null,merged:!1,headerGuided:!1,truncated:a};let r=function(e){for(let t of F)if(e.filter(e=>e.includes(t)).length>=Math.max(1,Math.ceil(.6*e.length)))return t;return null}(l),s=l.map(e=>{if(!r){let t=e.match(/^(.*?)\s{2,}(.+)$/);if(t)return[t[1],...t[2].split(/\s{2,}/)];let a=e.match(/^(.*?)\s+(\S+)$/);return a?[a[1],a[2]]:[e]}return function(e,t){let a=[],l="",r=!1;for(let s=0;s<e.length;s++){let n=e[s];if('"'===n){r&&'"'===e[s+1]?(l+='"',s++):r=!r;continue}if(n===t&&!r){a.push(l),l="";continue}l+=n}return a.push(l),a}(e,r)}),n=!1,i=!1;if(","===r&&"off"!==t){let e=s[0],a=s.slice(1),l=!!e&&a.length>0&&!e.slice(1).some(z),r=!1;if(l&&e){let t=e.length,l=a.filter(e=>e.length>t).length;l>0&&l>=Math.ceil(.5*a.length)?(i=!0,s=[e,...a.map(e=>e.length>t?T(e):e)],n=!0):r=a.every(e=>e.length<=t)}!n&&("on"===t||!r&&function(e){if(!e.length)return!1;let t=Math.max(...e.map(e=>e.length));if(t<3)return!1;for(let a=1;a<t;a++){let t=e.filter(e=>""!==(e[a]??"").trim());if(!(!t.length||t.some(e=>!/^\d{3}$/.test((e[a]??"").trim())))&&!t.some(e=>!/^-?\d{1,3}$/.test((e[a-1]??"").trim())))return!0}return!1}(s.slice(+!!l)))&&(s=[...l&&e?[e]:[],...(l?s.slice(1):s).map(T)],n=!0)}return{grid:s.map(e=>e.map(I)),delimiter:r,merged:n,headerGuided:i,truncated:a}}function J(e){return e.map(e=>e.map(e=>e.replace(/\t/g," ")).join("	")).join("\n")}function D(e,t){return J([["Category",...t.map(e=>e.name)],...e.map((e,a)=>[e,...t.map(e=>{let t=e.values[a];return null==t?"":String(t)})])])}let L=h.X8,E={protanopia:[[.152286,1.052583,-.204868],[.114503,.786281,.099224],[-.003882,-.048116,1.051998]],deuteranopia:[[.367322,.860646,-.227968],[.280085,.672501,.047413],[-.01182,.04294,.968881]],tritanopia:[[1.255528,-.076749,-.178779],[-.078411,.930809,.147602],[.004733,.691367,.3039]]};function R(e,t,a){let l=(.4124*e+.3576*t+.1805*a)/.95047,r=.2126*e+.7152*t+.0722*a,s=(.0193*e+.1192*t+.9505*a)/1.08883,n=e=>e>.008856?Math.cbrt(e):7.787*e+16/116;return l=n(l),[116*(r=n(r))-16,500*(l-r),200*(r-(s=n(s)))]}function V(e,t){let a=E[t],[l,r,s]=(function(e){let t=e.replace("#","");return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)]:t.length<6?[128,128,128]:[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]})(e).map(e=>{let t;return(t=e/255)<=.04045?t/12.92:((t+.055)/1.055)**2.4});return[a[0][0]*l+a[0][1]*r+a[0][2]*s,a[1][0]*l+a[1][1]*r+a[1][2]*s,a[2][0]*l+a[2][1]*r+a[2][2]*s]}let O=null,G=new Map;function B(e,t,a,l){let r,s=`${t}|${a}|${l}|${e}`,n=G.get(s);return void 0!==n?n:("undefined"==typeof document?r=e.length*t*.55:(O||(O=(0,p.hk)()),O?(O.font=`${a} ${t}px ${l}`,r=O.measureText(e).width):r=e.length*t*.55),G.size>6e3&&G.clear(),G.set(s,r),r)}function U(e,t,a,l,r){if(B(e,a,l,r)<=t)return e;let s=0,n=e.length;for(;s<n;){let i=Math.ceil((s+n)/2);B(`${e.slice(0,i)}…`,a,l,r)<=t?s=i:n=i-1}return s<=0?"…":`${e.slice(0,s)}…`}function W(e){let t=new Intl.NumberFormat(e.locale,{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals}),a=new Intl.NumberFormat(e.locale,{notation:"compact",maximumFractionDigits:1});return l=>{if(!Number.isFinite(l))return"";let r=e.compact&&Math.abs(l)>=1e4?a.format(l):t.format(l);return`${e.prefix}${r}${e.suffix}`}}let Y=e=>Math.round(100*e)/100;function _(e,t,a){let l,r,s,n,i=[],o="none"===a.bg||(0,h.bp)((0,h.IF)(a.bg))>h.Dg,d=o?"#111827":"#f8fafc",c=o?"#4b5563":"#cbd5e1",m=o?"#e5e7eb":"#334155",g=o?"#9ca3af":"#64748b",p=a.font,x=0,f=0,b=e.length,v=t.length;if(!b||!v)return{w:a.w,h:a.h,bg:a.bg,font:p,els:i,hiddenLabels:0,shortenedNames:0}
1;let w=(e,l)=>{let r=t[e]?.values[l];return null==r?a.blankAsZero?0:null:r},y="stacked"===a.shape||"pct100"===a.shape,j=[];if("pct100"===a.shape)for(let e=0;e<b;e++){let l=function(e,t){let a=e.reduce((e,t)=>e+t,0);if(a<=0)return e.map(()=>0);let l=10**t,r=Math.round(100*l),s=e.map(e=>e/a*r),n=s.map(e=>Math.floor(e)),i=r-n.reduce((e,t)=>e+t,0),o=s.map((e,t)=>({i:t,frac:e-Math.floor(e)})).sort((e,t)=>t.frac-e.frac);for(let e=0;i>0&&o.length>0&&e<3*o.length;e++){let t=o[e%o.length].i;n[t]=(n[t]??0)+1,i--}return n.map(e=>e/l)}(t.map((t,a)=>Math.max(0,w(a,e)??0)),a.decimals);for(let t=0;t<v;t++)j[t]||(j[t]=[]),j[t][e]=null===w(t,e)?null:l[t]??0}else for(let t=0;t<v;t++)j[t]=e.map((e,a)=>w(t,a));let k=0,N=0;if("pct100"===a.shape)k=0,N=100;else if("stacked"===a.shape)for(let e=0;e<b;e++){let t=0,a=0;for(let l=0;l<v;l++){let r=j[l]?.[e]??null;null!==r&&(r>=0?t+=r:a+=r)}N=Math.max(N,t),k=Math.min(k,a)}else for(let e=0;e<v;e++)for(let t=0;t<b;t++){let a=j[e]?.[t]??null;null!==a&&(N=Math.max(N,a),k=Math.min(k,a))}let M="log"===a.scale&&k>0;if(M)l=function(e,t){let a=10**Math.floor(Math.log10(Math.max(e,1e-9))),l=10**Math.ceil(Math.log10(Math.max(t,10*a))),r=3>=Math.log10(l/a)?[1,2,5]:[1],s=[];for(let e=a,t=0;e<=1.000001*l&&t<40;e*=10,t++)for(let t of r){let r=e*t;r>=a-1e-12&&r<=1.000001*l&&s.push(r)}return{ticks:s,lo:a,hi:l,decimals:(0,u.Ed)(s)}}(k,N);else if("pct100"===a.shape)l={ticks:[0,20,40,60,80,100],lo:0,hi:100,decimals:0};else{let e=null!==a.axisMin&&a.axisMin>k&&a.axisMin<N;l=function(e,t,a,l){let r=t;r>e||(r=e+Math.max(1,.1*Math.abs(e)));let s=(0,u.Y8)((r-e)/6),n=l?e:Math.floor(e/s)*s,i=Math.ceil(r/s)*s,o=[],d=(0,u.hm)(s);for(let e=0;e<=400;e++){let t=n+e*s;if(o.push(Number(t.toFixed(d))),t>=i-1e-9*s)break}return{ticks:o,lo:n,hi:o[o.length-1]??i,decimals:(0,u.Ed)(o)}}(e?a.axisMin:k,N,0,e)}let $=l.lo,S=l.hi,C=W({...a.fmtOpts,decimals:Math.max(a.fmtOpts.decimals,l.decimals)}),z=l.ticks.map(e=>"pct100"===a.shape?a.pctFmt(e):C(e)),F=28;a.title.trim()&&(i.push({k:"text",x:a.w/2,y:F+26,t:a.title.trim(),size:27,fill:d,anchor:"middle",weight:700}),F+=40),a.subtitle.trim()&&(i.push({k:"text",x:a.w/2,y:F+16,t:a.subtitle.trim(),size:15,fill:c,anchor:"middle",weight:400}),F+=26),F+=10;let T=a.h-28;a.source.trim()&&(i.push({k:"text",x:28,y:T,t:a.source.trim(),size:12,fill:c,anchor:"start",weight:400}),T-=22);let I=e=>18+B(e,14,500,p)+20,P=0,A=0,J=[],D="none"!==a.legendPos&&v>1;if(D)if("right"===a.legendPos)P=Math.min(260,Math.max(...t.map(e=>I(e.name))));else{let e=a.w-56,l=[],r=0;t.forEach((t,a)=>{let s=I(t.name);r+s>e&&l.length&&(J.push(l),l=[],r=0),l.push(a),r+=s}),l.length&&J.push(l),A=22*J.length+8}let E=F,R=T;D&&"top"===a.legendPos&&(E+=A),D&&"bottom"===a.legendPos&&(R-=A);let V=Math.max(...z.map(e=>B(e,13,400,p))),O=a.w-28-(D&&"right"===a.legendPos?P+14:0),G=E,_=0,q=e.slice();if("vertical"===a.orient){let t,a=(s=Math.max(60,O-(r=28+V+12)))/b,l=Math.max(...e.map(e=>B(e,13,400,p)));t=0==(_=l+8<=a?0:a>=17?-45:-90)?25:-45===_?.7071*l+14:l+14;let i=Math.max(27,(R-E)*.4);if(t>i){let a=-45===_?(i-14)/.7071:i-14;q=e.map(e=>{let t=U(e,a,13,400,p);return t!==e&&f++,t}),t=i}n=Math.max(60,R-E-t)}else{let t=Math.max(...e.map(e=>B(e,13,400,p))),l=Math.max(60,(a.w-56)*.32),i=Math.min(t+12,l);t+12>l&&(q=e.map(e=>{let t=U(e,l-12,13,400,p);return t!==e&&f++,t}),i=l),s=Math.max(60,O-(r=28+i)),n=Math.max(60,R-E-27)}let H=r+s,Q=G+n,Z=S-$,K=e=>M?(Math.log10(Math.max(e,$))-Math.log10($))/(Math.log10(S)-Math.log10($)):0===Z?0:(e-$)/Z,X=e=>Math.min(Q,Math.max(G,Q-K(e)*n)),ee=e=>Math.max(r,Math.min(H,r+K(e)*s)),et=M?$:Math.min(Math.max(0,$),S),ea=X(et),el=ee(et);l.ticks.forEach((e,t)=>{if("vertical"===a.orient){let l=Y(X(e));a.gridlines&&i.push({k:"line",x1:r,y1:l,x2:H,y2:l,stroke:m,sw:1}),i.push({k:"text",x:r-8,y:l+4,t:z[t],size:13,fill:c,anchor:"end",weight:400})}else{let l=Y(ee(e));a.gridlines&&i.push({k:"line",x1:l,y1:G,x2:l,y2:Q,stroke:m,sw:1}),i.push({k:"text",x:l,y:Q+13+6,t:z[t],size:13,fill:c,anchor:"middle",weight:400})}});let er=[],es=Math.min(.6,Math.max(.05,a.barGap));if("vertical"===a.orient){let e=s/b,l=e*(1-es),i=y?l:l/v;for(let s=0;s<b;s++){let o=r+s*e+(e-l)/2,d=et,c=et;for(let e=0;e<v;e++){let l,r,h=j[e]?.[s]??null;if(null===h)continue;let u=a.colors[e%a.colors.length]??"#64748b";y?h>=0?(l=X(d),d+=h,r=X(d)):(l=X(c),c+=h,r=X(c)):(l=ea,r=X(h));let m=Math.min(l,r),g=Math.abs(r-l);er.push({cat:s,ser:e,value:t[e]?.values[s]??0,shown:h,x:Y(o+(y?0:e*i)+1),y:Y(Math.min(m,Q)),w:Y(Math.max(1,i-2)),h:Y(Math.max(0,Math.min(g,n))),color:u})}}}else{let e=n/b,l=e*(1-es),i=y?l:l/v;for(let n=0;n<b;n++){let o=G+n*e+(e-l)/2,d=et,c=et;for(let e=0;e<v;e++){let l,h,u=j[e]?.[n]??null;if(null===u)continue;let m=a.colors[e%a.colors.length]??"#64748b";y?u>=0?(l=ee(d),d+=u,h=ee(d)):(l=ee(c),c+=u,h=ee(c)):(l=el,h=ee(u));let g=Math.min(l,h),p=Math.abs(h-l);er.push({cat:n,ser:e,value:t[e]?.values[n]??0,shown:u,x:Y(Math.max(g,r)),y:Y(o+(y?0:e*i)+1),w:Y(Math.max(0,Math.min(p,s))),h:Y(Math.max(1,i-2)),color:m})}}}for(let e of er)i.push({k:"rect",x:e.x,y:e.y,w:e.w,h:e.h,rx:Math.min(a.radius,e.w
1/2,e.h/2),fill:e.color});if("vertical"===a.orient?i.push({k:"line",x1:r,y1:Y(ea),x2:H,y2:Y(ea),stroke:g,sw:1.5}):i.push({k:"line",x1:Y(el),y1:G,x2:Y(el),y2:Q,stroke:g,sw:1.5}),"auto"===a.labelMode)for(let e of er){let t="pct100"===a.shape?a.pctFmt(e.shown):a.fmt(e.value);if(!t)continue;let l=B(t,12,600,p);if("vertical"===a.orient)if(e.w>=l+8&&e.h>=22)i.push({k:"text",x:Y(e.x+e.w/2),y:Y(e.y+12+4),t,size:12,fill:L(e.color),anchor:"middle",weight:600});else if(e.h>=l+12&&e.w>=16){let a=Y(e.x+e.w/2),r=Y(e.y+6+l/2);i.push({k:"text",x:a,y:r,t,size:12,fill:L(e.color),anchor:"middle",weight:600,rot:-90})}else l<=e.w+12&&e.y-12-4>=E?i.push({k:"text",x:Y(e.x+e.w/2),y:Y(e.y-5),t,size:12,fill:c,anchor:"middle",weight:600}):x++;else e.w>=l+10&&e.h>=16?i.push({k:"text",x:Y(e.x+e.w-6),y:Y(e.y+e.h/2+4.32),t,size:12,fill:L(e.color),anchor:"end",weight:600}):e.h>=l+10&&e.w>=16?i.push({k:"text",x:Y(e.x+e.w/2),y:Y(e.y+e.h/2),t,size:12,fill:L(e.color),anchor:"middle",weight:600,rot:-90}):e.x+e.w+l+8<=H&&e.h>=13?i.push({k:"text",x:Y(e.x+e.w+6),y:Y(e.y+e.h/2+4.32),t,size:12,fill:c,anchor:"start",weight:600}):x++}if("vertical"===a.orient){let e=s/b;q.forEach((t,a)=>{let l=r+a*e+e/2;0===_?i.push({k:"text",x:Y(l),y:Y(Q+13+8),t:t,size:13,fill:c,anchor:"middle",weight:400}):i.push({k:"text",x:Y(l),y:Y(Q+14),t:t,size:13,fill:c,anchor:"end",weight:400,rot:_})})}else{let e=n/b;q.forEach((t,a)=>{i.push({k:"text",x:Y(r-8),y:Y(G+a*e+e/2+4.68),t:t,size:13,fill:c,anchor:"end",weight:400})})}if(null!==a.refValue&&a.refValue>=$&&a.refValue<=S){let e=a.refLabel.trim()||a.fmt(a.refValue);if("vertical"===a.orient){let t=Y(X(a.refValue));i.push({k:"line",x1:r,y1:t,x2:H,y2:t,stroke:"#ef4444",sw:1.6,dash:"7 5"}),i.push({k:"text",x:H-4,y:t-6,t:e,size:12,fill:"#ef4444",anchor:"end",weight:600})}else{let t=Y(ee(a.refValue));i.push({k:"line",x1:t,y1:G,x2:t,y2:Q,stroke:"#ef4444",sw:1.6,dash:"7 5"}),i.push({k:"text",x:t+5,y:G+12,t:e,size:12,fill:"#ef4444",anchor:"start",weight:600})}}if(D)if("right"===a.legendPos){let e=a.w-28-P,l=Math.max(E,G+n/2-22*v/2);t.forEach((t,r)=>{let s=l+22*r;i.push({k:"rect",x:e,y:s,w:12,h:12,rx:2,fill:a.colors[r%a.colors.length]??"#64748b"}),i.push({k:"text",x:e+12+6,y:s+12-1,t:U(t.name,P-12-10,14,500,p),size:14,fill:r===a.highlight?d:c,anchor:"start",weight:r===a.highlight?700:500})})}else{let e="top"===a.legendPos?F+4:R+6;J.forEach((l,r)=>{let s=28,n=e+22*r;for(let e of l){let l=t[e];i.push({k:"rect",x:s,y:n,w:12,h:12,rx:2,fill:a.colors[e%a.colors.length]??"#64748b"}),i.push({k:"text",x:s+12+6,y:n+12-1,t:l.name,size:14,fill:e===a.highlight?d:c,anchor:"start",weight:e===a.highlight?700:500}),s+=I(l.name)}})}return M&&i.push({k:"text",x:28,y:E-6,t:"Log scale",size:11,fill:c,anchor:"start",weight:600}),{w:a.w,h:a.h,bg:a.bg,font:p,els:i,hiddenLabels:x,shortenedNames:f}}function q({scene:e,className:t}){return(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${e.w} ${e.h}`,width:e.w,height:e.h,className:t,role:"img","aria-label":"Bar chart preview",children:["none"!==e.bg&&(0,l.jsx)("rect",{width:e.w,height:e.h,fill:e.bg}),e.els.map((t,a)=>"rect"===t.k?(0,l.jsx)("rect",{x:t.x,y:t.y,width:t.w,height:t.h,rx:t.rx,fill:t.fill},a):"line"===t.k?(0,l.jsx)("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.stroke,strokeWidth:t.sw,strokeDasharray:t.dash},a):(0,l.jsx)("text",{x:t.x,y:t.y,fill:t.fill,fontFamily:e.font,fontSize:t.size,fontWeight:t.weight,textAnchor:t.anchor,transform:t.rot?`rotate(${t.rot} ${t.x} ${t.y})`:void 0,children:t.t},a))]})}function H(e){return e.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").slice(0,40).toLowerCase()||"bar-chart"}async function Q(e){let t=globalThis.CompressionStream;if(!t)return null;try{let a=new t("deflate-raw"),l=a.writable.getWriter();l.write(new TextEncoder().encode(e)),l.close();let r=a.readable.getReader(),s=[],n=0;for(;;){let{done:e,value:t}=await r.read();if(e)break;t&&(s.push(t),n+=t.byteLength)}let i=new Uint8Array(n),o=0;for(let e of s)i.set(e,o),o+=e.byteLength;let d="";for(let e of i)d+=String.fromCharCode(e);return btoa(d).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch{return null}}async function Z(e){let t=globalThis.DecompressionStream,a=function(e){try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=atob(t+"=".repeat((4-t.length%4)%4)),l=new Uint8Array(a.length);for(let e=0;e<a.length;
1e++)l[e]=a.charCodeAt(e);return l}catch{return null}}(e);if(!t||!a)return null;try{let e=new t("deflate-raw"),l=e.writable.getWriter();l.write(a),l.close();let r=e.readable.getReader(),s=[],n=0;for(;;){let{done:e,value:t}=await r.read();if(e)break;t&&(s.push(t),n+=t.byteLength)}let i=new Uint8Array(n),o=0;for(let e of s)i.set(e,o),o+=e.byteLength;return new TextDecoder().decode(i)}catch{return null}}let K="h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",X="w-full accent-primary",ee="toolbreezy.bar-graph-maker",et=/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,ea=["bgmz","bgmd","bgmt","bgmst","bgmsr","bgmsh","bgmor","bgmso","bgmlp","bgmvl","bgmpl","bgmbg","bgmfn","bgmsz","bgmex","bgmes","bgmew","bgmdpi","bgmph","bgmpu","bgmam","bgmrv","bgmrl","bgmlc","bgmdc","bgmcp","bgmpx","bgmsx","bgmsc"];function el(e){let t="the chart data and labels you typed",a=e.packed;return(0,d.CZ)([{key:"bgmz",value:a&&a.length<=2400?a:null,personal:t},{key:"bgmd",value:!a&&e.text.length<=1400?e.text:null,personal:t},{key:"bgmt",value:e.title||null,personal:t},{key:"bgmst",value:e.subtitle||null,personal:t},{key:"bgmsr",value:e.source||null,personal:t},{key:"bgmsh",value:e.shape},{key:"bgmor",value:e.orient},{key:"bgmso",value:e.sort},{key:"bgmlp",value:e.legendPos},{key:"bgmvl",value:"auto"===e.labelMode?"1":null},{key:"bgmpl",value:e.paletteId},{key:"bgmbg",value:"none"===e.bg?"none":e.bg.replace("#","")},{key:"bgmfn",value:e.fontId},{key:"bgmsz",value:e.sizeId},{key:"bgmex",value:e.exportMode},{key:"bgmes",value:"scale"===e.exportMode?String(e.exportScale):null},{key:"bgmew",value:"width"===e.exportMode?e.exportWidth:null},{key:"bgmdpi",value:"dpi"===e.exportMode?String(e.dpi):null},{key:"bgmph",value:"dpi"===e.exportMode?e.physical:null},{key:"bgmpu",value:"dpi"===e.exportMode?e.physUnit:null},{key:"bgmam",value:e.axisMinText.trim()||null},{key:"bgmrv",value:e.refText.trim()||null},{key:"bgmrl",value:e.refLabel.trim()||null,personal:t},{key:"bgmlc",value:e.locale},{key:"bgmdc",value:String(e.decimals)},{key:"bgmcp",value:e.compact?null:"0"},{key:"bgmpx",value:e.prefix||null},{key:"bgmsx",value:e.suffix||null},{key:"bgmsc",value:"log"===e.scaleMode?"log":null}])}function er(){let[e,t]=(0,r.useState)(N[0].text),[a,h]=(0,r.useState)(N[0].title),[u,p]=(0,r.useState)(""),[M,$]=(0,r.useState)(""),[S,F]=(0,r.useState)("auto"),[T,I]=(0,r.useState)("grouped"),[L,O]=(0,r.useState)("vertical"),[G,B]=(0,r.useState)("input"),[U,Y]=(0,r.useState)("top"),[er,es]=(0,r.useState)("none"),[en,ei]=(0,r.useState)("okabe"),[eo,ed]=(0,r.useState)({}),[ec,eh]=(0,r.useState)("#ffffff"),[eu,em]=(0,r.useState)("arial"),[eg,ep]=(0,r.useState)("standard"),[ex,ef]=(0,r.useState)(!0),[eb,ev]=(0,r.useState)(.28),[ew,ey]=(0,r.useState)(3),[ej,ek]=(0,r.useState)(!1),[eN,eM]=(0,r.useState)("linear"),[e$,eS]=(0,r.useState)(""),[eC,ez]=(0,r.useState)(""),[eF,eT]=(0,r.useState)(""),[eI,eP]=(0,r.useState)("en-US"),[eA,eJ]=(0,r.useState)(0),[eD,eL]=(0,r.useState)(!0),[eE,eR]=(0,r.useState)(""),[eV,eO]=(0,r.useState)(""),[eG,eB]=(0,r.useState)("scale"),[eU,eW]=(0,r.useState)(2),[eY,e_]=(0,r.useState)("1920"),[eq,eH]=(0,r.useState)(300),[eQ,eZ]=(0,r.useState)("6.5"),[eK,eX]=(0,r.useState)("in"),[e0,e1]=(0,r.useState)(-1),[e2,e4]=(0,r.useState)(!1),[e5,e3]=(0,r.useState)(!1),[e6,e8]=(0,r.useState)(!1),[e7,e9]=(0,r.useState)(""),[te,tt]=(0,r.useState)(!1),[ta,tl]=(0,r.useState)(null),tr=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!1;return(async()=>{let a=(0,d.qA)(window.location.search,window.location.hash);if((0,d.Yc)(a,ea)){let l=a.get("bgmz");if(l){let a=await Z(l);a&&!e&&t(a)}else{let e=a.get("bgmd");e&&t(e)}let r=a.get("bgmt");null!==r&&h(r);let s=a.get("bgmst");null!==s&&p(s);let n=a.get("bgmsr");null!==n&&$(n);let i=a.get("bgmsh");("grouped"===i||"stacked"===i||"pct100"===i)&&I(i),"horizontal"===a.get("bgmor")&&O("horizontal");let o=a.get("bgmso");("input"===o||"asc"===o||"desc"===o||"alpha"===o)&&B(o);let d=a.get("bgmlp");("top"===d||"right"===d||"bottom"===d||"none"===d)&&Y(d),"1"===a.get("bgmvl")&&es("auto");let c=a.get("bgmpl");c&&w.some(e=>e.id===c)&&ei(c);let u=a.get("bgmbg");u&&eh("none"===u?"none":`#${u}`);let m=a.get("bgmfn");m&&y.some(e=>e.id===m)&&em(m);let g=a.get("bgmex");("scale"===g||"width"===g||"dpi"===g)&&eB(g);let x=Number(a.get("bgmes"));Number.isFinite(x)&&x>=1&&x<=8&&eW(x);let f=a.get("bgmew");f&&Number.isFinite(Number(f))&&e_(f);let b=Number(a.get("bgmdpi"));Number.isFinite(b)&&b>0&&eH(b);let v=a.get("bgmph");v&&Number.isFinite(Number(v))&&eZ(v);let N=a.get("bgmpu");("in"===N||"mm"===N)&&eX(N);let M=a.get("bgmsz");M&&j.some(e=>e.id===M)&&ep(M);let S=a.get("bgmam");null!==S&&eS(S);let C=a.get("bgmrv");null!==C&&ez(C);let z=a.get("bgmrl");null!==z&&eT(z);let F=a.get("bgmlc");F&&k.some(e=>e.id===F)&&eP(F);let T=Number(a.get("bgmdc"));a.has("bgmdc")&&T>=0&&T<=3&&eJ(T),"0"===a.get("bgmcp")&&eL(!1);let P=a.get("bgmpx");null!==P&&eR(P.slice(0,4));let A=a.get("bgmsx");null!==A&&eO(A.slice(0,4)),"log"===a.get("bgmsc")&&eM("log")}else try{let e=localStorage.getItem(ee);if(e){let t=JSON.parse(e);("grouped"===t.shape||"stacked"===t.shape||"pct100"===t.shape)&&I(t.shape),("vertical"===t.orient||"horizontal"===t.orient)&&O(t.orient),("top"===t.legendPos||"right"===t.legendPos||"bottom"===t.legendPos||"none"===t.legendPos)&&Y(t.legendPos),("none"===t.labelMode||"auto"===t.labelMode)&&es(t.labelMode),"string"==typeof t.paletteId&&w.some(e=>e.id===t.paletteId)&&ei(t.paletteId),"string"==typeof t.bg&&eh(t.bg),"string"==typeof t.fontId&&y.some(e=>e.id===t.fontId)&&em(t.fontId),"string"==typeof t.sizeId&&j.some(e=>e.id===t.sizeId)&&ep(t.sizeId),"string"==typeof t.locale&&k.some(e=>e.id===t.locale)&&eP(t.locale),"boolean"==typeof t.compact&&eL(t.compact),"string"==typeof t.prefix&&eR(t.prefix),"string"==typeof t.suffix&&eO(t.suffix),"number"==typeof t.exportScale&&eW(t.exportScale)}}catch{}e||tt(!0)})(),()=>{e=!0}},[]),(0,b.Vd)(ee,()=>te?JSON.stringify({shape:T,orient:L,legendPos:U,labelMode:er,paletteId:en,bg:ec,fontId:eu,sizeId:eg,locale:eI,compact:eD,prefix:eE,suffix:eV,exportScale:eU}):null,[te,T,L,U,er,en,ec,eu,eg,eI,eD,eE,eV,eU]),(0,r.useEffect)(()=>
1{if(!te)return;let t=!1;return Q(e).then(e=>{t||tl(e)}),()=>{t=!0}},[te,e]);let ts=(0,r.useMemo)(()=>(function(e,t){let{grid:a,delimiter:l,merged:r,headerGuided:s,truncated:n}=A(e,t);if(!a.length)return{categories:[],series:[],delimiter:null,headerUsed:!1,mergedThousands:!1,headerGuided:!1,droppedCategories:0,droppedColumns:[],unreadableRows:0,blanks:0,duplicateNames:[],longFormat:!1,textTruncated:!1,delimiter:l,textTruncated:n};let i=null,o=a,d=a[0],c=a.slice(1),h=c.length>=1&&c.filter(e=>e.slice(1).some(z)).length>=Math.ceil(.6*c.length),u=/^(19|20)\d{2}$/,m=void 0!==d&&d.length>=2&&!z(d[0]??"")&&d.slice(1).every(e=>u.test(e.trim()))&&c.length>=1&&!c.every(e=>e.slice(1).every(e=>u.test(e.trim())));d&&d.length>=2&&h&&(!d.slice(1).some(z)||m)&&(i=d,o=c);let g=P(o),p=Math.max(1,...o.map(e=>e.length)),x=[],f=[];for(let e=1;e<p;e++){let t=0,a=0;for(let l of o){let r=l[e]??"";""===r.trim()?a++:z(r)&&t++}let l=t+a;t>=1&&l>=Math.ceil(.6*o.length)?x.push(e):t+a<o.length&&f.push(i?.[e]?.trim()||`Column ${e+1}`)}let b=x.slice(0,24),v=x.slice(24),w=[],y=b.map(()=>[]),j=0,k=0,N=0;for(let e of o){if(!b.length)break;if(!b.some(t=>z(e[t]??""))){j++;continue}if(w.length>=300){N++;continue}w.push((e[0]??"").trim()||`Row ${w.length+1}`),b.forEach((t,a)=>{let l=(e[t]??"").trim();if(""===l){k++,y[a].push(null);return}let r=C(l);if(null===r){k++,y[a].push(null);return}y[a].push(r)})}let M=b.map((e,t)=>({name:(i?.[e]??"").trim()||(1===b.length?"Value":`Series ${t+1}`),values:y[t]})),$=new Map,S=[];for(let e of w){let t=($.get(e)??0)+1;$.set(e,t),2===t&&S.push(e)}return{categories:w,series:M,delimiter:l,headerUsed:null!==i,mergedThousands:r,headerGuided:s,droppedCategories:N,droppedColumns:[...f,...v.map(e=>i?.[e]?.trim()||`Column ${e+1}`)],unreadableRows:j,blanks:k,duplicateNames:S,longFormat:g,textTruncated:n}})(e,S),[e,S]),tn=(0,r.useMemo)(()=>w.find(e=>e.id===en)?.colors??w[0].colors,[en]),ti=(0,r.useMemo)(()=>j.find(e=>e.id===eg)??j[0],[eg]),to=(0,r.useMemo)(()=>y.find(e=>e.id===eu)?.stack??y[0].stack,[eu]),td=(0,r.useCallback)(e=>eo[e]??tn[e%tn.length]??"#64748b",[eo,tn]),tc=(0,r.useMemo)(()=>ts.series.map((e,t)=>td(t)),[ts.series,td]),th=(0,r.useMemo)(()=>{var e;return!((e=ts.categories).length<3)&&e.filter(e=>et.test(e.trim())||/^(19|20)\d{2}$/.test(e.trim())||/^q[1-4]\b/i.test(e.trim())||/\d{4}-\d{2}/.test(e)).length>=Math.ceil(.7*e.length)},[ts.categories]),tu=(0,r.useMemo)(()=>{let e=ts.categories.map((e,t)=>t),t=e=>ts.series.reduce((t,a)=>t+(a.values[e]??0),0);return"desc"===G?e.sort((e,a)=>t(a)-t(e)):"asc"===G?e.sort((e,a)=>t(e)-t(a)):"alpha"===G&&e.sort((e,t)=>(ts.categories[e]??"").localeCompare(ts.categories[t]??"")),{categories:e.map(e=>ts.categories[e]??""),series:ts.series.map(t=>({name:t.name,values:e.map(e=>t.values[e]??null)}))}},[ts,G]),tm=(0,r.useMemo)(()=>{let e=-1/0,t=1/0;for(let a of tu.series)for(let l of a.values)null!==l&&(e=Math.max(e,l),t=Math.min(t,l));return Number.isFinite(e)?{vMax:e,vMin:t}:null},[tu]),tg=(0,r.useMemo)(()=>{let e=0;for(let t of tu.series)for(let a of t.values)null!==a&&a<0&&e++;return e},[tu]),tp="pct100"===T&&tg>0,tx=tp?"stacked":T,tf=null!==tm&&tm.vMin>0&&"grouped"===tx,tb="log"===eN&&tf?"log":"linear",tv=""===e$.trim()?null:C(e$),tw="grouped"===tx&&"linear"===tb,ty=tw&&null!==tv&&null!==tm&&tv>=tm.vMax?`An axis starting at ${tv} sits at or above your largest value (${tm.vMax}), so there would be no bar left to draw. The zero baseline is still in use.`:"",tj=tw&&null!==tv&&!ty&&tv>0?tv:null,tk=(0,r.useMemo)(()=>{if(null===tj||!tm)return null;let{vMax:e,vMin:t}=tm,a=e-tj;if(a<=0)return null;let l=e-t,r=0;for(let e of tu.series)for(let t of e.values)null!==t&&t<=tj&&r++;return{k:e/a,actual:0===e?0:l/e*100,drawn:l/a*100,vanished:r,vMax:e,vMin:t}},[tj,tm,tu]),tN=(0,r.useMemo)(()=>({locale:eI,decimals:eA,compact:eD,prefix:eE,suffix:eV}),[eI,eA,eD,eE,eV]),tM=(0,r.useMemo)(()=>W(tN),[tN]),t$=(0,r.useMemo)(()=>W({locale:eI,decimals:eA,compact:!1,prefix:"",suffix:"%"}),[eI,eA]),tS=(0,r.useMemo)(()=>({title:a,subtitle:u,source:M,w:ti.w,h:ti.h,shape:tx,orient:L,legendPos:U,labelMode:er,bg:ec,font:to,gridlines:ex,barGap:eb,radiu
1s:ew,decimals:eA,fmt:tM,fmtOpts:tN,pctFmt:t$,axisMin:tj,scale:tb,refValue:""===eC.trim()?null:C(eC),refLabel:eF,colors:tc,blankAsZero:ej}),[a,u,M,ti,tx,L,U,er,ec,to,ex,eb,ew,eA,tM,tN,t$,tj,tb,eC,eF,tc,ej]),tC=(0,r.useMemo)(()=>_(tu.categories,tu.series,{...tS,highlight:e0}),[tu,tS,e0]),tz=(0,r.useMemo)(()=>_(tu.categories,tu.series,{...tS,highlight:-1}),[tu,tS]),tF=(0,r.useMemo)(()=>(function(e){let t=[`<svg xmlns="http://www.w3.org/2000/svg" width="${e.w}" height="${e.h}" viewBox="0 0 ${e.w} ${e.h}">`];for(let a of("none"!==e.bg&&t.push(`<rect width="${e.w}" height="${e.h}" fill="${e.bg}"/>`),e.els))if("rect"===a.k)t.push(`<rect x="${a.x}" y="${a.y}" width="${a.w}" height="${a.h}" rx="${a.rx}" fill="${a.fill}"/>`);else if("line"===a.k){let e=a.dash?` stroke-dasharray="${a.dash}"`:"";t.push(`<line x1="${a.x1}" y1="${a.y1}" x2="${a.x2}" y2="${a.y2}" stroke="${a.stroke}" stroke-width="${a.sw}"${e}/>`)}else{let l=a.rot?` transform="rotate(${a.rot} ${a.x} ${a.y})"`:"";t.push(`<text x="${a.x}" y="${a.y}" fill="${a.fill}" font-family="${(0,x.p3)(e.font)}" font-size="${a.size}" font-weight="${a.weight}" text-anchor="${a.anchor}"${l}>${(0,x.p3)(a.t)}</text>`)}return t.push("</svg>"),t.join("")})(tz),[tz]),tT=(0,r.useMemo)(()=>{let e,t=ti.h/ti.w;if("scale"===eG)e=Math.round(ti.w*eU);else if("width"===eG)e=Math.round(Math.min(3e4,Math.max(100,Number(eY)||100)));else{let t=Math.max(.1,Math.min(200,Number(eQ)||.1));e=Math.round(Math.min(3e4,Math.max(100,("in"===eK?t:t/25.4)*eq)))}return{w:e,h:Math.max(1,Math.round(e*t))}},[ti,eG,eU,eY,eq,eQ,eK]),tI=tT.w*tT.h/1e6,tP=tT.w>16384||tT.h>16384||tT.w*tT.h>268e6,tA=(0,r.useMemo)(()=>"print"===en||"ramp"===en||tc.length<2?[]:function(e,t){let a=[],l={protanopia:"red-blind vision",deuteranopia:"green-blind vision",tritanopia:"blue-blind vision"};for(let r=0;r<e.length&&a.length<3;r++)for(let s=r+1;s<e.length&&a.length<3;s++)for(let n of Object.keys(E)){let i=V(e[r],n),o=V(e[s],n),d=R(...i.map(e=>Math.min(1,Math.max(0,e)))),c=R(...o.map(e=>Math.min(1,Math.max(0,e))));if(11>Math.hypot(d[0]-c[0],d[1]-c[1],d[2]-c[2])){a.push({a:t[r]??"",b:t[s]??"",kind:l[n]??n});break}}return a}(tc,ts.series.map(e=>e.name)),[en,tc,ts.series]),tJ=(0,r.useMemo)(()=>{let e=[];for(let t of tu.series)for(let a of t.values)null!==a&&e.push(a);if(!e.length)return null;let t=e.reduce((e,t)=>e+t,0);return{count:e.length,min:Math.min(...e),max:Math.max(...e),mean:t/e.length,total:t}},[tu]);function tD(e){if(e.size>2e6)return void e9(`That file is ${(0,c.xO)(e.size,2e6,1e6,1)} MB and the limit is 2 MB. Copy the columns you want to chart and paste them into the box instead.`);let a=new FileReader;a.onload=()=>{t("string"==typeof a.result?a.result:""),ed({}),e9("")},a.onerror=()=>e9("That file could not be read. Try pasting the rows into the box instead."),a.readAsText(e)}async function tL(){if(ts.categories.length&&!e6){if(tP)return void e9(`A browser will not build an image that large. This one would be ${tT.w} by ${tT.h} pixels, which is ${tI.toFixed(1)} megapixels. Lower the size, or take the SVG, which has no limit at all.`);e8(!0),e9("");try{let e=await (0,m.s)(tF,{width:tT.w,height:tT.h,subject:"chart"});if(!e.ok)return void e9(`${e.message} Or take the SVG, which has no limit at all.`);(0,v.WN)(e.blob,`${H(a||"bar-chart")}.png`)}finally{e8(!1)}}}async function tE(){if(ts.categories.length){if(tP)return void e9("That size is past what a browser will build. Lower it, or take the SVG.");e8(!0);try{let e=await (0,m.s)(tF,{width:tT.w,height:tT.h,subject:"chart"});if(!e.ok)return void e9(e.message);let{ok:t}=await (0,g.L1)(e.blob);if(!t)return void e9("This browser would not put the chart on the clipboard. Use Download PNG instead.");e3(!0),setTimeout(()=>e3(!1),1600)}catch{e9("The clipboard was blocked. Use Download PNG instead.")}finally{e8(!1)}}}let tR=(0,r.useCallback)(()=>el({packed:ta,text:e,title:a,subtitle:u,source:M,shape:T,orient:L,sort:G,legendPos:U,labelMode:er,paletteId:en,bg:ec,fontId:eu,sizeId:eg,exportMode:eG,exportScale:eU,exportWidth:eY,dpi:eq,physical:eQ,physUnit:eK,axisMinText:e$,refText:eC,refLabel:eF,locale:eI,decimals:eA,compact:eD,prefix:eE,suffix:eV,scaleMode:eN}),[ta,e,a,u,M,T,L,G,U,er,en,ec,eu,eg,e$,eC,eF,eI,eA,eD,eE,eV,eN,eG,eU,eY,eq,eQ,eK]),tV=null!==ta&&ta.length<=2400||null===ta&&e.length<=1400,tO="	"===ts.delimiter?"a tab separated paste":","===ts.delimiter?"comma separated rows":";"===ts.delimiter?"semicolon separated rows":"|"===ts.delimiter?"pipe separated rows":"space separated rows",tG=[];ts.textTruncated&&tG.push(`Your paste was longer than ${2e5.toLocaleStr
1ing("en-US")} characters, so the end was cut off before anything was read.`),ts.droppedCategories>0&&tG.push(`Only the first 300 categories are charted. ${ts.droppedCategories} row${1===ts.droppedCategories?" was":"s were"} left out.`),ts.droppedColumns.length>0&&tG.push(`${ts.droppedColumns.length} column${1===ts.droppedColumns.length?" was":"s were"} not drawn as a series, because a chart holds at most 24 and the rest were not numeric: ${ts.droppedColumns.slice(0,6).join(", ")}${ts.droppedColumns.length>6?", and more":""}.`),ts.unreadableRows>0&&tG.push(`${ts.unreadableRows} row${1===ts.unreadableRows?"":"s"} had no readable number and got skipped.`),ts.blanks>0&&!ej&&tG.push(`${ts.blanks} cell${1===ts.blanks?" is":"s are"} empty and drawn as a gap, not a zero. There is a switch for that below.`),ts.duplicateNames.length>0&&tG.push(`${ts.duplicateNames.length} category name${1===ts.duplicateNames.length?" is":"s are"} used more than once (${ts.duplicateNames.slice(0,3).join(", ")}). They are drawn as separate bars.`),tC.hiddenLabels>0&&"auto"===er&&tG.push(`${tC.hiddenLabels} value label${1===tC.hiddenLabels?" was":"s were"} too small to fit anywhere on the bar and are not drawn.`),tC.shortenedNames>0&&tG.push(`${tC.shortenedNames} category name${1===tC.shortenedNames?" was":"s were"} shortened to fit. The full names are in the table below.`);let tB=(0,x.xO)(function(e){let t=[e.font];for(let a of e.els)"text"===a.k&&t.push(a.t);return t}(tC));tB>0&&tG.push((0,x.CF)(tB)),tp&&tG.push(`100% stacked needs every value to be zero or above, and ${tg} of yours ${1===tg?"is":"are"} negative. A share of a total means nothing when the total is not whole, so the chart is drawn stacked instead.`),"log"!==eN||tf||tG.push("A log scale needs every value above zero and a grouped chart, so the linear axis is still in use."),"alpha"===G&&th&&tG.push("These categories look like dates. Sorting them alphabetically puts April before January, which quietly scrambles the timeline."),tJ&&0===tJ.max&&0===tJ.min&&tG.push("Every value reads as zero, so there is no bar to draw. Check that the number columns came across."),0===ts.series.length&&""!==e.trim()&&tG.push("No column of numbers turned up. The first column is read as the names, and every column after it has to hold numbers.");let tU="vertical"===L&&ts.categories.length>0&&(ts.categories.length>12||ts.categories.some(e=>e.length>14));return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,390px)_minmax(0,1fr)]",children:[(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-title",children:"Chart title"}),(0,l.jsx)(n.p,{id:"bg-title",value:a,onChange:e=>h(e.target.value.slice(0,90)),placeholder:"Leave blank for no title"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",onDragOver:e=>{e.preventDefault(),e4(!0)},onDragLeave:()=>e4(!1),onDrop:e=>{e.preventDefault(),e4(!1);let t=e.dataTransfer.files?.[0];t&&tD(t)},children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)(i.J,{htmlFor:"bg-data",children:"Your data"}),(0,l.jsx)("button",{type:"button",onClick:()=>tr.current?.click(),className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground",children:"or choose a CSV file"}),(0,l.jsx)("input",{ref:tr,type:"file",accept:".csv,.tsv,.txt,text/csv,text/plain",className:"hidden",onChange:e=>{let t=e.target.files?.[0];t&&tD(t),e.target.value=""}})]}),(0,l.jsx)("textarea",{id:"bg-data",value:e,onChange:e=>t(e.target.value),rows:9,spellCheck:!1,placeholder:"Paste a whole block from a spreadsheet. First column is the names, every column after it becomes its own bar:\n\nRegion	Q1	Q2\nNorth	128400	141200\nSouth	96100	102400",className:(0,f.cn)("w-full resize-y rounded-md border bg-background p-2 font-mono text-xs leading-relaxed shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e2?"border-primary bg-accent":"border-input")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Click to choose a file, or drag a CSV straight into this box, or paste. Copy as many number columns as you have and each one becomes its own series. Currency signs, percent signs, thousands commas, and k or M shorthand are all read for you, and a header row is used for the legend names."})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Try:"}),N.map((e,a)=>(0,l.jsx)("button",{type:"button",onClick:()=>(function(e){let a=N[e];a&&(t(a.text),h(a.title),p(""),ed({}),e9(""),eS(a.axisMin??""),I(a.shape??"grouped"),B("input"))})(a),className:"rounded-md border px-2 py-1 text-xs hover:bg-accent",children:e.name},e.name))]}),ts.categories.length>0?(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Read ",(0,l.jsx)("span",{className:"font-medium text-foreground",children:ts.categories.length})," categories and"," ",(0,l.jsx)("span",{className:"font-medium text-foreground",children:ts.series.length})," ",(ts.series.length,"series")," from ",tO,".",ts.headerUsed?" The first row was used for the series n
1ames.":"",ts.mergedThousands?ts.headerGuided?" Your header row said how many columns there really are, so commas inside numbers were read as thousands separators.":" Commas inside numbers were read as thousands separators.":""]}):(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Nothing to chart yet. Each line needs a name and at least one number, like ",(0,l.jsx)("code",{children:"North, 128400"}),"."]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(s.$,{variant:"outline",size:"sm",onClick:function(){let a=function(e){let{grid:t}=A(e,"off");if(t.length<2)return null;let a=Math.max(...t.map(e=>e.length)),l=[];for(let e=0;e<a;e++)l.push(t.map(t=>t[e]??""));return J(l)}(e);if(!a)return void e9("There is nothing to flip yet. Paste at least two rows first.");t(a),ed({}),e9("")},children:"Flip rows and columns"}),ts.longFormat&&(0,l.jsx)(s.$,{size:"sm",onClick:function(){let a=function(e){let{grid:t}=A(e,"off");if(!t.length)return null;let a=t[0],l=void 0!==a&&3===a.length&&!z(a[2]??""),r=l&&a?a:["","",""],s=l?t.slice(1):t;if(!P(s))return null;let n=[],i=[],o=new Map;for(let e of s){let t=(e[0]??"").trim()||"(blank)",a=(e[1]??"").trim()||"(blank)",l=C(e[2]??"");if(null===l)continue;n.includes(t)||n.push(t),i.includes(a)||i.push(a);let r=JSON.stringify([t,a]);o.set(r,(o.get(r)??0)+l)}if(!n.length||!i.length)return null;let d=[[r[0]||"Category",...i]];for(let e of n)d.push([e,...i.map(t=>{let a=o.get(JSON.stringify([e,t]));return void 0===a?"":String(a)})]);return J(d)}(e);if(!a)return void e9("That data is not in the three column shape (category, series, value), so there is nothing to fold.");t(a),ed({}),e9("")},children:"Fold three columns into a chart"})]}),ts.longFormat&&(0,l.jsx)("p",{className:"rounded-md border border-blue-500/50 bg-blue-500/10 px-3 py-2 text-xs text-blue-700 dark:text-blue-300",children:"This looks like one row per combination (a name, a series, then the number). Fold it and 
1you get one bar group per name instead of one bar per line."}),","===ts.delimiter&&(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-thousands",className:"text-xs",children:"Commas inside numbers"}),(0,l.jsxs)("select",{id:"bg-thousands",className:K,value:S,onChange:e=>F(e.target.value),children:[(0,l.jsx)("option",{value:"auto",children:"Work it out from my header row"}),(0,l.jsx)("option",{value:"on",children:"Always read them as thousands separators"}),(0,l.jsx)("option",{value:"off",children:"Never, every comma is a column break"})]})]}),tG.map(e=>(0,l.jsx)("p",{className:"rounded-md border border-yellow-500/50 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-700 dark:text-yellow-400",children:e},e)),ty&&(0,l.jsx)("p",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:ty}),e7&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:e7}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-shape",children:"Bar shape"}),(0,l.jsxs)("select",{id:"bg-shape",className:K,value:T,onChange:e=>I(e.target.value),children:[(0,l.jsx)("option",{value:"grouped",children:ts.series.length>1?"Grouped (side by side)":"Plain bars"}),(0,l.jsx)("option",{value:"stacked",children:"Stacked"}),(0,l.jsx)("option",{value:"pct100",children:"100% stacked"})]})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-orient",children:"Direction"}),(0,l.jsxs)("select",{id:"bg-orient",className:K,value:L,onChange:e=>O(e.target.value),children:[(0,l.jsx)("option",{value:"vertical",children:"Vertical columns"}),(0,l.jsx)("option",{value:"horizontal",children:"Horizontal bars"})]})]})]}),tU&&(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Long names or a lot of categories read better lying down."," ",(0,l.jsx)("button",{type:"button",onClick:()=>O("horizontal"),className:"underline underline-offset-2 hover:text-foreground",children:"Switch to horizontal bars"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-sort",children:"Bar order"}),(0,l.jsxs)("select",{id:"bg-sort",className:K,value:G,onChange:e=>B(e.target.value),children:[(0,l.jsx)("option",{value:"input",children:"The order I pasted"}),(0,l.jsx)("option",{value:"desc",children:"Biggest first"}),(0,l.jsx)("option",{value:"asc",children:"Smallest first"}),(0,l.jsx)("option",{value:"alpha",children:"A to Z"})]})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-legend",children:"Legend"}),(0,l.jsxs)("select",{id:"bg-legend",className:K,value:U,onChange:e=>Y(e.target.value),children:[(0,l.jsx)("option",{value:"top",children:"Above the chart"}),(0,l.jsx)("option",{value:"right",children:"On the right"}),(0,l.jsx)("option",{value:"bottom",children:"Underneath"}),(0,l.jsx)("option",{value:"none",children:"Hidden"})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2 rounded-lg border p-3",children:[(0,l.jsx)(i.J,{htmlFor:"bg-axismin",className:"text-sm",children:"Value axis starts at"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(n.p,{id:"bg-axismin",value:e$,onChange:e=>eS(e.target.value),placeholder:"0 (zero, the honest default)",inputMode:"decimal",disabled:!tw}),""!==e$.trim()&&(0,l.jsx)(s.$,{variant:"outline",size:"sm",onClick:()=>eS(""),children:"Back to zero"})]}),tk?(0,l.jsxs)("div",{className:(0,f.cn)("space-y-1 rounded-md border px-3 py-2 text-xs",tk.k>1.5?"border-destructive/60 bg-destructive/10 text-destructive":"border-yellow-500/50 bg-yellow-500/10 text-yellow-700 dark:text-yellow-400"),children:[(0,l.jsxs)("p",{children:["Your axis starts at ",tM(tj??0),", so a real gap of ",tk.actual.toFixed(1),"% between your smallest and largest bar is drawn as ",tk.drawn.toFixed(1),"%. That is a"," ",tk.k.toFixed(1),"x exaggeration."]}),tk.vanished>0&&(0,l.jsxs)("p",{children:[tk.vanished," bar",1===tk.vanished?"":"s"," sit at or below that floor, so they have no height at all."]})]}):tw?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave this empty and bars start at zero, which is the only setting where the height of a bar matches the size of the number. Type a floor and this box works out exactly how much the picture overstates the gap."}):(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"A raised floor applies to grouped bars on a linear axis, since that is where the height of one bar is being read against another. A stacked bar is already a total, and a log axis says so on the chart."}),tf&&(0,l.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[(0,l.jsx)("input",{type:"checkbox",checked:"log"===eN,onChange:e=>eM(e.target.checked?"log":"linear"),className:"h-3.5 w-3.5 accent-primary"}
1),"Log scale, for when one value dwarfs the rest (labeled on the chart)"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-locale",children:"Number style"}),(0,l.jsx)("select",{id:"bg-locale",className:K,value:eI,onChange:e=>eP(e.target.value),children:k.map(e=>(0,l.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-dec",children:"Decimal places"}),(0,l.jsxs)("select",{id:"bg-dec",className:K,value:eA,onChange:e=>eJ(Number(e.target.value)),children:[(0,l.jsx)("option",{value:0,children:"0"}),(0,l.jsx)("option",{value:1,children:"1"}),(0,l.jsx)("option",{value:2,children:"2"}),(0,l.jsx)("option",{value:3,children:"3"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-prefix",children:"Before the number"}),(0,l.jsx)(n.p,{id:"bg-prefix",value:eE,onChange:e=>eR(e.target.value.slice(0,4)),placeholder:"$"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-suffix",children:"After the number"}),(0,l.jsx)(n.p,{id:"bg-suffix",value:eV,onChange:e=>eO(e.target.value.slice(0,4)),placeholder:"%"})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,l.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-sm",children:[(0,l.jsx)("input",{type:"checkbox",checked:eD,onChange:e=>eL(e.target.checked),className:"h-4 w-4 accent-primary"}),"Shorten big ticks to 1.2M"]}),(0,l.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-sm",children:[(0,l.jsx)("input",{type:"checkbox",checked:"auto"===er,onChange:e=>es(e.target.checked?"auto":"none"),className:"h-4 w-4 accent-primary"}),"Value on each bar"]}),(0,l.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-sm",children:[(0,l.jsx)("input",{type:"checkbox",checked:ex,onChange:e=>ef(e.target.checked),className:"h-4 w-4 accent-primary"}),"Gridlines"]}),(0,l.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 text-sm",children:[(0,l.jsx)("input",{type:"checkbox",checked:ej,onChange:e=>ek(e.target.checked),className:"h-4 w-4 accent-primary"}),"Empty cells count as zero"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-ref",children:"Target line at"}),(0,l.jsx)(n.p,{id:"bg-ref",value:eC,onChange:e=>ez(e.target.value),placeholder:"e.g. 4200",inputMode:"decimal"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-reflabel",children:"Call it"}),(0,l.jsx)(n.p,{id:"bg-reflabel",value:eF,onChange:e=>eT(e.target.value.slice(0,40)),placeholder:"Budget"})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-palette",children:"Colors"}),(0,l.jsx)("select",{id:"bg-palette",className:K,value:en,onChange:e=>ei(e.target.value),children:w.map(e=>(0,l.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-font",children:"Font"}),(0,l.jsx)("select",{id:"bg-font",className:K,value:eu,onChange:e=>em(e.target.value),children:y.map(e=>(0,l.jsx)("option",{value:e.id,children:e.name},e.id))})]})]}),tA.length>0&&(0,l.jsxs)("div",{className:"space-y-1.5 rounded-md border border-yellow-500/50 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-700 dark:text-yellow-400",children:[tA.map(e=>(0,l.jsxs)("p",{children:[e.a||"One series"," and ",e.b||"another"," look like the same color to someone with ",e.kind,"."]},`${e.a}-${e.b}-${e.kind}`)),(0,l.jsx)("button",{type:"button",onClick:()=>{ei("okabe"),ed({})},className:"underline underline-offset-2",children:"Use the colorblind safe set"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-size",children:"Chart size"}),(0,l.jsx)("select",{id:"bg-size",className:K,value:eg,onChange:e=>ep(e.target.value),children:j.map(e=>(0,l.jsxs)("option",{value:e.id,children:[e.name," (",e.w," x ",e.h,")"]},e.id))})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-bg",children:"Backgroun
1d"}),(0,l.jsxs)("select",{id:"bg-bg",className:K,value:"none"===ec?"none":"#ffffff"===ec||"#0f172a"===ec?ec:"custom",onChange:e=>{let t=e.target.value;"custom"===t?eh("#f1f5f9"):eh(t)},children:[(0,l.jsx)("option",{value:"#ffffff",children:"White"}),(0,l.jsx)("option",{value:"none",children:"Transparent"}),(0,l.jsx)("option",{value:"#0f172a",children:"Dark"}),(0,l.jsx)("option",{value:"custom",children:"Pick a color"})]})]})]}),"none"!==ec&&"#ffffff"!==ec&&"#0f172a"!==ec&&(0,l.jsx)("input",{type:"color",value:ec,onChange:e=>eh(e.target.value),"aria-label":"Background color",className:"h-9 w-full rounded-md border"}),"none"===ec&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"A transparent background keeps dark text, which disappears on a dark slide. Set the background to dark instead if that is where this is going."}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsxs)(i.J,{htmlFor:"bg-gap",children:["Gap between bars: ",Math.round(100*eb),"%"]}),(0,l.jsx)("input",{id:"bg-gap",type:"range",min:.05,max:.6,step:.01,value:eb,onChange:e=>ev(Number(e.target.value)),className:X})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsxs)(i.J,{htmlFor:"bg-radius",children:["Rounded corners: ",ew,"px"]}),(0,l.jsx)("input",{id:"bg-radius",type:"range",min:0,max:14,step:1,value:ew,onChange:e=>ey(Number(e.target.value)),className:X})]})]}),(0,l.jsxs)("div",{className:"grid gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-sub",children:"Subtitle"}),(0,l.jsx)(n.p,{id:"bg-sub",value:u,onChange:e=>p(e.target.value.slice(0,120)),placeholder:"Optional line under the title"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(i.J,{htmlFor:"bg-source",children:"Source note"}),(0,l.jsx)(n.p,{id:"bg-source",value:M,onChange:e=>$(e.target.value.slice(0,140)),placeholder:"Source: internal sales report, FY24"})]})]})]}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("div",{className:"flex min-h-[220px] items-center justify-center overflow-hidden rounded-md border p-3",style:"none"===ec?{backgroundImage:"linear-gradient(45deg,#e5e7eb 25%,transparent 25%),linear-gradient(-45deg,#e5e7eb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e5e7eb 75%),linear-gradient(-45deg,transparent 75%,#e5e7eb 75%)",backgroundSize:"16px 16px",backgroundPosition:"0 0,0 8px,8px -8px,-8px 0"}:{background:"#ffffff"},children:te&&ts.categories.length&&ts.series.length?(0,l.jsx)(q,{scene:tC,className:"h-auto w-full"}):(0,l.jsx)("p",{className:"px-4 py-16 text-center text-sm text-muted-foreground",children:te?"Paste a name column and one or more number columns and the chart draws itself.":"Measuring your labels…"})}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(s.$,{onClick:tL,disabled:!ts.categories.length||e6,children:e6?"Working…":"Download PNG"}),(0,l.jsx)(s.$,{variant:"outline",onClick:function(){if(!ts.categories.length)return;let e=new Blob([tF],{type:"image/svg+xml"});(0,v.WN)(e,`${H(a||"bar-chart")}.svg`)},disabled:!ts.categories.length,children:"Download SVG"}),(0,l.jsx)(s.$,{variant:"outline",onClick:tE,disabled:!ts.categories.length||e6,children:e5?"Copied ✓":"Copy image"})]}),(0,l.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(i.J,{htmlFor:"bg-exportmode",className:"text-sm",children:"Export size"}),(0,l.jsxs)("select",{id:"bg-exportmode",className:"h-9 rounded-md border border-input bg-background px-2 text-sm",value:eG,onChange:e=>eB(e.target.value),children:[(0,l.jsx)("option",{value:"scale",children:"Multiply the chart size"}),(0,l.jsx)("option",{value:"width",children:"Exact pixel width"}),(0,l.jsx)("option",{value:"dpi",children:"Print size and DPI"})]})]}),"scale"===eG&&(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:[1,2,3,4].map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>eW(e),className:(0,f.cn)("rounded-md border px-3 py-1.5 text-sm hover:bg-accent",eU===e&&"border-primary bg-accent font-medium"),children:[e,"x"]},e))}),"width"===eG&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(n.p,{value:eY,onChange:e=>e_(e.target.value.replace(/[^0-9]/g,"").slice(0,5)),inputMode:"numeric","aria-label":"Export width in pixels",className:"w-32"}),(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:"pixels wide"}),[1280,1920,2560,3840].map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>e_(String(e)),className:"rounded-md border px-2 py-1 text-xs hover:bg-accent",children:e},e))]}),"dpi"===eG&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(n.p,{value:eQ,onChange:e=>eZ(e.target.value.replace(/[^0-9.]/g,"").slice(0,6)),inputMode:"decimal","aria-label":"Printed width",className:"w-24"}),(0,l.jsxs)("select",{className:"h-9 rounded-md border border-input bg-background px-2 text-sm",value:eK,onChange:e=>eX(e.target.value),"aria-label":"Unit",children:[(0,l.jsx)("option",{value:"in",children:"inches"}),(0,l.jsx)("option",{value:"mm",children:"mm"})]}),(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:"at"}),(0,l.jsxs)("select",{className:"h-9 rounded-md border border-input bg-background px-2 text-sm",value:eq,onChange:e=>eH(Number(e.target.value)),"aria-label":"Dots per inch",children:[(0,l.jsx)("option",{value:96,children:"96 DPI (screen)"}),(0,l.jsx)("option",{value:150,children:"150 DPI (draft print)"}),(0,l.jsx)("option",{value:300,children:"300 DPI (real print)"})]})]}),(0,l.jsx)("p",{className:(0,f.cn)("text-xs",tP?"text-destructive":"text-muted-foreground"),children:tP?`That would be ${tT.w} by ${tT.h} pixels (${tI.toFixed(1)} megapixels), which is past what a browser will build. Lower it, or take the SVG.`:`The PNG comes out ${tT.w} by ${tT.h} pixels, the same on any machine. The SVG is a vector, so it stays sharp at any size and carries no size limit.`})]}),tJ&&(0,l.jsx)("div",{className:"grid grid-cols-2 gap-2 rounded-lg border p-3 text-sm sm:grid-cols-5",children:[["Values",String(tJ.count)],["Lowest",tM(tJ.min)],["Highest",tM(tJ.max)],["Average",tM(tJ.mean)],["Total",tM(tJ.total)]].map(([e,t])=>(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-xs text-muted-foreground",children:e}),(0,l.jsx)("div",{className:"font-medium tabular-nums",children:t})]},e))}),ts.categories.length>0&&ts.series.length>0&&(0,l.jsxs)("div",{className:"overflow-x-auto rounded-lg border",children:[(0,l.jsxs)("table",{className:"w-full min-w-[420px] text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b bg-muted/40 text-left",children:[(0,l.jsx)("th",{className:"px-2 py-2 font-medium",children:"Category"}),ts.series.map((e,a)=>(0,l.jsx)("th",{className:"px-2 py-2 text-right font-medium",onMouseEnter:()=>e1(a),onMouseLeave:()=>e1(-1),children:(0,l.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,l.jsx)("input",{type:"color",value:td(a),onChange:e=>ed(t=>({...t,[a]:e.target.value})),"aria-label":`Color for ${e.name}`,className:"h-5 w-5 cursor-pointer rounded border p-0"}),(0,l.jsx)("span",{children:e.name}),ts.series.length>1&&(0,l.jsx)("button",{type:"button",onClick:()=>{!(ts.series.length<=1)&&(t(D(ts.categories,ts.series.filter((e,t)=>
1t!==a))),ed(e=>{let t={};for(let[l,r]of Object.entries(e)){let e=Number(l);e!==a&&(t[e>a?e-1:e]=r)}return t}))},"aria-label":`Remove ${e.name}`,className:"rounded px-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:"\xd7"})]})},`${e.name}-${a}`)),(0,l.jsx)("th",{className:"w-8 px-2 py-2"})]})}),(0,l.jsx)("tbody",{children:ts.categories.map((e,a)=>(0,l.jsxs)("tr",{className:"border-b last:border-0 hover:bg-accent/40",children:[(0,l.jsx)("td",{className:"px-2 py-1.5",children:(0,l.jsx)("input",{defaultValue:e,onBlur:l=>{l.target.value!==e&&function(e,a){let l=ts.categories.slice();l[e]=a.trim()||l[e]||`Row ${e+1}`,t(D(l,ts.series))}(a,l.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},className:"w-full rounded border border-transparent bg-transparent px-1 py-0.5 hover:border-input focus:border-input focus:outline-none"},`name-${e}-${a}`)}),ts.series.map((e,r)=>{let s=e.values[a],n=null==s?"":String(s);return(0,l.jsx)("td",{className:"px-2 py-1.5 text-right",children:(0,l.jsx)("input",{defaultValue:n,onBlur:e=>{e.target.value!==n&&function(e,a,l){let r=ts.series.map((t,r)=>{if(r!==a)return t;let s=t.values.slice();return s[e]=""===l.trim()?null:C(l),{...t,values:s}});t(D(ts.categories,r))}(a,r,e.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},inputMode:"decimal",className:"w-full rounded border border-transparent bg-transparent px-1 py-0.5 text-right tabular-nums hover:border-input focus:border-input focus:outline-none"},`v-${a}-${r}-${n}`)},`${e.name}-${r}`)}),(0,l.jsx)("td",{className:"px-2 py-1.5 text-right",children:(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return e=a,void t(D(ts.categories.filter((t,a)=>a!==e),ts.series.map(t=>({...t,values:t.values.filter((t,a)=>a!==e)}))))},"aria-label":`Remove ${e}`,className:"rounded px-1.5 text-muted-foreground hover:bg-accent hover:text-foreground",children:"\xd7"})})]},`${e}-${a}`))})]}),(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2 border-t p-2",children:(0,l.jsx)(s.$,{variant:"ghost",size:"sm",onClick:()=>ed({}),disabled:!Object.keys(eo).length,children:"Reset colors"})})]})]})]}),(0,l.jsx)(o.ToolActions,{share:tR,title:"Bar Graph Maker",embedCarriesPersonal:!1,queryIsImpersonal:"the axis minimum, reference line, number format and export size you set"}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Everything here runs on your own machine. Revenue, headcount, survey answers, none of it is uploaded, and there is no account, no export limit, and no watermark on the file you download.",tV?" A share link carries your numbers as well as the styling, so month two is a paste and a download.":` Your table is ${e.length.toLocaleString("en-US")} characters, which will not fit in a share link even packed down, so the link carries the styling only.`]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.