ztd-charts-cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/api.d.ts +23 -1
  2. package/dist/api.js +5 -1
  3. package/dist/{chunk-LVCEIXBR.js → chunk-4K4P2AWW.js} +50 -19
  4. package/dist/cli.js +2 -1
  5. package/dist/client/area.js +28 -0
  6. package/dist/client/bar.js +28 -0
  7. package/dist/client/beeswarm.js +28 -0
  8. package/dist/client/box.js +28 -0
  9. package/dist/client/bubble.js +28 -0
  10. package/dist/client/bullet.js +28 -0
  11. package/dist/client/bump.js +28 -0
  12. package/dist/client/calendar.js +28 -0
  13. package/dist/client/candlestick.js +28 -0
  14. package/dist/client/chord.js +28 -0
  15. package/dist/client/donut.js +28 -0
  16. package/dist/client/dumbbell.js +28 -0
  17. package/dist/client/funnel.js +28 -0
  18. package/dist/client/gauge.js +28 -0
  19. package/dist/client/heatmap.js +28 -0
  20. package/dist/client/histogram.js +28 -0
  21. package/dist/client/line.js +28 -0
  22. package/dist/client/lollipop.js +28 -0
  23. package/dist/client/marimekko.js +28 -0
  24. package/dist/client/parallel.js +28 -0
  25. package/dist/client/pareto.js +28 -0
  26. package/dist/client/pie.js +28 -0
  27. package/dist/client/radar.js +28 -0
  28. package/dist/client/radialBar.js +28 -0
  29. package/dist/client/react.js +66 -0
  30. package/dist/client/ridgeline.js +28 -0
  31. package/dist/client/sankey.js +28 -0
  32. package/dist/client/scatter.js +28 -0
  33. package/dist/client/segmented.js +28 -0
  34. package/dist/client/skyline.js +28 -0
  35. package/dist/client/slope.js +28 -0
  36. package/dist/client/sparkline.js +28 -0
  37. package/dist/client/stream.js +28 -0
  38. package/dist/client/sunburst.js +28 -0
  39. package/dist/client/treemap.js +28 -0
  40. package/dist/client/waffle.js +28 -0
  41. package/dist/client/waterfall.js +28 -0
  42. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ (()=>{var Jn=Object.create;var bt=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var Qn=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var We=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var nr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qn(t))!tr.call(e,o)&&o!==n&&bt(e,o,{get:()=>t[o],enumerable:!(r=Zn(t,o))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?Jn(er(e)):{},nr(t||!e||!e.__esModule?bt(n,"default",{value:e,enumerable:!0}):n,e));var O=We((Xo,yt)=>{yt.exports=globalThis.__ztdReact.react});var kt=We((Jo,xt)=>{xt.exports=globalThis.__ztdReact["react-dom/client"]});var N=We((la,Vt)=>{Vt.exports=globalThis.__ztdReact["react/jsx-runtime"]});var pt=S(O(),1),Un=S(kt(),1);var $e=S(O(),1);var Ee=S(O(),1);var vt=S(O(),1),Te=(0,vt.createContext)(void 0);var ar=S(O(),1);var rr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],wt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Ct='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ae={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},or={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:wt,monoFamily:Ct,radius:18,radiusCode:14,radiusMark:4},Ke={dark:ae,light:or};function Ge(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Ue(e){let t={};for(let n of rr){let r=e[n];typeof r=="string"&&(t[Ge(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function Ye(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var ir=`
2
+ .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
+ .ztd-root:focus{outline:none}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ae.accent});outline-offset:3px;border-radius:6px}
5
+ .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
+ .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
7
+ .ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
8
+ .ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
9
+ .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
+ .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
+ .ztd-btn:focus{outline:none}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ae.accent});outline-offset:2px}
13
+ .ztd-card{transition:border-color .16s ease}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${ae.dim})}
15
+ @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
+ @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
+ @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
18
+ .ztd-pop{transform-box:fill-box;transform-origin:center}
19
+ @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
+ .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
+ @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
+ `;var $t=!1;function ye(){if($t||typeof document>"u"||($t=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=ir,document.head.appendChild(e)}var Se=S(O(),1),ne=typeof window<"u"&&typeof document<"u",ee=ne?Se.useLayoutEffect:Se.useEffect;function Me(){return typeof performance<"u"?performance.now():Date.now()}function z(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ae(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Tt={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},St={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var sr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],lr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function cr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function ur(e){return cr(sr,e)}function Mt(e,t){let n=ur(e);return{text:n?n[t]:e,...lr[n?.id??"basic"]}}var J=S(O(),1);var Lt=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),re="en-US",At=new Map;function qe(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=At.get(r);return o||(o=new Intl.NumberFormat(e,n),At.set(r,o)),o}function Xe(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Je(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=re,...r}=t;return Xe(qe(n,r).format(e))}var Ft=e=>e!==0&&Math.abs(e)<.05,Dt=(e,t,n="")=>`${Je(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Re(e,t={}){if(!Number.isFinite(e))return"-";if(Ft(e)&&t.maximumFractionDigits===void 0)return Dt(e,t.locale??re,"%");let n=Math.abs(e);return`${Je(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function mr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=re,...r}=t;if(z(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,c]=a[i],l=o/s,f=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||l<100?1:0)),u=Math.round(l*10**f)/10**f;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Je(u,{locale:n,...r,maximumFractionDigits:f})+c}}return Xe(qe(n,{notation:"compact",...r}).format(e))}var dr=(e,t=z(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ne(e,t=re,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=qe(t,o);return c=>Number.isFinite(c)?`${i}${Xe(s.format(c))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Re(o,{locale:t});case"ratio":return o=>Re(o*100,{locale:t});case"compact":return o=>mr(o,{locale:t});case"currency":return r(dr(t));default:{let o=r({maximumFractionDigits:1});return a=>Ft(a)?Dt(a,t):o(a)}}}function fr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var hr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var gr=["january","february","march","april","may","june","july","august","september","october","november","december"],Rt=e=>{let t=e.toLowerCase();return t.length<3?0:gr.findIndex(n=>n.startsWith(t))+1},Nt=e=>+e+(+e<30?2e3:1900);function Et(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var pr=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],br=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,_t=/\{([^{}]+)\}/g;function yr(e,t){let n;for(let r of pr)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[Nt(n[3]),+n[2],+n[1],1]:[Nt(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=br.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Rt(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=Rt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function Ot(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(hr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Ot(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=yr(n,t);if(r)return fr(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var Pt=new Map;function It(e,t={month:"short",day:"numeric"}){let n=Ot(e);if(!n)return"-";let{locale:r=re,...o}=t,a=r+JSON.stringify(o),i=Pt.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Pt.set(a,i)),i.format(n)}var Bt={white:"#ffffff",black:"#000000",transparent:"#00000000"};function zt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Bt[t.toLowerCase()]&&(t=Bt[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function xr(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Ze(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kr(e){return[Ze(e[0]),Ze(e[1]),Ze(e[2])]}function Qe(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function Ht(e){let[t,n,r]=kr(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function vr([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Qe(4.0767416621*o-3.3077115913*a+.2309699292*i),Qe(-1.2684380046*o+2.6097574011*a-.3413193965*i),Qe(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function jt(e,t,n){let r=zt(e),o=zt(t);if(!r||!o)return e;let a=Ht(r),i=Ht(o),s=Math.max(0,Math.min(1,n));return xr(vr([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}var et=S(N(),1),Pe=(0,J.createContext)({theme:ae,cssVars:!0});function wr(e,t=ae){return e?typeof e=="string"?Ke[e]??t:Ye(t,e):t}function Fe(e){let t=(0,J.useContext)(Pe),n=e.base?Ke[e.base]:t.theme,r=(0,J.useMemo)(()=>wr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,J.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,J.useMemo)(()=>Ue(r),[r]),c=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,et.jsx)(Pe.Provider,{value:i,children:(0,et.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:c,children:e.children})})}var Cr=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Le(e){return Cr.has(e)}function $r(e,t){let n=r=>t?`var(${Ge(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Le(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Le(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:jt(e[r],e[o],a)}}}function oe(e){let t=(0,J.useContext)(Pe);return(0,J.useMemo)(()=>{let n=Ye(t.theme,e);return $r(n,t.cssVars)},[t.theme,t.cssVars,e])}function Z(e){let t=(0,J.useContext)(Pe);return e??t.locale??re}function Wt(e){return e?Ue(e):{}}var De=S(O(),1),tt=(0,De.createContext)(void 0);function Kt(e){let t=(0,De.useContext)(tt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var v=S(N(),1),Tr={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},Sr={en:Tr,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Mr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},nt=e=>Sr[z(Z(e))];function rt(e){let t=oe(e.theme),n=nt(e.locale),[r,o]=(0,Ee.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),c=e.items.filter(f=>!s.has(f.label)).length,l=(0,v.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((f,u)=>{let h=!s.has(f.label),b=h&&c===1,m=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Ar,{p:t,item:f,off:!h}),(0,v.jsx)("span",{style:h?void 0:{textDecoration:"line-through"},children:f.label})]});return(0,v.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,v.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":h,"aria-disabled":b||void 0,onClick:()=>{b||(i(f.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:b?"default":void 0},children:m}):m},u)})});return i?(0,v.jsxs)(v.Fragment,{children:[l,(0,v.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Mr,children:r?n.shown(c,e.items.length):""})]}):l}function Ar({p:e,item:t,off:n}){let r=t.color?Le(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,v.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,v.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,v.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,v.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function Rr(e){let t=oe(e.theme),n=Mt(e.level,z(Z(e.locale)));return(0,v.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function Nr(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,v.jsxs)(v.Fragment,{children:[e.slice(0,r),(0,v.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Gt(e){let t=oe(e.theme),n=nt(e.locale),[r,o]=(0,Ee.useState)(0);ee(()=>ye(),[]);let a=()=>{o(h=>h+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,v.jsx)(rt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",c=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,l=e.replay||e.onReplay,f=e.source!==void 0||e.note!==void 0?(0,v.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,v.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,v.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,v.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,v.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,v.jsx)(Rr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,v.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,v.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[c?(0,v.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:c}):null,(0,v.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:Nr(e.title,e.accent,t.paint("accentText"))}),e.actions,l?(0,v.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,v.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,v.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,v.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,v.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,v.jsx)("span",{}),i]}):null]}),(0,v.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,v.jsx)(tt.Provider,{value:r,children:(0,v.jsx)(Te.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),f?(0,v.jsxs)(v.Fragment,{children:[f,u]}):u]})}function ot(e){let t=oe(e.theme),n=nt(e.locale),r=e.height??220;if(ee(()=>ye(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,v.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,v.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,v.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,v.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,v.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,v.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,v.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,v.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,v.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,v.jsx)(v.Fragment,{children:e.children})}function de(e,t,n,r,o="max"){let a=new Set,i=n.length,s=l=>{if(i&&l!=="none"){if(l==="first")a.add(0);else if(l==="last")a.add(i-1);else if(l==="max"||l==="min"){let f=-1,u=l==="max"?-1/0:1/0;r.forEach((h,b)=>{Number.isFinite(h)&&(l==="max"?h>u:h<u)&&(u=h,f=b)}),f>=0&&a.add(f)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((l,f)=>{f<i&&l!==null&&l!==void 0&&e(l,f)&&a.add(f)}),a;let c=Array.isArray(e)?e:[e];for(let l of c)typeof l=="number"?l>=0&&l<i&&a.add(l):l==="max"||l==="min"||l==="first"||l==="last"||l==="none"?s(l):n.forEach((f,u)=>{f===l&&a.add(u)});return a}function Ut(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function xe(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function Yt(e,t){return xe(e+1,t).slice(0,e)}function qt(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Pr(e,t){if(e==null||typeof e!="object")return;let n=e;if(qt(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!qt(r,o))return;r=r[o]}return r}}function ke(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Xt(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Pr(r,n)}function ve(e,t){let n=Xt(e,t);return(r,o)=>ke(n(r,o))}function we(e,t){let n=Xt(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function at(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var X=S(O(),1);function Lr(e){let t=[],n=!1;for(let c=0;c<e.length&&c<4e3;c++){let l=e[c];if(l==='"')n=!n;else if(!n&&(l===`
23
+ `||l==="\r"))break;t.push(n?"":l)}let r=t.join(""),o=c=>r.split(c).length-1,a=[","," ",";","|"],i=",",s=0;for(let c of a){let l=o(c);l>s&&(s=l,i=c)}return i}var Fr=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Jt(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Fr.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ke(t);if(Number.isFinite(n))return n}return t}function ce(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Lr(o),i=[],s=[],c="",l=!1;for(let m=0;m<o.length;m++){let g=o[m];l?g==='"'?o[m+1]==='"'?(c+='"',m++):l=!1:c+=g:g==='"'&&!c.trim()?(l=!0,c=""):g===a?(s.push(c),c=""):g===`
24
+ `||g==="\r"?(g==="\r"&&o[m+1]===`
25
+ `&&m++,s.push(c),i.push(s),s=[],c=""):c+=g}(c!==""||s.length)&&(s.push(c),i.push(s));let f=i.filter(m=>!(m.length===1&&m[0].trim()===""));if(!f.length)return[];let u=m=>n?Jt(m):m;if(!r)return f.map(m=>Object.fromEntries(m.map((g,C)=>[String(C),u(g)])));let h=[],b=new Set;return f[0].forEach((m,g)=>{let C=m.trim()||`col${g+1}`,p=C;for(let x=2;b.has(p);x++)p=`${C}_${x}`;b.add(p),h.push(p)}),f.slice(1).map(m=>Object.fromEntries(h.map((g,C)=>[g,u(m[C]??"")])))}function it(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,c)=>[s,r&&typeof i[c]=="string"?Jt(i[c]):i[c]??null])))}function Dr(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,c)=>Object.fromEntries(a.map(l=>[l,e[l][c]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Zt(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function ie(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ie(JSON.parse(t))}catch{}return ce(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?it(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?ie(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?it(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?ie(t.rows):Array.isArray(t.values)?it(t.values):Array.isArray(t.items)?ie(t.items):Array.isArray(t.results)?ie(t.results):Dr(t)}return[]}function Qt(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}async function Er(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(z(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ce(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return ce(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):ce(a)}async function _r(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await Er(a,t.parse,o,t.locale)}return t.select&&(r=Zt(r,t.select)),t.transform?t.transform(r):ie(r)}function en(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,X.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,c]=(0,X.useState)(0),l=Z(t.locale),f=(0,X.useRef)(t);f.current={...t,locale:l};let u=(0,X.useRef)(e);u.current=e;let h=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",b=t.deps??[],m=JSON.stringify(b.map(p=>typeof p=="object"?JSON.stringify(p):String(p))),g=(0,X.useRef)(!1);(0,X.useEffect)(()=>{let p=u.current;if(!p||!r){i(y=>y.status==="loading"?{...y,status:"idle"}:y);return}let x=new AbortController,T=!0;return g.current=!0,i(y=>({...y,data:o?y.data:[],status:"loading",error:null})),_r(p,{...f.current,signal:x.signal}).then(y=>{T&&i({data:y,status:"success",error:null,updatedAt:Date.now()})}).catch(y=>{!T||x.signal.aborted||i(w=>({...w,status:"error",error:y instanceof Error?y:new Error(String(y))}))}).finally(()=>{T&&(g.current=!1)}),()=>{T=!1,g.current=!1,x.abort()}},[h,r,s,m,o]),(0,X.useEffect)(()=>{if(!n||!r)return;let p=setInterval(()=>{g.current||c(x=>x+1)},n);return()=>clearInterval(p)},[n,r]);let C=(0,X.useCallback)(()=>c(p=>p+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:C}}var lt=S(N(),1),Or=["csv","svg","png"],Ir=/^[=+\-@\t\r\n=+-@]/,Br=/var\(|color-mix\(/;function tn(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?Et(e.getTime()):String(e);return`"${(Ir.test(t)&&!Number.isFinite(ke(t))?`'${t}`:t).replace(/"/g,'""')}"`}function zr(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Hr(e,t){return`\uFEFF${[t.map(tn),...e.map(r=>t.map(o=>tn(r[o])))].map(r=>r.join(",")).join(`\r
26
+ `)}\r
27
+ `}function jr(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function st(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var nn=2,se=16;function rn(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function on(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function an(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,c]=[a+se*2,i+se*2],l=o.cloneNode(!0),f=l.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((m,g)=>{let C;for(let p of Array.from(m.attributes)){if(!Br.test(p.value))continue;let x=(C??(C=getComputedStyle(m))).getPropertyValue(p.name);x&&f[g].setAttribute(p.name,rn(x,u))}}),l.removeAttribute("style");for(let[m,g]of Object.entries({viewBox:`${-se} ${-se} ${s} ${c}`,width:s*t,height:c*t,"font-family":getComputedStyle(o).fontFamily}))l.setAttribute(m,String(g));let h=rn(getComputedStyle(r).backgroundColor,u),b=o.parentElement?.querySelector("canvas")??null;if(n){let m=l.querySelector("desc")?.nextSibling??l.firstChild;l.insertBefore(on("rect",{x:-se,y:-se,width:s,height:c,fill:h}),m),b&&l.insertBefore(on("image",{href:b.toDataURL(),width:a,height:i}),m)}return{svg:new XMLSerializer().serializeToString(l),w:s,h:c,vw:a,vh:i,bg:h,canvas:b}}function Vr(e,t){let n=an(e,nn,!1);if(!n)return;let r=nn,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,se*r,se*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(c=>c&&st(c,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function sn(e){let t=oe(e.theme),n=z(Z(e.locale))==="ko",r=jr(e.filename),o=(a,i)=>{if(a==="csv")return st(new Blob([Hr(e.data,e.columns?.length?e.columns:zr(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Vr(i,r);let s=an(i,1,!0);s&&st(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,lt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Or.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,lt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:c=>o(a,c.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var cn=S(N(),1);function ln(e,t=re){let n=Ne(void 0,t),r=e.split(`
28
+ `),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?It(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let c=!1,l=s.replace(_t,(f,u)=>o(a,u.trim())??(c=!0,""));c||i.push(l)}return i.length?i.map((s,c)=>(0,cn.jsx)("div",{children:s},c)):null}}var d=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Q=d("label","string",!0,"Item name field"),K=d("value","number",!0,"Value field"),Wr=[Q,K],Kr=[Q,K],Gr=[d("label","string",!0,"Stage name"),d("value","number",!0,"Users at the stage")],Ur=[Q,K],Yr=[d("label","string",!0,"Leaf (lowest level) name"),K,d("group","string",!1,"Parent group field")],qr=[d("label","string",!0,"Leaf name"),K,d("group","string",!1,"Parent group field")],Xr=[Q,d("value","number",!0,"Change (total rows may omit it)"),d("type","string",!1,'"total" makes a total bar')],Jr=[Q,K],Zr=[d("x","string",!0,"Column field"),d("series","string",!0,"Stacked series field"),K],Qr=[d("x","string",!0,"Column field"),d("y","string",!0,"Row field"),K],eo=[d("axis","string",!0,"Metric (axis) field"),d("value","number",!0,"Value field",{multi:!0}),d("series","string",!1,"Series field")],to=[d("x","number",!0,"x value"),d("y","number",!0,"y value"),d("size","number",!1,"Circle size"),d("label","string",!1,"Name")],mn=d("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),no=[d("x","any",!0,"x field (date, number or category)"),d("y","number",!0,"y field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field (long tables)"),d("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),mn],ro=[d("x","any",!0,"x field"),d("y","number",!0,"y field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field"),d("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),mn],oo=[d("x","any",!0,"x field"),d("y","number",!0,"y field",{multi:!0}),d("series","string",!1,"Series field")],ao=[d("x","string",!0,"Category field"),d("y","number",!0,"Value field. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field"),d("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],io=[Q,K],so=[d("value","number",!0,"Value field",{prop:"valueKey"}),d("target","number",!1,"Target field",{prop:"targetKey"})],lo=[Q,d("value","number",!0,"Actual value field"),d("target","number",!1,"Target field")],co=[d("x","any",!1,"x field"),d("y","number",!0,"y field")],uo=[Q,d("x","string",!1,"Period field (long tables)"),d("value","number",!1,"Value field (long tables)")],mo=[Q,d("start","number",!0,"Before value"),d("end","number",!0,"After value")],fo=[Q,K],ho=[d("value","number",!0,"Value field"),d("group","string",!1,"Group (row) field"),d("label","string",!1,"Dot name")],go=[d("group","string",!0,"Group field"),d("value","number",!0,"Value field")],po=[d("source","string",!0,"Source node"),d("target","string",!0,"Target node"),K],bo=[d("source","string",!0,"Sending group"),d("target","string",!0,"Receiving group"),K],yo=[d("date","date",!0,"Date field"),K],xo=[d("x","any",!0,"Period field"),d("series","string",!0,"Item field"),d("rank","number",!1,"Rank field (1 is first)"),d("value","number",!1,"Value field (instead of rank, largest is first)")],ko=[d("group","string",!0,"Group field"),d("value","number",!0,"Value field")],vo=[d("label","string",!1,"Row name field")],wo=[d("x","date",!0,"Date (period) field"),d("open","number",!0,"Open price field"),d("high","number",!0,"High price field"),d("low","number",!0,"Low price field"),d("close","number",!0,"Close price field"),d("volume","number",!1,"Volume field")],Co=[Q,K],$o=[d("x","any",!0,"Period field (date or category)"),d("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),d("series","string",!1,"Series field (long tables, back row only)"),d("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],To=[d("value","number",!1,"Sample value field (raw rows)"),d("group","string",!1,"Group field. Up to 2 groups overlap"),d("x0","number",!1,"Bin start (pre-binned rows)"),d("x1","number",!1,"Bin end (pre-binned rows)"),d("count","number",!1,"Samples in the bin (pre-binned rows)")],So=[d("x","number",!0,"x value"),d("y","number",!0,"y value"),d("series","string",!1,"Series field (one color per series)"),d("label","string",!1,"Name")],un={pie:Wr,donut:Kr,funnel:Gr,waffle:Ur,treemap:Yr,sunburst:qr,waterfall:Xr,pareto:Jr,marimekko:Zr,heatmap:Qr,radar:eo,bubble:to,line:no,area:ro,stream:oo,bar:ao,radialBar:io,gauge:so,bullet:lo,sparkline:co,slope:uo,dumbbell:mo,lollipop:fo,beeswarm:ho,ridgeline:go,sankey:po,chord:bo,calendar:yo,bump:xo,box:ko,parallel:vo,candlestick:wo,segmented:Co,skyline:$o,histogram:To,scatter:So},fe={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"}};function dn(e,t){return t==="ko"?e.nameKo:e.name}function fn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var ct=["line","area","bar","scatter"];function ut(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function hn(e,t,n){return ct.includes(e)&&!ut(e,t,n).length}function gn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Mo={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram"};function _e(e){let t=un[e]?e:Mo[e]??Object.keys(fe).find(n=>n.toLowerCase()===e.toLowerCase()||fe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!fe[t]))return{type:t,component:fe[t].component,name:fe[t].name,nameKo:fe[t].nameKo,encoding:un[t]}}function pn(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of _e(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}var ge=Math.PI*2;function bn(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function he(e){return Math.round(e*100)/100}function U(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function mt(e,t,n,r,o){let a=o-r;if(!(Math.abs(a)>1e-4))return"";let i=Math.abs(a)>=ge-1e-4?r+(a>0?ge-1e-4:-(ge-1e-4)):o,[s,c]=U(e,t,n,r),[l,f]=U(e,t,n,i),u=Math.abs(i-r)>Math.PI?1:0;return`M${he(s)},${he(c)}A${he(n)},${he(n)} 0 ${u} ${a>0?1:0} ${he(l)},${he(f)}`}function yn(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return ce(t.csv)}return null}var Y=S(O(),1);var A=S(N(),1),Oe=60;var xn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function kn(e){let{c:t,events:n}=e,r=(0,Y.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ee(()=>{ye()},[]);let i=n.length,s=!e.noNav&&i>0,c=(0,Y.useContext)(Te),l=e.ariaLabel??c??e.kind,f=(0,Y.useMemo)(()=>s?`${n.length}${n.slice(0,Oe).map($=>`${$.label}${$.series??""}${$.formatted??$.value??""}`).join("")}`:"",[n,s]),u=(0,Y.useMemo)(()=>(0,A.jsx)(Ao,{label:l,events:n,t:t.t}),[l,f,t.t]),h=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let $=()=>{h.current=null};return window.addEventListener("scroll",$,{capture:!0,passive:!0}),window.addEventListener("resize",$,{passive:!0}),()=>{window.removeEventListener("scroll",$,{capture:!0}),window.removeEventListener("resize",$)}},[]),(0,Y.useEffect)(()=>{h.current=null},[t.width,t.height]);let b=$=>{if($.target!==$.currentTarget)return;if(e.onKey?.($)){$.preventDefault();return}let P=t.active,F;switch($.key){case"ArrowRight":case"ArrowDown":F=P===null?0:(P+1)%i;break;case"ArrowLeft":case"ArrowUp":F=P===null?i-1:(P-1+i)%i;break;case"Home":F=0;break;case"End":F=i-1;break;case"Escape":if(P===null)return;F=null;break;case"Enter":case" ":P!==null&&($.preventDefault(),t.click(P));return;default:return}$.preventDefault(),t.setActive(F,"keyboard")},{via:m,node:g,setActive:C}=t;(0,Y.useEffect)(()=>{if(m!=="touch"||!g)return;let $=P=>{g.contains(P.target)||C(null)};return document.addEventListener("pointerdown",$),()=>document.removeEventListener("pointerdown",$)},[m,g,C]);let p=t.active!==null?n[t.active]:null,x=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,T=x&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,y=typeof e.renderTip=="function"&&p?e.renderTip(p):null,w=e.announce??(t.via==="keyboard"&&p?`${p.label}${p.series?` ${p.series}`:""}: ${p.formatted??p.value??""} (${(t.active??0)+1}/${i})`:""),H;if(x){let $=x.x*T,P=t.width*T,F=`clamp(${(4-$).toFixed(1)}px, -50%, calc(${(P-$-4).toFixed(1)}px - 100%))`,ue=x.y<64;H={position:"absolute",left:$,top:x.y*T,transform:`translate(${F}, ${ue?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*T-8)}}let j=$=>{h.current=null,$.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},V=$=>$?P=>{let F=h.current??(h.current=P.currentTarget.getBoundingClientRect());F.width&&$((P.clientX-F.left)/F.width*t.width,(P.clientY-F.top)/F.height*t.height,P)}:void 0,E=V(e.onPointerMove),I=V(e.onPointerDown),k=E||I?$=>{$.pointerType==="touch"&&E?.($),I?.($)}:void 0,M=V(e.onPointerUp),W=Wt(e.theme);return(0,A.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":l,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?b:void 0,onBlur:$=>{t.via==="keyboard"&&!$.currentTarget.contains($.relatedTarget)&&t.setActive(null)},onPointerLeave:j,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...W,...e.style},children:[t.pending?null:e.underlay,(0,A.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:E,onPointerDown:k,onPointerUp:M,onPointerCancel:M,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,A.jsx)("title",{id:o,children:l}),(0,A.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,A.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,x?(0,A.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:H,children:y??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:x.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:x.title}),x.rows.map(($,P)=>(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint($.strong?"ink":"muted")},children:[$.color?(0,A.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:$.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,$.label]}),(0,A.jsx)("span",{style:{fontWeight:$.strong===!1?500:700},children:$.value})]},P))]})}):null,(0,A.jsx)("span",{className:"ztd-sr",style:xn,"aria-live":"polite","aria-atomic":"true",children:w}),s&&!t.pending?u:null]})}function Ao({label:e,events:t,t:n}){return(0,A.jsx)("div",{className:"ztd-sr",style:xn,children:(0,A.jsxs)("table",{children:[(0,A.jsx)("caption",{children:n.table(e)}),(0,A.jsxs)("tbody",{children:[t.slice(0,Oe).map((r,o)=>(0,A.jsxs)("tr",{children:[(0,A.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,A.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>Oe?(0,A.jsx)("tr",{children:(0,A.jsx)("td",{colSpan:2,children:n.more(t.length-Oe)})}):null]})]})})}function pe(e){let t=e.baseline??"central";return(0,A.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}function Cn(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function vn(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var Ie=new Map;function wn(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=Ie.get(o);if(a===void 0){let i=0,s=0;for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);Cn(l)?i+=vn(l):s+=vn(l)}a=i+s*(n>=600?1.07:1),Ie.size>5e3&&Ie.clear(),Ie.set(o,a)}return a*t}function $n(e,t,n,r=400){if(e=e.trim(),wn(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let c=a+i+1>>1;wn(e.slice(0,c)+o,n,r)<=t?a=c:i=c-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(Cn(s.charCodeAt(0))?2:3)?"":s+o}var _=S(O(),1);var q=S(O(),1);function Ro(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function No(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Mn(e,t=!0){let[n,r]=(0,q.useState)({visible:!t,near:!t});return(0,q.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=No(i[i.length-1],.25);r(c=>c.visible===s?c:{...c,visible:s,near:c.near||s})},{threshold:Ro(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(c=>c.near===s.isIntersecting?c:{...c,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Tn(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function An(e){let[t,n]=(0,q.useState)(null),[r,o]=(0,q.useState)(e??null),a=(0,q.useCallback)(i=>{n(i),i&&e===void 0&&o(Tn(i))},[e]);return ee(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=l=>o(f=>f!==null&&Math.abs(f-l)<.5?f:l),s=()=>i(Tn(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let c=new ResizeObserver(l=>{let f=l[l.length-1]?.contentRect;f?i(f.width>0?Math.round(f.width*10)/10:0):s()});return c.observe(t),()=>c.disconnect()},[t,e]),[t,a,r]}var Po=()=>()=>{};function Be(){return(0,q.useSyncExternalStore)(Po,()=>!0,()=>!1)}var Sn="(prefers-reduced-motion: reduce)";function Rn(e="auto"){let[t,n]=(0,q.useState)(()=>ne&&typeof window.matchMedia=="function"?window.matchMedia(Sn).matches:!1);return(0,q.useEffect)(()=>{if(e!=="auto"||!ne||typeof window.matchMedia!="function")return;let r=window.matchMedia(Sn),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function Nn(e,t){let n=oe(e.theme),[r,o,a]=An(e.width),i=Be(),s=e.width??(a||t.ssrWidth||480),c=typeof t.height=="function"?t.height(s):t.height,l=e.height??c,f=Rn(e.reducedMotion??"auto"),u=e.animate!==!1&&!f&&ne,h=Mn(r,e.animateOnView!==!1&&u),b=Z(e.locale),m=z(b),g=(0,_.useMemo)(()=>Ne(e.format,b,t.format),[e.format,b,t.format]),C=(0,_.useCallback)(R=>Re(R,{locale:b}),[b]),p=(0,_.useMemo)(()=>Lt(g,e.unit),[g,e.unit]),x=(0,_.useMemo)(()=>Qt(e.data),[e.data]),[T,y]=(0,_.useState)(null),[w,H]=(0,_.useState)(null),j=(0,_.useRef)([]),V=(0,_.useRef)(e.onHover);V.current=e.onHover;let E=(0,_.useRef)(e.onClick);E.current=e.onClick;let I=(0,_.useRef)(null),k=(0,_.useRef)(null),M=(0,_.useRef)(null),W=(0,_.useCallback)((R,G="pointer")=>{if(M.current!==R){M.current=R;let me=R===null?null:j.current[R]??null;queueMicrotask(()=>V.current?.(me)),k.current?.(R)}I.current=R===null?null:G,y(R),H(I.current)},[]),$=(0,_.useCallback)(R=>{I.current!=="keyboard"&&(I.current=R===null?null:"sync",y(R),H(I.current))},[]),P=(0,_.useCallback)(R=>{let G=j.current[R];G&&E.current?.(G)},[]),F=Kt(e.replayKey),ue=e.width!==void 0||(a??0)>0,B={enabled:u,active:h.visible&&ue,near:h.near,replayKey:F,dataKey:x,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},te=(0,_.useCallback)((R,G=1)=>T===null||T===R?G:G*.38,[T]);return{p:n,width:s,height:l,measured:ue,responsive:e.width===void 0,pending:ne&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:B,fv:p,fmt:g,pct:C,locale:b,lang:m,t:m==="ko"?St:Tt,active:T,via:w,setActive:W,click:P,events:j,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:te,sig:x,description:e.description,reduced:f,publish:k,applySync:$}}var D=S(O(),1);function Lo(e){return 1-Math.pow(1-e,3)}function Fo(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Do(e){return e==="easeInOut"?Fo:e==="linear"?t=>t:Lo}function Eo(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function be(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function ze(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function Pn(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function Ln(e,t,n,r){if(!t||!n||t.length!==n.length)return be(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let c of be(s,n[i]))o.push(c)}return o.length===r?o:be(e,r)}var He=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!ze(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Pn(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=ze(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),c=r>0?Math.min(a*r,240):0;if(s){let l=i.to.length;s.from=Ln(s.cur,s.parts,i.parts,l),s.vel=Ln(s.curVel,s.parts,i.parts,l),s.parts=i.parts,s.to=i.to.slice(),Pn(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):c),s.done=ze(s.from,s.to)&&s.vel.every(f=>Math.abs(f)<1e-6),s.progress=s.done?1:0}else{let l=this.make(i,i.enter??i.from??i.to,n+c,0);l.done=ze(l.from,l.to),this.tracks.set(i.key,l)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=be(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Do(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let c=(t-s.t0)/1e3,l=s.to.length;if(s.from.length!==l&&(s.from=be(s.from,l)),s.vel.length!==l&&(s.vel=be(s.vel,l)),s.cur.length!==l&&(s.cur=new Array(l).fill(0),s.curVel=new Array(l).fill(0)),!(c>0)){for(let u=0;u<l;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let f;if(this.easing==="spring"){let u=Math.exp(-a*c),h=a*c>=8&&a*c<20,b=0;for(let m=0;m<l;m++){let g=s.from[m]-s.to[m],C=s.vel[m]+a*g;s.cur[m]=s.to[m]+(g+C*c)*u,s.curVel[m]=(s.vel[m]-a*C*c)*u,h&&b<.15&&(b=Math.max(b,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/a)))}f=a*c>=20||h&&b<.15,s.progress=Math.min(1,1-(1+a*c)*u)}else{let u=Math.min(1,c/o),h=r(u),b=Eo(this.easing,u)/o;for(let m=0;m<l;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*h,s.curVel[m]=(s.to[m]-s.from[m])*b;f=u>=1,s.progress=h}if(f){for(let u=0;u<l;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Ce=new Set,je=0;function Fn(e){je=0;let t=Array.from(Ce);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ce.delete(n)}Ce.size&&typeof requestAnimationFrame<"u"&&(je=requestAnimationFrame(Fn))}function Dn(e){return Ce.add(e),!je&&typeof requestAnimationFrame<"u"&&(je=requestAnimationFrame(Fn)),()=>{Ce.delete(e)}}function _o(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function En(e,t){let n=(0,D.useMemo)(()=>_o(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:c="spring",duration:l=900,stagger:f=0}=t,u=(0,D.useRef)(null),h=(0,D.useRef)("init"),b=(0,D.useRef)(null),m=(0,D.useRef)(s),g=(0,D.useRef)(i),C=(0,D.useRef)(!1),p=(0,D.useRef)(0),[,x]=(0,D.useState)(0),T=(0,D.useRef)(null),y=(0,D.useRef)(!0);u.current||(u.current=new He,u.current.configure(c,l),u.current.snap(n),b.current=n);let w=u.current;if(w.configure(c,l),b.current!==n){let k=h.current,M=!Object.is(m.current,s);w.sameTargets(n)?w.refreshData(n):!r||k==="init"?w.snap(n):k==="idle"?w.hold(n):k==="running"||M?w.update(n,Me(),f):w.snap(n),b.current=n,m.current=s}let H=(0,D.useRef)(()=>!1);H.current=k=>{if(!y.current)return!1;let M=w.step(k);return!M&&h.current==="running"&&(h.current="done"),x(W=>(W+1)%1e9),M||(T.current=null),M};let j=(0,D.useCallback)(()=>{if(!ne||T.current||!w.animating)return;let k=M=>H.current(M);T.current=Dn(k)},[w]);ee(()=>{let k=!Object.is(g.current,i);if(g.current=i,!r){(h.current!=="done"||w.animating)&&(w.snap(b.current??n),h.current="done",x(M=>M+1));return}h.current==="init"||k&&a?(w.hold(b.current??n),h.current="idle",C.current=!1,x(M=>M+1)):k&&(C.current=!0)},[r,i]),ee(()=>{!r||!a||!C.current||(C.current=!1,w.hold(b.current??n),h.current="idle",x(k=>k+1))},[a,r]),(0,D.useEffect)(()=>{r&&o&&h.current==="idle"&&(w.start(Me()),p.current+=1,h.current="running",j(),x(k=>k+1))},[r,o,i,w,j]),(0,D.useEffect)(()=>{w.animating&&j()}),(0,D.useEffect)(()=>(y.current=!0,()=>{y.current=!1,T.current?.(),T.current=null}),[]);let V=Me(),E=w.elapsed(V),I=r&&h.current==="idle";return{items:w.items(),get:k=>w.get(k),elapsed:I?0:E,fade:(k,M=320)=>I?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-k)/M)):1,waiting:I,animating:w.animating,generation:p.current}}var Oo=S(O(),1);var On=S(N(),1);var _n=e=>e?"neutralStrong":"accent";var dt=S(N(),1);function In(e,t,n,r){if(typeof e!="function")return de(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let c=o.get(r(i,s));c!==void 0&&e(i,s)&&a.add(c)}),a}var Io=S(O(),1);var ht=S(N(),1),Bo={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Ae(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Bn={en:Bo,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},ft=["ink","muted","dim"];function zn(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,ft.length)}var zo=S(O(),1);var Wn=S(N(),1),Ho={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ae(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},jo={en:Ho,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Hn=(e,t)=>jo[e].other(t);function jn(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,bn(o.map(a=>a.value)))}}var Vn=e=>Number.isFinite(e)&&e>0?e:0;var Ve=S(O(),1);var L=S(N(),1),Vo={radial:"Radial bar chart",gauge:"Gauge",vsTarget:"vs. target",current:"Current",target:"Target",targetWord:"target",achieved:"Achieved",range:"Range",rangeWord:"range",span:(e,t)=>`${e} to ${t}`},Wo={en:Vo,ko:{radial:"방사형 막대",gauge:"게이지",vsTarget:"목표 대비",current:"현재",target:"목표",targetWord:"목표",achieved:"달성률",range:"범위",rangeWord:"범위",span:(e,t)=>`${e}~${t}`}};function Ko(e){let{cx:t,cy:n,r,len:o,start:a,span:i,lit:s,on:c,off:l}=e,f=Math.max(2,Math.round(e.count??Math.max(24,Math.min(64,(r-o/2)*i/8)))),u=(0,Ve.useMemo)(()=>{let h=(r-o/2)*i/(f-1),b=Math.max(1.6,Math.min(3.4,h*.42));return Array.from({length:f},(m,g)=>{let C=a+i*(g/(f-1)),[p,x]=U(t,n,r-o,C),[T,y]=U(t,n,r-1,C),w=H=>(0,L.jsx)("line",{x1:p,y1:x,x2:T,y2:y,stroke:H,strokeWidth:b,strokeLinecap:"round"},g);return{on:w(c),off:w(l)}})},[t,n,r,o,a,i,f,c,l]);return(0,L.jsx)("g",{"aria-hidden":"true",children:u.map((h,b)=>s>.002&&b/(f-1)<=s+1e-6?h.on:h.off)})}function gt(e){let t=(0,Ve.useMemo)(()=>e.data??[{value:e.value??0,target:e.target}],[e.data,e.value,e.target]),n=e.variant??"arc",r=Nn({...e,data:t},{height:B=>n==="semi"?Math.max(150,Math.min(210,B*.5)):Math.max(180,Math.min(240,B*.6)),duration:1100,format:"integer"}),{p:o,width:a,height:i}=r,s=ve(e.valueKey,"value"),c=ve(e.targetKey,"target"),l=e.value??(t[0]?s(t[0],0):0),f=e.target??(t[0]?c(t[0],0):NaN),u=e.min??0,h=e.max??100,b=Math.max(0,Math.min(1,(l-u)/(h-u||1))),m=Number.isFinite(f)?Math.max(0,Math.min(1,(f-u)/(h-u||1))):NaN,C=(n==="ring"?360:n==="semi"?180:240)/360*ge,p=n==="ring"?0:-C/2,x=n==="semi"?Math.max(30,Math.min(i-26,a/2-10)):Math.max(30,Math.min(i/2-6,a/2-10)),T=a/2,y=n==="semi"?i-18:n==="ring"?i/2:i/2+x*.12,w=Math.max(8,Math.min(n==="ring"?16:20,x*.17)),H=(0,Ve.useMemo)(()=>[{key:"v",to:[b,l],from:[0,u],enter:[0,u],data:null}],[b,l,u]),j=En(H,r.motion),V=j.get("v")??[b,l],E=Ut(o,"accent"),I=e.bands?.filter(B=>B>u&&B<h)??[],k=Wo[r.lang],M=e.label??r.t.value,W=k.span(r.fmt(u),r.fmt(h)),$=e.value===void 0&&!t.length?[]:[{datum:t[0]??null,index:0,key:"value",label:M,value:l,formatted:`${r.fv(l)}${Number.isFinite(f)?` / ${k.targetWord} ${r.fv(f)}`:""}`}],P=r.active===0?{x:T,y:y-x,title:M,rows:[{label:k.current,value:r.fv(l),color:E.fill},...Number.isFinite(f)?[{label:k.target,value:r.fv(f)},...f?[{label:k.achieved,value:r.pct(l/f*100)}]:[]]:[],{label:k.range,value:W}]}:null,F=Math.max(18,Math.min(42,x*.42)),ue=e.description??`${k.gauge}. ${M} ${r.fv(l)}, ${k.rangeWord} ${W}${Number.isFinite(f)?`, ${k.targetWord} ${r.fv(f)}`:""}.`;return(0,L.jsxs)(kn,{c:r,kind:k.gauge,ariaLabel:e.ariaLabel,description:ue,events:$,tip:P,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[(0,L.jsxs)("g",{onPointerEnter:B=>r.setActive(0,B.pointerType==="touch"?"touch":"pointer"),children:[n==="ticks"?(0,L.jsx)(Ko,{cx:T,cy:y,r:x,len:w*1.3,start:p,span:C,count:e.ticks,lit:V[0],on:E.fill,off:o.paint("neutralSoft")}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("path",{d:mt(T,y,x-w/2,p,p+C),fill:"none",stroke:o.paint("neutralSoft"),strokeWidth:w,strokeLinecap:n==="ring"?"butt":"round"}),I.map((B,te)=>{let R=(B-u)/(h-u),[G,me]=U(T,y,x-w-3,p+C*R),[qn,Xn]=U(T,y,x+2,p+C*R);return(0,L.jsx)("line",{x1:G,y1:me,x2:qn,y2:Xn,stroke:o.paint("panel"),strokeWidth:2},te)}),V[0]>.002?(0,L.jsx)("path",{d:mt(T,y,x-w/2,p,p+C*V[0]),fill:"none",stroke:E.fill,strokeWidth:w,strokeLinecap:"round"}):null]}),Number.isFinite(m)?(()=>{let[B,te]=U(T,y,x-w-4,p+C*m),[R,G]=U(T,y,x+4,p+C*m);return(0,L.jsx)("line",{x1:B,y1:te,x2:R,y2:G,stroke:o.paint("ink"),strokeWidth:2.5,strokeLinecap:"round",opacity:j.fade(500,300)})})():null]}),(0,L.jsx)(pe,{x:T,y:n==="semi"?y-F*.55:y-(e.label?F*.18:0),anchor:"middle",size:F,weight:800,fill:o.paint("ink"),letterSpacing:-1,children:r.fv(V[1])}),e.label?(0,L.jsx)(pe,{x:T,y:n==="semi"?y-6:y+F*.5,anchor:"middle",size:11.5,fill:o.paint("muted"),children:$n(e.label,x*1.5,11.5)}):null,n!=="ring"?(0,L.jsx)("g",{"aria-hidden":"true",children:(()=>{let[B,te]=U(T,y,x-w/2,p),[R,G]=U(T,y,x-w/2,p+C),me=n==="semi"?12:w/2+10;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(pe,{x:B,y:te+me,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(u)}),(0,L.jsx)(pe,{x:R,y:G+me,anchor:"middle",size:10,fill:o.paint("muted"),children:r.fmt(h)})]})})()}):null,Number.isFinite(f)&&r.showLabels&&n!=="ring"?(()=>{let[B,te]=U(T,y,x+14,p+C*m),R=Math.sin(p+C*m);return(0,L.jsx)(pe,{x:B,y:te,anchor:R>.2?"start":R<-.2?"end":"middle",size:10.5,weight:700,fill:o.paint("ink"),opacity:j.fade(600,300),children:`${k.target} ${r.fmt(f)}`})})():null]})}var le=S(N(),1);function Kn(e,t){let n=_e(e);return n?.type==="scatter"&&t?.size!==void 0?_e("bubble"):n}function Go(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function Uo(e,t,n,r=!1){let o=Kn(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,c=new Set(!r&&ct.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),l=u=>u.filter(h=>!c.has(h.label)),f=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(f.includes(o.type)){let u=we(a.label,"label"),h=ve(a.value,"value"),b=o.type==="waffle",m=t.map((y,w)=>({r:y,label:u(y,w),value:b?h(y,w):Vn(h(y,w))})),{kept:g,other:C}=b?{kept:m,other:null}:jn(m,i.other,(y,w)=>({r:{},label:Hn(z(n),y),value:w})),p=de(s,g.map(y=>y.r),g.map(y=>y.label),g.map(y=>y.value),b?"first":"max"),x=C?[...g,C]:g,T=xe(x.length,p);return x.map((y,w)=>({label:y.label,color:T[w]}))}if(o.type==="candlestick"){let u=zn(Array.isArray(i.ma)?i.ma:void 0,t.length),h=Bn[z(n)];return[{label:h.up,color:i.upColor??"accent"},{label:h.down,color:i.downColor??"neutralStrong"},...u.map((b,m)=>({label:h.maLegend(b),color:ft[m],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let u=we(a.series,"series"),h=at(t.map((m,g)=>u(m,g)));if(h.length<2)return[];let b=Yt(h.length,In(s,t,h,u));return l(h.map((m,g)=>({label:m,color:b[g],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let g=we(a.series,"series");u=at(t.map((C,p)=>g(C,p)))}let h=ut(o.type,a,i);if(h.length){let g=xe(u.length,de(s,u,u,u.map(()=>0),"none")),C=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((p,x)=>({label:p,color:g[x]}));return[...l(C),...h.map((p,x)=>({label:p,color:_n(x),shape:"line"}))]}if(u.length<2)return[];let b=de(s,u,u,u.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return l(u.map((g,C)=>({label:g,color:b.has(C)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let m=xe(u.length,b);return l(u.map((g,C)=>({label:g,color:m[C]})))}return[]}function Gn(e,t){let{spec:n}=e,r=Kn(n.type,n.encoding),o=(0,$e.useMemo)(()=>yn(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=fn(n,e.locale),s=Z(i),c=z(s),l=en(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),f=gn(n),u=(0,$e.useMemo)(()=>f?ln(f,s):void 0,[f,s]),h=n.options?.hidden,b=Array.isArray(h)?h.map(String):[],m=b.join(""),[g,C]=(0,$e.useState)(null);if(!r)return(0,le.jsx)(ot,{error:c==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let p=o??l.data,x=t[r.type],T={...n.options??{}},y={...Go(r,n.encoding),...T,...u?{tooltip:u}:{},data:p,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},w=n.card?.legend==="toggle"&&hn(r.type,n.encoding??{},T),H=g&&g.base===m?g.hidden:b;w&&(y.hidden=H);let j=k=>C(M=>{let W=M&&M.base===m?M.hidden:b;return{base:m,hidden:W.includes(k)?W.filter($=>$!==k):[...W,k]}}),V=y.height??220,E=a&&!p.length&&(l.loading||l.error||l.empty)?(0,le.jsx)(ot,{loading:l.loading,error:l.error,empty:l.empty,onRetry:l.reload,height:V,locale:i}):(0,le.jsx)(x,{...y});if(n.card){let k=n.card,M=k.legend==="auto"||k.legend==="toggle"?Uo(n,p,s,w):k.legend,W=M?.length?w?(0,le.jsx)(rt,{items:M,hidden:H,onToggle:j,locale:i}):M:void 0,$=k.download?(0,le.jsx)(sn,{data:p,columns:pn(n),filename:k.title??r.type,formats:Array.isArray(k.download)?k.download:void 0,locale:i}):void 0;E=(0,le.jsx)(Gt,{number:k.number,title:k.title??dn(r,c),subtitle:k.subtitle,legend:W,actions:$,source:k.source||void 0,note:k.note||void 0,accent:k.accent,takeaway:k.takeaway,level:k.level,sample:k.sample,replay:k.replay!==!1,className:e.className,locale:i,children:E})}let I=e.theme??n.theme;return I&&(E=(0,le.jsx)(Fe,{theme:I,children:E})),E}function Yo({cfg:e,components:t}){let n=Be();return Gn({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Yn(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Un.hydrateRoot)(r,(0,pt.createElement)(Fe,{theme:o.theme,cssVars:!0},(0,pt.createElement)(Yo,{cfg:o,components:{[e]:t}})))}Yn("gauge",gt);})();
@@ -0,0 +1,28 @@
1
+ (()=>{var Lr=Object.create;var Yt=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var Ir=Object.getPrototypeOf,Or=Object.prototype.hasOwnProperty;var ft=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _r(t))!Or.call(e,a)&&a!==n&&Yt(e,a,{get:()=>t[a],enumerable:!(r=Er(t,a))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?Lr(Ir(e)):{},Br(t||!e||!e.__esModule?Yt(n,"default",{value:e,enumerable:!0}):n,e));var H=ft((Ea,qt)=>{qt.exports=globalThis.__ztdReact.react});var Jt=ft((_a,Xt)=>{Xt.exports=globalThis.__ztdReact["react-dom/client"]});var L=ft((Ua,kn)=>{kn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Kt=S(H(),1),Sr=S(Jt(),1);var Oe=S(H(),1);var tt=S(H(),1);var Zt=S(H(),1),Ke=(0,Zt.createContext)(void 0);var Vr=S(H(),1);var zr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Qt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',en='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',pe={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Qt,monoFamily:en,radius:18,radiusCode:14,radiusMark:4},Hr={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Qt,monoFamily:en,radius:18,radiusCode:14,radiusMark:4},ht={dark:pe,light:Hr};function gt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function pt(e){let t={};for(let n of zr){let r=e[n];typeof r=="string"&&(t[gt(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function bt(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let a=t[r];a!==void 0&&(n[r]=a)}return n}var jr=`
2
+ .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
+ .ztd-root:focus{outline:none}
4
+ .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${pe.accent});outline-offset:3px;border-radius:6px}
5
+ .ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
6
+ .ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
7
+ .ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
8
+ .ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
9
+ .ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
10
+ .ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
11
+ .ztd-btn:focus{outline:none}
12
+ .ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${pe.accent});outline-offset:2px}
13
+ .ztd-card{transition:border-color .16s ease}
14
+ .ztd-card:hover{border-color:var(--ztd-dim,${pe.dim})}
15
+ @media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
16
+ @keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
17
+ @keyframes ztd-fade{from{opacity:0}to{opacity:1}}
18
+ .ztd-pop{transform-box:fill-box;transform-origin:center}
19
+ @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
+ .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
+ @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
+ `;var tn=!1;function Le(){if(tn||typeof document>"u"||(tn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=jr,document.head.appendChild(e)}var Ge=S(H(),1),me=typeof window<"u"&&typeof document<"u",le=me?Ge.useLayoutEffect:Ge.useEffect;function Ue(){return typeof performance<"u"?performance.now():Date.now()}function W(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ce(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var nn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},rn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Wr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Kr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Gr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Ur(e){return Gr(Wr,e)}function on(e,t){let n=Ur(e);return{text:n?n[t]:e,...Kr[n?.id??"basic"]}}var ae=S(H(),1);var un=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),de="en-US",an=new Map;function yt(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),a=an.get(r);return a||(a=new Intl.NumberFormat(e,n),an.set(r,a)),a}function xt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function kt(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;return xt(yt(n,r).format(e))}var mn=e=>e!==0&&Math.abs(e)<.05,dn=(e,t,n="")=>`${kt(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ye(e,t={}){if(!Number.isFinite(e))return"-";if(mn(e)&&t.maximumFractionDigits===void 0)return dn(e,t.locale??de,"%");let n=Math.abs(e);return`${kt(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Yr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=de,...r}=t;if(W(n)==="ko"){let a=Math.abs(e),o=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=o.findIndex(([s])=>a>=s);for(i<0&&(i=o.length-1);;){let[s,l]=o[i],c=a/s,p=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**p)/10**p;if(i>0&&u>=o[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+kt(u,{locale:n,...r,maximumFractionDigits:p})+l}}return xt(yt(n,{notation:"compact",...r}).format(e))}var qr=(e,t=W(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function qe(e,t=de,n){if(typeof e=="function")return e;let r=(a,o="",i="")=>{let s=yt(t,a);return l=>Number.isFinite(l)?`${i}${xt(s.format(l))}${o}`:"-"};if(e&&typeof e=="object"){let{suffix:a="",prefix:o="",...i}=e;return r(i,a,o)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return a=>Ye(a,{locale:t});case"ratio":return a=>Ye(a*100,{locale:t});case"compact":return a=>Yr(a,{locale:t});case"currency":return r(qr(t));default:{let a=r({maximumFractionDigits:1});return o=>mn(o)?dn(o,t):a(o)}}}function Xr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Jr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var Zr=["january","february","march","april","may","june","july","august","september","october","november","december"],sn=e=>{let t=e.toLowerCase();return t.length<3?0:Zr.findIndex(n=>n.startsWith(t))+1},ln=e=>+e+(+e<30?2e3:1900);function fn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Qr=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],eo=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,hn=/\{([^{}]+)\}/g;function to(e,t){let n;for(let r of Qr)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[ln(n[3]),+n[2],+n[1],1]:[ln(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=eo.exec(e)){let r=+n[1],a=+n[3],o=r>12||a<=12&&t===!0;return[+n[4],o?a:r,o?r:a,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=sn(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=sn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function gn(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(Jr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return gn(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=to(n,t);if(r)return Xr(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let a=new Date(n);return Number.isNaN(a.getTime())?null:a}return null}var cn=new Map;function pn(e,t={month:"short",day:"numeric"}){let n=gn(e);if(!n)return"-";let{locale:r=de,...a}=t,o=r+JSON.stringify(a),i=cn.get(o);return i||(i=new Intl.DateTimeFormat(r,a),cn.set(o,i)),i.format(n)}var bn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function be(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),bn[t.toLowerCase()]&&(t=bn[t.toLowerCase()]),t.startsWith("#")){let a=t.slice(1);if((a.length===3||a.length===4)&&(a=a.split("").map(i=>i+i).join("")),a.length!==6&&a.length!==8||/[^\da-f]/i.test(a))return null;let o=parseInt(a,16);return a.length===6?[o>>16&255,o>>8&255,o&255,1]:[parseInt(a.slice(0,2),16),parseInt(a.slice(2,4),16),parseInt(a.slice(4,6),16),parseInt(a.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let a=r[1].split(/[\s,/]+/).filter(Boolean);if(a.length<3)return null;let o=a.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=a[3]!==void 0?a[3].endsWith("%")?parseFloat(a[3])/100:parseFloat(a[3]):1;return o.some(s=>Number.isNaN(s))?null:[o[0],o[1],o[2],Number.isNaN(i)?1:i]}return null}function wt(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Xe(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Re(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yn(e){return .2126*Re(e[0])+.7152*Re(e[1])+.0722*Re(e[2])}function Ct(e,t,n){let r=typeof e=="string"?be(e):e,a=typeof t=="string"?be(t):t;if(!r||!a)return 0;let o=n?typeof n=="string"?be(n):n:null;a[3]<1&&o&&(a=Xe(a,o));let i=r[3]<1?Xe(r,a):r,s=yn(i),l=yn(a);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function no(e){return[Re(e[0]),Re(e[1]),Re(e[2])]}function vt(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function xn(e){let[t,n,r]=no(e),a=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*a+.793617785*o-.0040720468*i,1.9779984951*a-2.428592205*o+.4505937099*i,.0259040371*a+.7827717662*o-.808675766*i]}function ro([e,t,n],r){let a=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[vt(4.0767416621*a-3.3077115913*o+.2309699292*i),vt(-1.2684380046*a+2.6097574011*o-.3413193965*i),vt(-.0041960863*a-.7034186147*o+1.707614701*i),r]}function $t(e,t,n){let r=be(e),a=be(t);if(!r||!a)return e;let o=xn(r),i=xn(a),s=Math.max(0,Math.min(1,n));return wt(ro([o[0]*s+i[0]*(1-s),o[1]*s+i[1]*(1-s),o[2]*s+i[2]*(1-s)],r[3]*s+a[3]*(1-s)))}function Mt(e,t,n){let r=t[0],a=-1;for(let o of t){let i=Ct(o,e,n);i>a&&(a=i,r=o)}return r}var Tt=S(L(),1),Je=(0,ae.createContext)({theme:pe,cssVars:!0});function oo(e,t=pe){return e?typeof e=="string"?ht[e]??t:bt(t,e):t}function Qe(e){let t=(0,ae.useContext)(Je),n=e.base?ht[e.base]:t.theme,r=(0,ae.useMemo)(()=>oo(e.theme,n),[e.theme,n]),a=e.cssVars??t.cssVars,o=e.locale??t.locale,i=(0,ae.useMemo)(()=>({theme:r,cssVars:a,locale:o}),[r,a,o]),s=(0,ae.useMemo)(()=>pt(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Tt.jsx)(Je.Provider,{value:i,children:(0,Tt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ao=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Ze(e){return ao.has(e)}function io(e,t){let n=r=>t?`var(${gt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,a="neutral")=>r?Ze(r)?n(r):r:n(a),raw:(r,a="neutral")=>r?Ze(r)?e[r]:r:e[a],mix:(r,a,o)=>{let i=Math.round(Math.max(0,Math.min(1,o))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(a)})`:$t(e[r],e[a],o)}}}function fe(e){let t=(0,ae.useContext)(Je);return(0,ae.useMemo)(()=>{let n=bt(t.theme,e);return io(n,t.cssVars)},[t.theme,t.cssVars,e])}function ie(e){let t=(0,ae.useContext)(Je);return e??t.locale??de}function vn(e){return e?pt(e):{}}var et=S(H(),1),St=(0,et.createContext)(void 0);function wn(e){let t=(0,et.useContext)(St);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var k=S(L(),1),so={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},lo={en:so,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var co={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},At=e=>lo[W(ie(e))];function Rt(e){let t=fe(e.theme),n=At(e.locale),[r,a]=(0,tt.useState)(!1),o=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(p=>!s.has(p.label)).length,c=(0,k.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((p,u)=>{let m=!s.has(p.label),g=m&&l===1,d=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(uo,{p:t,item:p,off:!m}),(0,k.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:p.label})]});return(0,k.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:o,color:t.paint("muted"),lineHeight:1.3},children:i?(0,k.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":g||void 0,onClick:()=>{g||(i(p.label),a(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:g?"default":void 0},children:d}):d},u)})});return i?(0,k.jsxs)(k.Fragment,{children:[c,(0,k.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:co,children:r?n.shown(l,e.items.length):""})]}):c}function uo({p:e,item:t,off:n}){let r=t.color?Ze(t.color)?e.paint(t.color):t.color:e.paint("neutral"),a=t.shape??"square";return a==="line"||a==="dash"?(0,k.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,k.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:a==="dash"?"3 2":void 0,strokeLinecap:"round"}),a==="line"?(0,k.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,k.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:a==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function mo(e){let t=fe(e.theme),n=on(e.level,W(ie(e.locale)));return(0,k.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function fo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,k.jsxs)(k.Fragment,{children:[e.slice(0,r),(0,k.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Cn(e){let t=fe(e.theme),n=At(e.locale),[r,a]=(0,tt.useState)(0);le(()=>Le(),[]);let o=()=>{a(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,k.jsx)(Rt,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,p=e.source!==void 0||e.note!==void 0?(0,k.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,k.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,k.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,k.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,k.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,k.jsx)(mo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,k.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,k.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,k.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:l}):null,(0,k.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:fo(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,k.jsx)("button",{type:"button",className:"ztd-btn",onClick:o,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,k.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,k.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,k.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,k.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,k.jsx)("span",{}),i]}):null]}),(0,k.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,k.jsx)(St.Provider,{value:r,children:(0,k.jsx)(Ke.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),p?(0,k.jsxs)(k.Fragment,{children:[p,u]}):u]})}function Nt(e){let t=fe(e.theme),n=At(e.locale),r=e.height??220;if(le(()=>Le(),[]),e.error){let a=typeof e.error=="string"?e.error:e.error.message;return(0,k.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,k.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,k.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,k.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:a}),e.onRetry?(0,k.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,k.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((a,o)=>(0,k.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${a*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${o*90}ms`}},o))}):e.empty?(0,k.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,k.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,k.jsx)(k.Fragment,{children:e.children})}function ye(e,t,n,r,a="max"){let o=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")o.add(0);else if(c==="last")o.add(i-1);else if(c==="max"||c==="min"){let p=-1,u=c==="max"?-1/0:1/0;r.forEach((m,g)=>{Number.isFinite(m)&&(c==="max"?m>u:m<u)&&(u=m,p=g)}),p>=0&&o.add(p)}}};if(e==null)return s(a),o;if(typeof e=="function")return t.forEach((c,p)=>{p<i&&c!==null&&c!==void 0&&e(c,p)&&o.add(p)}),o;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&o.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((p,u)=>{p===c&&o.add(u)});return o}function ho(e,t,n){let r=be(e),a=be(t);return!r||!a?e:wt(Xe([r[0],r[1],r[2],n],a))}function go(e,t){let n=Mt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ct(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Mt(t,["#FFFFFF","#000000"])}function Ee(e,t){let n=new Array(e),r=[];for(let o=0;o<e;o++)t.has(o)?n[o]="accent":r.push(o);let a=r.length;return r.forEach((o,i)=>{a===1?n[o]="neutral":i===0?n[o]="ink":i===a-1?n[o]="neutral":n[o]="neutralStrong"}),n}function $n(e,t){return Ee(e+1,t).slice(0,e)}function po(e,t,n=.1,r="accent"){let a=Math.max(0,Math.min(1,t)),o=n+(1-n)*a,i=ho(e.theme[r],e.theme.panel,o);return{fill:e.paint(r),opacity:o,text:go(e,i),raw:i}}function Pt(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,a=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*a/(t.steps-1)}return n}function Ft(e,t,n,r){let a=Pt(t,r);return po(e,Math.abs(a),n,a<0?"neutralStrong":"accent")}function Mn(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}function Tn(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function bo(e,t){if(e==null||typeof e!="object")return;let n=e;if(Tn(n,t))return n[t];if(t.includes(".")){let r=n;for(let a of t.split(".")){if(r===null||typeof r!="object"||!Tn(r,a))return;r=r[a]}return r}}function _e(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let a=Number(r.replace(/,/g,""));return Number.isFinite(a)?n?-a:a:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function Sn(e,t){if(typeof e=="function")return e;let n=e??t;return r=>bo(r,n)}function nt(e,t){let n=Sn(e,t);return(r,a)=>_e(n(r,a))}function $e(e,t){let n=Sn(e,t);return(r,a)=>{let o=n(r,a);return o==null?"":o instanceof Date?new Date(o.getTime()-o.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(o)}}function Ne(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var ne=S(H(),1);function yo(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
+ `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),a=l=>r.split(l).length-1,o=[","," ",";","|"],i=",",s=0;for(let l of o){let c=a(l);c>s&&(s=c,i=l)}return i}var xo=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function An(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(xo.test(t)||/^[-+]?\.\d+$/.test(t)){let n=_e(t);if(Number.isFinite(n))return n}return t}function Me(e,t={}){let{typed:n=!0,header:r=!0}=t,a=e.replace(/^\uFEFF/,"");if(!a.trim())return[];let o=t.delimiter??yo(a),i=[],s=[],l="",c=!1;for(let d=0;d<a.length;d++){let f=a[d];c?f==='"'?a[d+1]==='"'?(l+='"',d++):c=!1:l+=f:f==='"'&&!l.trim()?(c=!0,l=""):f===o?(s.push(l),l=""):f===`
24
+ `||f==="\r"?(f==="\r"&&a[d+1]===`
25
+ `&&d++,s.push(l),i.push(s),s=[],l=""):l+=f}(l!==""||s.length)&&(s.push(l),i.push(s));let p=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!p.length)return[];let u=d=>n?An(d):d;if(!r)return p.map(d=>Object.fromEntries(d.map((f,y)=>[String(y),u(f)])));let m=[],g=new Set;return p[0].forEach((d,f)=>{let y=d.trim()||`col${f+1}`,x=y;for(let v=2;g.has(x);v++)x=`${y}_${v}`;g.add(x),m.push(x)}),p.slice(1).map(d=>Object.fromEntries(m.map((f,y)=>[f,u(d[y]??"")])))}function Dt(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,a=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(a.map((s,l)=>[s,r&&typeof i[l]=="string"?An(i[l]):i[l]??null])))}function ko(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,a=Object.values(e);if(a.length&&a.every(o=>Array.isArray(o))){let o=Object.keys(e),i=Math.max(...a.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(o.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([o,i])=>({[n]:o,[r]:i}))}function Rn(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function xe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return xe(JSON.parse(t))}catch{}return Me(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Dt(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?xe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Dt(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?xe(t.rows):Array.isArray(t.values)?Dt(t.values):Array.isArray(t.items)?xe(t.items):Array.isArray(t.results)?xe(t.results):ko(t)}return[]}function Nn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=o=>{try{return JSON.stringify(o)}catch{return String(o)}};if(t<=300)return n(e);let r=Math.ceil(t/60),a=[];for(let o=0;o<t;o+=r)a.push(e[o]);return a.push(e[t-1]),`${t}:${n(a)}`}async function vo(e,t="auto",n="",r){let a=e.headers.get("content-type")??"",o=await e.text();if(t==="text")return o;if(a.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(o))throw new Error(W(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Me(o);if(t==="json"||a.includes("json"))return JSON.parse(o);if(a.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return Me(o);let i=o.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Me(o)}async function wo(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let a=e instanceof Request?e.url:String(e),o=await fetch(e instanceof Request?e.clone():a,{...t.init,signal:n});if(!o.ok)throw new Error(`HTTP ${o.status}${o.statusText?` ${o.statusText}`:""}`);r=await vo(o,t.parse,a,t.locale)}return t.select&&(r=Rn(r,t.select)),t.transform?t.transform(r):xe(r)}function Pn(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:a=!0}=t,[o,i]=(0,ne.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ne.useState)(0),c=ie(t.locale),p=(0,ne.useRef)(t);p.current={...t,locale:c};let u=(0,ne.useRef)(e);u.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",g=t.deps??[],d=JSON.stringify(g.map(x=>typeof x=="object"?JSON.stringify(x):String(x))),f=(0,ne.useRef)(!1);(0,ne.useEffect)(()=>{let x=u.current;if(!x||!r){i(M=>M.status==="loading"?{...M,status:"idle"}:M);return}let v=new AbortController,A=!0;return f.current=!0,i(M=>({...M,data:a?M.data:[],status:"loading",error:null})),wo(x,{...p.current,signal:v.signal}).then(M=>{A&&i({data:M,status:"success",error:null,updatedAt:Date.now()})}).catch(M=>{!A||v.signal.aborted||i(T=>({...T,status:"error",error:M instanceof Error?M:new Error(String(M))}))}).finally(()=>{A&&(f.current=!1)}),()=>{A=!1,f.current=!1,v.abort()}},[m,r,s,d,a]),(0,ne.useEffect)(()=>{if(!n||!r)return;let x=setInterval(()=>{f.current||l(v=>v+1)},n);return()=>clearInterval(x)},[n,r]);let y=(0,ne.useCallback)(()=>l(x=>x+1),[]);return{data:o.data,status:o.status,loading:o.status==="loading",error:o.error,empty:o.status==="success"&&o.data.length===0,updatedAt:o.updatedAt,reload:y}}var Et=S(L(),1),Co=["csv","svg","png"],$o=/^[=+\-@\t\r\n=+-@]/,Mo=/var\(|color-mix\(/;function Fn(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?fn(e.getTime()):String(e);return`"${($o.test(t)&&!Number.isFinite(_e(t))?`'${t}`:t).replace(/"/g,'""')}"`}function To(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function So(e,t){return`\uFEFF${[t.map(Fn),...e.map(r=>t.map(a=>Fn(r[a])))].map(r=>r.join(",")).join(`\r
26
+ `)}\r
27
+ `}function Ao(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Lt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Dn=2,ke=16;function Ln(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[a,o,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${a}, ${o}, ${i})`:`rgba(${a}, ${o}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function En(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,a]of Object.entries(t))n.setAttribute(r,String(a));return n}function _n(e,t,n){let r=e.closest(".ztd-card"),a=r?.querySelector("svg.ztd-svg");if(!r||!a)return null;let{width:o,height:i}=a.viewBox.baseVal,[s,l]=[o+ke*2,i+ke*2],c=a.cloneNode(!0),p=c.querySelectorAll("*"),u=new Map;a.querySelectorAll("*").forEach((d,f)=>{let y;for(let x of Array.from(d.attributes)){if(!Mo.test(x.value))continue;let v=(y??(y=getComputedStyle(d))).getPropertyValue(x.name);v&&p[f].setAttribute(x.name,Ln(v,u))}}),c.removeAttribute("style");for(let[d,f]of Object.entries({viewBox:`${-ke} ${-ke} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(a).fontFamily}))c.setAttribute(d,String(f));let m=Ln(getComputedStyle(r).backgroundColor,u),g=a.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(En("rect",{x:-ke,y:-ke,width:s,height:l,fill:m}),d),g&&c.insertBefore(En("image",{href:g.toDataURL(),width:o,height:i}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:o,vh:i,bg:m,canvas:g}}function Ro(e,t){let n=_n(e,Dn,!1);if(!n)return;let r=Dn,a=document.createElement("canvas");a.width=Math.ceil(n.w*r),a.height=Math.ceil(n.h*r);let o=a.getContext("2d");if(!o)return;o.fillStyle=n.bg,o.fillRect(0,0,a.width,a.height),n.canvas&&o.drawImage(n.canvas,ke*r,ke*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{o.drawImage(s,0,0,a.width,a.height),URL.revokeObjectURL(i),a.toBlob(l=>l&&Lt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function In(e){let t=fe(e.theme),n=W(ie(e.locale))==="ko",r=Ao(e.filename),a=(o,i)=>{if(o==="csv")return Lt(new Blob([So(e.data,e.columns?.length?e.columns:To(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(o==="png")return Ro(i,r);let s=_n(i,1,!0);s&&Lt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Et.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Co.filter(o=>!e.formats||e.formats.includes(o)).map(o=>{let i=o.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Et.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>a(o,l.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},o)})})}var Bn=S(L(),1);function On(e,t=de){let n=qe(void 0,t),r=e.split(`
28
+ `),a=(o,i)=>{if(i==="label")return o.label;if(i==="value")return o.formatted??(o.value===null?null:n(o.value));if(i==="series")return o.series??null;let s=o.datum&&typeof o.datum=="object"?o.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?pn(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return o=>{let i=[];for(let s of r){let l=!1,c=s.replace(hn,(p,u)=>a(o,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Bn.jsx)("div",{children:s},l)):null}}var h=(e,t,n,r,a={})=>({name:e,type:t,required:n,description:r,...a}),se=h("label","string",!0,"Item name field"),Y=h("value","number",!0,"Value field"),No=[se,Y],Po=[se,Y],Fo=[h("label","string",!0,"Stage name"),h("value","number",!0,"Users at the stage")],Do=[se,Y],Lo=[h("label","string",!0,"Leaf (lowest level) name"),Y,h("group","string",!1,"Parent group field")],Eo=[h("label","string",!0,"Leaf name"),Y,h("group","string",!1,"Parent group field")],_o=[se,h("value","number",!0,"Change (total rows may omit it)"),h("type","string",!1,'"total" makes a total bar')],Io=[se,Y],Oo=[h("x","string",!0,"Column field"),h("series","string",!0,"Stacked series field"),Y],Bo=[h("x","string",!0,"Column field"),h("y","string",!0,"Row field"),Y],zo=[h("axis","string",!0,"Metric (axis) field"),h("value","number",!0,"Value field",{multi:!0}),h("series","string",!1,"Series field")],Ho=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("size","number",!1,"Circle size"),h("label","string",!1,"Name")],Hn=h("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Vo=[h("x","any",!0,"x field (date, number or category)"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables)"),h("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Hn],jo=[h("x","any",!0,"x field"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Hn],Wo=[h("x","any",!0,"x field"),h("y","number",!0,"y field",{multi:!0}),h("series","string",!1,"Series field")],Ko=[h("x","string",!0,"Category field"),h("y","number",!0,"Value field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],Go=[se,Y],Uo=[h("value","number",!0,"Value field",{prop:"valueKey"}),h("target","number",!1,"Target field",{prop:"targetKey"})],Yo=[se,h("value","number",!0,"Actual value field"),h("target","number",!1,"Target field")],qo=[h("x","any",!1,"x field"),h("y","number",!0,"y field")],Xo=[se,h("x","string",!1,"Period field (long tables)"),h("value","number",!1,"Value field (long tables)")],Jo=[se,h("start","number",!0,"Before value"),h("end","number",!0,"After value")],Zo=[se,Y],Qo=[h("value","number",!0,"Value field"),h("group","string",!1,"Group (row) field"),h("label","string",!1,"Dot name")],ea=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],ta=[h("source","string",!0,"Source node"),h("target","string",!0,"Target node"),Y],na=[h("source","string",!0,"Sending group"),h("target","string",!0,"Receiving group"),Y],ra=[h("date","date",!0,"Date field"),Y],oa=[h("x","any",!0,"Period field"),h("series","string",!0,"Item field"),h("rank","number",!1,"Rank field (1 is first)"),h("value","number",!1,"Value field (instead of rank, largest is first)")],aa=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],ia=[h("label","string",!1,"Row name field")],sa=[h("x","date",!0,"Date (period) field"),h("open","number",!0,"Open price field"),h("high","number",!0,"High price field"),h("low","number",!0,"Low price field"),h("close","number",!0,"Close price field"),h("volume","number",!1,"Volume field")],la=[se,Y],ca=[h("x","any",!0,"Period field (date or category)"),h("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables, back row only)"),h("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],ua=[h("value","number",!1,"Sample value field (raw rows)"),h("group","string",!1,"Group field. Up to 2 groups overlap"),h("x0","number",!1,"Bin start (pre-binned rows)"),h("x1","number",!1,"Bin end (pre-binned rows)"),h("count","number",!1,"Samples in the bin (pre-binned rows)")],ma=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("series","string",!1,"Series field (one color per series)"),h("label","string",!1,"Name")],zn={pie:No,donut:Po,funnel:Fo,waffle:Do,treemap:Lo,sunburst:Eo,waterfall:_o,pareto:Io,marimekko:Oo,heatmap:Bo,radar:zo,bubble:Ho,line:Vo,area:jo,stream:Wo,bar:Ko,radialBar:Go,gauge:Uo,bullet:Yo,sparkline:qo,slope:Xo,dumbbell:Jo,lollipop:Zo,beeswarm:Qo,ridgeline:ea,sankey:ta,chord:na,calendar:ra,bump:oa,box:aa,parallel:ia,candlestick:sa,segmented:la,skyline:ca,histogram:ua,scatter:ma},Pe={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"}};function Vn(e,t){return t==="ko"?e.nameKo:e.name}function jn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var _t=["line","area","bar","scatter"];function It(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function Wn(e,t,n){return _t.includes(e)&&!It(e,t,n).length}function Kn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var da={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram"};function rt(e){let t=zn[e]?e:da[e]??Object.keys(Pe).find(n=>n.toLowerCase()===e.toLowerCase()||Pe[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Pe[t]))return{type:t,component:Pe[t].component,name:Pe[t].name,nameKo:Pe[t].nameKo,encoding:zn[t]}}function Gn(e){let t=new Set,n=o=>{Array.isArray(o)?o.forEach(n):typeof o=="string"&&o&&t.add(o)},r=e.encoding??{};for(let o of rt(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[o]);let a=e.options??{};for(let o of["dimensions","start","end","ranges"])n(a[o]);return[...t]}var fa=Math.PI*2;function ot(e,t,n){return e<t?t:e>n?n:e}function Un(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function I(e){return Math.round(e*100)/100}function Ot(e,t,n,r,a){if(n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),n<=.01||r<=.01)return"";let o=typeof a=="number"?{tl:a,tr:a,br:a,bl:a}:a,i=Math.min(n,r)/2,s=ot(o.tl??0,0,i),l=ot(o.tr??0,0,i),c=ot(o.br??0,0,i),p=ot(o.bl??0,0,i);return`M${I(e+s)},${I(t)}H${I(e+n-l)}`+(l?`A${I(l)},${I(l)} 0 0 1 ${I(e+n)},${I(t+l)}`:"")+`V${I(t+r-c)}`+(c?`A${I(c)},${I(c)} 0 0 1 ${I(e+n-c)},${I(t+r)}`:"")+`H${I(e+p)}`+(p?`A${I(p)},${I(p)} 0 0 1 ${I(e)},${I(t+r-p)}`:"")+`V${I(t+s)}`+(s?`A${I(s)},${I(s)} 0 0 1 ${I(e+s)},${I(t)}`:"")+"Z"}function Yn(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return Me(t.csv)}return null}var J=S(H(),1);var F=S(L(),1),at=60;var qn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Xn(e){let{c:t,events:n}=e,r=(0,J.useId)().replace(/:/g,""),a=`${r}t`,o=`${r}d`;t.events.current=n,le(()=>{Le()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,J.useContext)(Ke),c=e.ariaLabel??l??e.kind,p=(0,J.useMemo)(()=>s?`${n.length}${n.slice(0,at).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),u=(0,J.useMemo)(()=>(0,F.jsx)(ha,{label:c,events:n,t:t.t}),[c,p,t.t]),m=(0,J.useRef)(null);(0,J.useEffect)(()=>{let w=()=>{m.current=null};return window.addEventListener("scroll",w,{capture:!0,passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w,{capture:!0}),window.removeEventListener("resize",w)}},[]),(0,J.useEffect)(()=>{m.current=null},[t.width,t.height]);let g=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let _=t.active,j;switch(w.key){case"ArrowRight":case"ArrowDown":j=_===null?0:(_+1)%i;break;case"ArrowLeft":case"ArrowUp":j=_===null?i-1:(_-1+i)%i;break;case"Home":j=0;break;case"End":j=i-1;break;case"Escape":if(_===null)return;j=null;break;case"Enter":case" ":_!==null&&(w.preventDefault(),t.click(_));return;default:return}w.preventDefault(),t.setActive(j,"keyboard")},{via:d,node:f,setActive:y}=t;(0,J.useEffect)(()=>{if(d!=="touch"||!f)return;let w=_=>{f.contains(_.target)||y(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[d,f,y]);let x=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,A=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,M=typeof e.renderTip=="function"&&x?e.renderTip(x):null,T=e.announce??(t.via==="keyboard"&&x?`${x.label}${x.series?` ${x.series}`:""}: ${x.formatted??x.value??""} (${(t.active??0)+1}/${i})`:""),E;if(v){let w=v.x*A,_=t.width*A,j=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(_-w-4).toFixed(1)}px - 100%))`,Se=v.y<64;E={position:"absolute",left:w,top:v.y*A,transform:`translate(${j}, ${Se?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*A-8)}}let U=w=>{m.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},ee=w=>w?_=>{let j=m.current??(m.current=_.currentTarget.getBoundingClientRect());j.width&&w((_.clientX-j.left)/j.width*t.width,(_.clientY-j.top)/j.height*t.height,_)}:void 0,V=ee(e.onPointerMove),R=ee(e.onPointerDown),C=V||R?w=>{w.pointerType==="touch"&&V?.(w),R?.(w)}:void 0,N=ee(e.onPointerUp),q=vn(e.theme);return(0,F.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":o,tabIndex:s?0:void 0,onKeyDown:s?g:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:U,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...q,...e.style},children:[t.pending?null:e.underlay,(0,F.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${a} ${o}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:V,onPointerDown:C,onPointerUp:N,onPointerCancel:N,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,F.jsx)("title",{id:a,children:c}),(0,F.jsx)("desc",{id:o,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,F.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,v?(0,F.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:E,children:M??(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:v.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:v.title}),v.rows.map((w,_)=>(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,F.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(w.strong?"ink":"muted")},children:[w.color?(0,F.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:w.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,w.label]}),(0,F.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},_))]})}):null,(0,F.jsx)("span",{className:"ztd-sr",style:qn,"aria-live":"polite","aria-atomic":"true",children:T}),s&&!t.pending?u:null]})}function ha({label:e,events:t,t:n}){return(0,F.jsx)("div",{className:"ztd-sr",style:qn,children:(0,F.jsxs)("table",{children:[(0,F.jsx)("caption",{children:n.table(e)}),(0,F.jsxs)("tbody",{children:[t.slice(0,at).map((r,a)=>(0,F.jsxs)("tr",{children:[(0,F.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,F.jsx)("td",{children:r.formatted??r.value??""})]},a)),t.length>at?(0,F.jsx)("tr",{children:(0,F.jsx)("td",{colSpan:2,children:n.more(t.length-at)})}):null]})]})})}function Fe(e){let t=e.baseline??"central";return(0,F.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}function Zn(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Jn(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var it=new Map;function he(e,t,n=400){let r=String(e),a=`${r}|${n>=600?1:0}`,o=it.get(a);if(o===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Zn(c)?i+=Jn(c):s+=Jn(c)}o=i+s*(n>=600?1.07:1),it.size>5e3&&it.clear(),it.set(a,o)}return o*t}function Bt(e,t,n,r=400){if(e=e.trim(),he(e,n,r)<=t)return e;let a="…",o=0,i=e.length;for(;o<i;){let l=o+i+1>>1;he(e.slice(0,l)+a,n,r)<=t?o=l:i=l-1}o>0&&(e.charCodeAt(o-1)&64512)===55296&&o--;let s=e.slice(0,o).trimEnd();return s.length<(Zn(s.charCodeAt(0))?2:3)?"":s+a}var er=S(L(),1),Te=10.5;function Qn(e,t,n=Te,r=8,a=400,o){let i=t.length;if(i<=1)return t.map((u,m)=>m);let s=t.map(u=>he(u,n,a)),l=(u,m)=>Math.abs(e[m]-e[u])<(s[u]+s[m])/2+r,c=[];for(let u of o??[])c.some(m=>l(m,u))||c.push(u);let p=u=>!c.some(m=>l(m,u));for(let u=1;u<=i;u++){let m=c.slice();for(let g=0;g<i;g+=u)p(g)&&m.push(g);if(u>1&&(i-1)%u>u/2&&p(i-1)&&m.push(i-1),m.sort((g,d)=>g-d),m.every((g,d)=>!d||!l(m[d-1],g)))return m}return[0,i-1]}function tr(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}function zt(e){let t=[];for(let n=0;n<e.length;n++)Number.isFinite(e[n])&&t.push(e[n]);return t.length?(t.sort((n,r)=>n-r),t.length<24?t[t.length-1]:t[Math.min(t.length-1,Math.floor(t.length*.95))]||t[t.length-1]):1}function nr(e,t){let n=new Array(e),r=new Uint8Array(e),a=o=>{if(typeof o!="string"||o.length===0||o.length>9)return-1;let i=Number(o);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===o?i:-1};return new Proxy(n,{get(o,i,s){let l=a(i);return l>=0?(r[l]||(o[l]=t(l),r[l]=1),o[l]):Reflect.get(o,i,s)},has(o,i){return a(i)>=0||Reflect.has(o,i)}})}var z=S(H(),1);var Z=S(H(),1);function ga(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function pa(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function ar(e,t=!0){let[n,r]=(0,Z.useState)({visible:!t,near:!t});return(0,Z.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let a=new IntersectionObserver(i=>{let s=pa(i[i.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:ga(.25),rootMargin:"0px 0px -8% 0px"}),o=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return a.observe(e),o.observe(e),()=>{a.disconnect(),o.disconnect()}},[e,t]),n}function rr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function ir(e){let[t,n]=(0,Z.useState)(null),[r,a]=(0,Z.useState)(e??null),o=(0,Z.useCallback)(i=>{n(i),i&&e===void 0&&a(rr(i))},[e]);return le(()=>{if(e!==void 0){a(e);return}if(!t)return;let i=c=>a(p=>p!==null&&Math.abs(p-c)<.5?p:c),s=()=>i(rr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let p=c[c.length-1]?.contentRect;p?i(p.width>0?Math.round(p.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,o,r]}var ba=()=>()=>{};function st(){return(0,Z.useSyncExternalStore)(ba,()=>!0,()=>!1)}var or="(prefers-reduced-motion: reduce)";function sr(e="auto"){let[t,n]=(0,Z.useState)(()=>me&&typeof window.matchMedia=="function"?window.matchMedia(or).matches:!1);return(0,Z.useEffect)(()=>{if(e!=="auto"||!me||typeof window.matchMedia!="function")return;let r=window.matchMedia(or),a=()=>n(r.matches);return a(),r.addEventListener?.("change",a),()=>r.removeEventListener?.("change",a)},[e]),e===!0?!0:e===!1?!1:t}function lr(e,t){let n=fe(e.theme),[r,a,o]=ir(e.width),i=st(),s=e.width??(o||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,p=sr(e.reducedMotion??"auto"),u=e.animate!==!1&&!p&&me,m=ar(r,e.animateOnView!==!1&&u),g=ie(e.locale),d=W(g),f=(0,z.useMemo)(()=>qe(e.format,g,t.format),[e.format,g,t.format]),y=(0,z.useCallback)(B=>Ye(B,{locale:g}),[g]),x=(0,z.useMemo)(()=>un(f,e.unit),[f,e.unit]),v=(0,z.useMemo)(()=>Nn(e.data),[e.data]),[A,M]=(0,z.useState)(null),[T,E]=(0,z.useState)(null),U=(0,z.useRef)([]),ee=(0,z.useRef)(e.onHover);ee.current=e.onHover;let V=(0,z.useRef)(e.onClick);V.current=e.onClick;let R=(0,z.useRef)(null),C=(0,z.useRef)(null),N=(0,z.useRef)(null),q=(0,z.useCallback)((B,ce="pointer")=>{if(N.current!==B){N.current=B;let ze=B===null?null:U.current[B]??null;queueMicrotask(()=>ee.current?.(ze)),C.current?.(B)}R.current=B===null?null:ce,M(B),E(R.current)},[]),w=(0,z.useCallback)(B=>{R.current!=="keyboard"&&(R.current=B===null?null:"sync",M(B),E(R.current))},[]),_=(0,z.useCallback)(B=>{let ce=U.current[B];ce&&V.current?.(ce)},[]),j=wn(e.replayKey),Se=e.width!==void 0||(o??0)>0,Be={enabled:u,active:m.visible&&Se,near:m.near,replayKey:j,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},mt=(0,z.useCallback)((B,ce=1)=>A===null||A===B?ce:ce*.38,[A]);return{p:n,width:s,height:c,measured:Se,responsive:e.width===void 0,pending:me&&i&&e.width===void 0&&o===null,node:r,hydrated:i,ref:a,motion:Be,fv:x,fmt:f,pct:y,locale:g,lang:d,t:d==="ko"?rn:nn,active:A,via:T,setActive:q,click:_,events:U,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:mt,sig:v,description:e.description,reduced:p,publish:C,applySync:w}}var O=S(H(),1);function ya(e){return 1-Math.pow(1-e,3)}function xa(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function ka(e){return e==="easeInOut"?xa:e==="linear"?t=>t:ya}function va(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function De(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let a=r/(t-1)*(e.length-1),o=Math.floor(a),i=Math.min(e.length-1,o+1);n[r]=e[o]+(e[i]-e[o])*(a-o)}return n}function lt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],a=t[n];if(Number.isNaN(r)!==Number.isNaN(a)||Math.abs(r-a)>1e-6)return!1}return!0}function cr(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function ur(e,t,n,r){if(!t||!n||t.length!==n.length)return De(e,r);let a=[],o=0;for(let i=0;i<n.length;i++){let s=e.slice(o,o+t[i]);o+=t[i];for(let l of De(s,n[i]))a.push(l)}return a.length===r?a:De(e,r)}var ct=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let a=this.tracks.get(r.key);if(!a||a.exiting||!lt(a.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,a){let o=t.from??t.to,i=t.enter??o;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:o.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:a,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let a=this.tracks.get(r.key),o=this.make(r,r.to,0,0);a&&(o.order=a.order),o.done=!0,o.progress=1,n.set(r.key,o)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let a of t){let o=this.tracks.get(a.key),i=this.make(a,a.from??a.to,1/0,a.delay??0);o&&(i.order=o.order),r=Math.max(r,a.delay??0),n.set(a.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),cr(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=lt(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let a=new Set,o=0;for(let i of t){a.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(o*r,240):0;if(s){let c=i.to.length;s.from=ur(s.cur,s.parts,i.parts,c),s.vel=ur(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),cr(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=lt(s.from,s.to)&&s.vel.every(p=>Math.abs(p)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=lt(c.from,c.to),this.tracks.set(i.key,c)}o++}for(let i of this.tracks.values())a.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=De(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=ka(this.easing),a=this.duration/1e3,o=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=De(s.from,c)),s.vel.length!==c&&(s.vel=De(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let p;if(this.easing==="spring"){let u=Math.exp(-o*l),m=o*l>=8&&o*l<20,g=0;for(let d=0;d<c;d++){let f=s.from[d]-s.to[d],y=s.vel[d]+o*f;s.cur[d]=s.to[d]+(f+y*l)*u,s.curVel[d]=(s.vel[d]-o*y*l)*u,m&&g<.15&&(g=Math.max(g,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/o)))}p=o*l>=20||m&&g<.15,s.progress=Math.min(1,1-(1+o*l)*u)}else{let u=Math.min(1,l/a),m=r(u),g=va(this.easing,u)/a;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*m,s.curVel[d]=(s.to[d]-s.from[d])*g;p=u>=1,s.progress=m}if(p){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Ie=new Set,ut=0;function mr(e){ut=0;let t=Array.from(Ie);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ie.delete(n)}Ie.size&&typeof requestAnimationFrame<"u"&&(ut=requestAnimationFrame(mr))}function dr(e){return Ie.add(e),!ut&&typeof requestAnimationFrame<"u"&&(ut=requestAnimationFrame(mr)),()=>{Ie.delete(e)}}function wa(e){let t=new Map,n=!1;for(let r of e){let a=(t.get(r.key)??0)+1;t.set(r.key,a),a>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let a=(t.get(r.key)??0)+1;return t.set(r.key,a),a>1?{...r,key:`${r.key}#${a}`}:r})):e}function fr(e,t){let n=(0,O.useMemo)(()=>wa(e),[e]),{enabled:r,active:a,near:o=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:p=0}=t,u=(0,O.useRef)(null),m=(0,O.useRef)("init"),g=(0,O.useRef)(null),d=(0,O.useRef)(s),f=(0,O.useRef)(i),y=(0,O.useRef)(!1),x=(0,O.useRef)(0),[,v]=(0,O.useState)(0),A=(0,O.useRef)(null),M=(0,O.useRef)(!0);u.current||(u.current=new ct,u.current.configure(l,c),u.current.snap(n),g.current=n);let T=u.current;if(T.configure(l,c),g.current!==n){let C=m.current,N=!Object.is(d.current,s);T.sameTargets(n)?T.refreshData(n):!r||C==="init"?T.snap(n):C==="idle"?T.hold(n):C==="running"||N?T.update(n,Ue(),p):T.snap(n),g.current=n,d.current=s}let E=(0,O.useRef)(()=>!1);E.current=C=>{if(!M.current)return!1;let N=T.step(C);return!N&&m.current==="running"&&(m.current="done"),v(q=>(q+1)%1e9),N||(A.current=null),N};let U=(0,O.useCallback)(()=>{if(!me||A.current||!T.animating)return;let C=N=>E.current(N);A.current=dr(C)},[T]);le(()=>{let C=!Object.is(f.current,i);if(f.current=i,!r){(m.current!=="done"||T.animating)&&(T.snap(g.current??n),m.current="done",v(N=>N+1));return}m.current==="init"||C&&o?(T.hold(g.current??n),m.current="idle",y.current=!1,v(N=>N+1)):C&&(y.current=!0)},[r,i]),le(()=>{!r||!o||!y.current||(y.current=!1,T.hold(g.current??n),m.current="idle",v(C=>C+1))},[o,r]),(0,O.useEffect)(()=>{r&&a&&m.current==="idle"&&(T.start(Ue()),x.current+=1,m.current="running",U(),v(C=>C+1))},[r,a,i,T,U]),(0,O.useEffect)(()=>{T.animating&&U()}),(0,O.useEffect)(()=>(M.current=!0,()=>{M.current=!1,A.current?.(),A.current=null}),[]);let ee=Ue(),V=T.elapsed(ee),R=r&&m.current==="idle";return{items:T.items(),get:C=>T.get(C),elapsed:R?0:V,fade:(C,N=320)=>R?0:Number.isFinite(V)?Math.max(0,Math.min(1,(V-C)/N)):1,waiting:R,animating:T.animating,generation:x.current}}var Ca=S(H(),1);var gr=S(L(),1);var hr=e=>e?"neutralStrong":"accent";var ve=S(H(),1),br=S(L(),1);function pr(e){let t=(0,ve.useRef)(null),n=(0,ve.useRef)(new Map),[r,a]=(0,ve.useState)(0),{width:o,height:i,draw:s,progress:l,version:c,clipRight:p,manualClear:u}=e;return(0,ve.useEffect)(()=>{let m=t.current;if(!m)return;let g=Math.min(2,window.devicePixelRatio||1),d=Math.max(1,Math.round(o*g)),f=Math.max(1,Math.round(i*g));m.width!==d&&(m.width=d),m.height!==f&&(m.height=f);let y=m.getContext("2d");if(!y)return;y.setTransform(g,0,0,g,0,0),u||y.clearRect(0,0,o,i);let x=getComputedStyle(m),v=new Map;s(y,l,(M,T)=>{let E=v.get(M);return E===void 0&&(E=x.getPropertyValue(M).trim(),v.set(M,E)),E||T}),n.current=v},[o,i,s,l,c,u,r]),(0,ve.useEffect)(()=>{let m=t.current;if(!m||typeof matchMedia!="function")return;let g=new AbortController,d=()=>a(v=>v+1),f=()=>{let v=getComputedStyle(m);for(let[A,M]of n.current)if(v.getPropertyValue(A).trim()!==M)return d()},y=()=>{matchMedia(`(resolution: ${devicePixelRatio}dppx)`).addEventListener?.("change",()=>{y(),d()},{once:!0,signal:g.signal})};y(),matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change",f,{signal:g.signal});let x=new MutationObserver(f);for(let v=m.parentElement;v;v=v.parentElement)x.observe(v,{attributes:!0});return()=>{g.abort(),x.disconnect()}},[]),(0,br.jsx)("canvas",{ref:t,"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"100%",height:"auto",aspectRatio:`${o} / ${i}`,pointerEvents:"none",clipPath:p?`inset(0 ${(p/Math.max(1,o)*100).toFixed(3)}% 0 0)`:void 0}})}var Ht=S(L(),1);function yr(e,t,n,r){if(typeof e!="function")return ye(e,n,n,n.map(()=>0),"first");let a=new Map(n.map((i,s)=>[i,s])),o=new Set;return t.forEach((i,s)=>{let l=a.get(r(i,s));l!==void 0&&e(i,s)&&o.add(l)}),o}var $a=S(H(),1);var jt=S(L(),1),Ma={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,a)=>`${e} to ${t}, ${Ce(n,"candle")}. First open ${r}, last close ${a}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},xr={en:Ma,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,a)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${a}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},Vt=["ink","muted","dim"];function kr(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Vt.length)}var Q=S(H(),1);var G=S(L(),1),Ta={kind:"Heatmap",legend:["Less","More"],desc:(e,t,n,r)=>`${Ce(e,"row")} × ${Ce(t,"column")}, values from ${n} to ${r}`},Sa={en:Ta,ko:{kind:"히트맵",legend:["적음","많음"],desc:(e,t,n,r)=>`${e}행 × ${t}열, 값 ${n}에서 ${r}까지`}};function Wt(e){let t=lr(e,{height:b=>Math.max(180,Math.min(300,b*.48)),duration:600,stagger:0}),{p:n,width:r,height:a}=t,o=(0,Q.useMemo)(()=>{let b=$e(e.x,"x"),$=$e(e.y,"y"),P=nt(e.value,"value"),D=Ne(e.data.map((te,oe)=>b(te,oe))),K=Ne(e.data.map((te,oe)=>$(te,oe))),ge=new Map(D.map((te,oe)=>[te,oe])),re=new Map(K.map((te,oe)=>[te,oe])),X=new Float64Array(D.length*K.length).fill(NaN),ue=new Array(D.length*K.length).fill(null);e.data.forEach((te,oe)=>{let Gt=ge.get(b(te,oe)),Ut=re.get($(te,oe));if(Gt===void 0||Ut===void 0)return;let We=Ut*D.length+Gt,dt=P(te,oe);Number.isFinite(dt)&&(X[We]=Number.isFinite(X[We])?X[We]+dt:dt),ue[We]=te});let[Ae,je]=tr(X);return{xs:D,ys:K,vals:X,rows:ue,mn:Ae,mx:je}},[e.data,e.x,e.y,e.value]),i=o.xs.length,s=o.ys.length,l=i*s,c=t.hydrated&&l>(e.canvasThreshold??2500),p=e.legend===!1?0:20,u=Math.min(r*.3,Math.max(...o.ys.map(b=>he(b,Te,500)),10)+8),m=20,g=u+4,d=p,f=(r-g)/Math.max(1,i),y=(a-d-m)/Math.max(1,s),x=Math.min(f,y)>14?2.5:Math.min(f,y)>5?1:0,v=Math.min(n.theme.radiusMark,Math.min(f,y)/4),A=(0,Q.useMemo)(()=>zt(o.vals),[o.vals]),M=Math.max(1e-9,A-o.mn)||1,T=(0,Q.useMemo)(()=>Mn(e.colorReverse,e.colorCenter,e.colorSteps),[e.colorReverse,e.colorCenter,e.colorSteps]),E=T.center,U=(0,Q.useMemo)(()=>E===void 0?0:Math.max(1e-9,zt(Array.from(o.vals,b=>Math.abs(b-E)))),[o.vals,E]),ee=b=>Ft(n,b,.08,T),V=(0,Q.useMemo)(()=>{let b=Array.from({length:l},($,P)=>`${o.xs[P%i]}|${o.ys[Math.floor(P/i)]}`);return ye(e.highlight,o.rows,b,Array.from(o.vals),e.colorReverse?"min":"max")},[o,l,i,e.highlight,e.colorReverse]),R=(0,Q.useMemo)(()=>{let b=[];for(let $=0;$<l;$++){let P=o.vals[$];Number.isFinite(P)&&b.push({i:$,col:$%i,row:Math.floor($/i),value:P,t:E===void 0?Math.min(1,(P-o.mn)/M):Math.max(-1,Math.min(1,(P-E)/U)),datum:o.rows[$]})}return b},[o,l,i,M,E,U]),C=T.steps??5,N=t.motion.duration??600,q=(0,Q.useMemo)(()=>c?[{key:"__p",to:[1],from:[0],data:null}]:R.map(b=>({key:`h${b.i}`,to:[1],from:[0],delay:(b.col/Math.max(1,i-1)*.6+b.row/Math.max(1,s-1)*.4)*N*.9,data:b})),[R,c,i,s,N]),w=fr(q,t.motion),_=e.showValues??"auto",j=t.fmt(o.mx),Se=t.showLabels&&(_===!0||_==="auto"&&f>=he(j,10.5,600)+8&&y>=15),Be=t.fv,mt=(0,Q.useMemo)(()=>nr(R.length,b=>{let $=R[b];return{datum:$.datum,index:$.i,key:`${o.xs[$.col]}|${o.ys[$.row]}`,label:`${o.ys[$.row]} · ${o.xs[$.col]}`,value:$.value,formatted:Be($.value)}}),[R,o,Be]),B=(0,Q.useMemo)(()=>new Map(R.map((b,$)=>[b.i,$])),[R]),ce=(b,$)=>{let P=Math.floor((b-g)/f),D=Math.floor(($-d)/y);if(P<0||D<0||P>=i||D>=s)return null;let K=B.get(D*i+P);return K===void 0?null:K},ze=null;if(t.active!==null&&R[t.active]){let b=R[t.active];ze={x:g+b.col*f+f/2,y:d+b.row*y,title:`${o.ys[b.row]} · ${o.xs[b.col]}`,rows:[{label:t.t.value,value:t.fv(b.value),color:n.paint("accent")}]}}let Rr=c?w.get("__p")?.[0]??1:1,Nr=(0,Q.useCallback)((b,$,P)=>{let D=P("--ztd-accent",n.theme.accent),K=P("--ztd-neutral-strong",n.theme.neutralStrong),ge=D;b.fillStyle=D;for(let re of R){let X=re.col/Math.max(1,i-1)*.6+re.row/Math.max(1,s-1)*.4,ue=Math.max(0,Math.min(1,($*1.25-X)*4));if(ue<=0)continue;let Ae=Pt(re.t,T),je=Ae<0?K:D;je!==ge&&(b.fillStyle=ge=je),b.globalAlpha=(.08+.92*Math.min(1,Math.abs(Ae)))*ue,b.fillRect(g+re.col*f+x/2,d+re.row*y+x/2,Math.max(.5,f-x),Math.max(.5,y-x))}b.globalAlpha=1},[R,i,s,g,d,f,y,x,n.theme.accent,n.theme.neutralStrong,T]),Pr=(0,Q.useMemo)(()=>Qn(o.xs.map((b,$)=>g+$*f+f/2),o.xs,Te,6),[o.xs,g,f]),Fr=y>=11?o.ys.map((b,$)=>$):o.ys.map((b,$)=>$).filter(b=>b%Math.ceil(12/Math.max(1,y))===0),He=Sa[t.lang],Dr=e.description??`${He.kind}. ${He.desc(s,i,t.fv(o.mn),t.fv(o.mx))}.`,Ve=e.legendLabels??He.legend;return(0,G.jsxs)(Xn,{c:t,kind:He.kind,ariaLabel:e.ariaLabel,description:Dr,events:mt,tip:ze,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(b,$,P)=>{let D=ce(b,$);D!==t.active&&t.setActive(D,P.pointerType==="touch"?"touch":"pointer")},onKey:b=>{let $=b.key==="ArrowDown"?1:b.key==="ArrowUp"?-1:0,P=t.active===null?null:R[t.active];if(!$||!P)return!1;for(let D=P.row+$;D>=0&&D<s;D+=$){let K=B.get(D*i+P.col);if(K!==void 0){t.setActive(K,"keyboard");break}}return!0},underlay:c?(0,G.jsx)(pr,{width:r,height:a,draw:Nr,progress:Rr,version:t.sig}):void 0,children:[e.legend!==!1?(0,G.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:C},(b,$)=>{let P=Ft(n,E===void 0?$/(C-1):2*$/(C-1)-1,.08,T),D=r-C*14-he(Ve[1],10)-6+$*14;return(0,G.jsx)("rect",{x:D,y:3,width:12,height:9,rx:2,fill:P.fill,opacity:P.opacity},$)}),(0,G.jsx)(Fe,{x:r-C*14-he(Ve[1],10)-10,y:7.5,anchor:"end",size:10,fill:n.paint("muted"),children:Ve[0]}),(0,G.jsx)(Fe,{x:r,y:7.5,anchor:"end",size:10,fill:n.paint("muted"),children:Ve[1]})]}):null,c?t.active!==null&&R[t.active]?(()=>{let b=R[t.active];return(0,G.jsx)("rect",{x:g+b.col*f,y:d+b.row*y,width:f,height:y,fill:"none",stroke:n.paint("ink"),strokeWidth:1.5,pointerEvents:"none"})})():null:w.items.map(b=>{let $=b.data;if(!$)return null;let P=ee($.t),D=g+$.col*f+x/2,K=d+$.row*y+x/2,ge=Math.max(.5,f-x),re=Math.max(.5,y-x),X=B.get($.i)??-1,ue=V.has($.i);return(0,G.jsxs)("g",{opacity:b.v[0],children:[(0,G.jsx)("path",{d:Ot(D,K,ge,re,v),fill:P.fill,opacity:P.opacity*(t.active===null||t.active===X?1:.55),className:"ztd-mark",onPointerEnter:Ae=>t.setActive(X,Ae.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click(X)}),ue||t.active===X?(0,G.jsx)("path",{d:Ot(D-1,K-1,ge+2,re+2,v+1),fill:"none",stroke:n.paint("ink"),strokeWidth:ue&&t.active!==X?1.5:2,pointerEvents:"none"}):null,Se?(0,G.jsx)(Fe,{x:D+ge/2,y:K+re/2,anchor:"middle",size:10.5,weight:ue?800:600,fill:P.text,children:t.fmt($.value)}):null]},b.key)}),(0,G.jsxs)("g",{"aria-hidden":"true",children:[Fr.map(b=>(0,G.jsx)(Fe,{x:u,y:d+b*y+y/2,anchor:"end",size:Te,weight:500,fill:n.paint("muted"),children:Bt(o.ys[b],u-2,Te,500)},b)),Pr.map(b=>(0,G.jsx)(Fe,{x:g+b*f+f/2,y:a-m+12,anchor:"middle",size:Te,fill:n.paint("muted"),children:o.xs[b]},b))]})]})}var Aa=S(H(),1);var $r=S(L(),1),Ra={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ce(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Na={en:Ra,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},vr=(e,t)=>Na[e].other(t);function wr(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((o,i)=>({v:o.value,i})).sort((o,i)=>i.v-o.v).slice(0,Math.floor(t)).map(o=>o.i)),a=e.filter((o,i)=>!r.has(i));return{kept:e.filter((o,i)=>r.has(i)),other:n(a.length,Un(a.map(o=>o.value)))}}var Cr=e=>Number.isFinite(e)&&e>0?e:0;var we=S(L(),1);function Mr(e,t){let n=rt(e);return n?.type==="scatter"&&t?.size!==void 0?rt("bubble"):n}function Pa(e,t={}){let n={};for(let r of e.encoding){let a=t[r.name];a!==void 0&&(n[r.prop??r.name]=a)}return n}function Fa(e,t,n,r=!1){let a=Mr(e.type,e.encoding);if(!a||!t.length)return[];let o=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&_t.includes(a.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(m=>!l.has(m.label)),p=["pie","donut","waffle"];if(a.type==="donut"&&i.legend!=="none")return[];if(p.includes(a.type)){let u=$e(o.label,"label"),m=nt(o.value,"value"),g=a.type==="waffle",d=t.map((M,T)=>({r:M,label:u(M,T),value:g?m(M,T):Cr(m(M,T))})),{kept:f,other:y}=g?{kept:d,other:null}:wr(d,i.other,(M,T)=>({r:{},label:vr(W(n),M),value:T})),x=ye(s,f.map(M=>M.r),f.map(M=>M.label),f.map(M=>M.value),g?"first":"max"),v=y?[...f,y]:f,A=Ee(v.length,x);return v.map((M,T)=>({label:M.label,color:A[T]}))}if(a.type==="candlestick"){let u=kr(Array.isArray(i.ma)?i.ma:void 0,t.length),m=xr[W(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...u.map((g,d)=>({label:m.maLegend(g),color:Vt[d],shape:"line"}))]}if(a.type==="scatter"){if(typeof o.series!="string")return[];let u=$e(o.series,"series"),m=Ne(t.map((d,f)=>u(d,f)));if(m.length<2)return[];let g=$n(m.length,yr(s,t,m,u));return c(m.map((d,f)=>({label:d,color:g[f],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(a.type)){let u=[];if(Array.isArray(o.y))u=o.y;else if(typeof o.series=="string"){let f=$e(o.series,"series");u=Ne(t.map((y,x)=>f(y,x)))}let m=It(a.type,o,i);if(m.length){let f=Ee(u.length,ye(s,u,u,u.map(()=>0),"none")),y=u.length<2?[{label:String((Array.isArray(o.y)?o.y[0]:o.y)??"y"),color:"neutral"}]:u.map((x,v)=>({label:x,color:f[v]}));return[...c(y),...m.map((x,v)=>({label:x,color:hr(v),shape:"line"}))]}if(u.length<2)return[];let g=ye(s,u,u,u.map(()=>0),"first");if(a.type==="line"||a.type==="radar")return c(u.map((f,y)=>({label:f,color:g.has(y)?"accent":"neutralStrong",shape:a.type==="line"?"line":"square"})));let d=Ee(u.length,g);return c(u.map((f,y)=>({label:f,color:d[y]})))}return[]}function Tr(e,t){let{spec:n}=e,r=Mr(n.type,n.encoding),a=(0,Oe.useMemo)(()=>Yn(n.data),[n.data]),o=!a&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=jn(n,e.locale),s=ie(i),l=W(s),c=Pn(o?.url??null,{parse:o?.format??"auto",select:o?.select,init:e.fetchInit,locale:s}),p=Kn(n),u=(0,Oe.useMemo)(()=>p?On(p,s):void 0,[p,s]),m=n.options?.hidden,g=Array.isArray(m)?m.map(String):[],d=g.join(""),[f,y]=(0,Oe.useState)(null);if(!r)return(0,we.jsx)(Nt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let x=a??c.data,v=t[r.type],A={...n.options??{}},M={...Pa(r,n.encoding),...A,...u?{tooltip:u}:{},data:x,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},T=n.card?.legend==="toggle"&&Wn(r.type,n.encoding??{},A),E=f&&f.base===d?f.hidden:g;T&&(M.hidden=E);let U=C=>y(N=>{let q=N&&N.base===d?N.hidden:g;return{base:d,hidden:q.includes(C)?q.filter(w=>w!==C):[...q,C]}}),ee=M.height??220,V=o&&!x.length&&(c.loading||c.error||c.empty)?(0,we.jsx)(Nt,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:ee,locale:i}):(0,we.jsx)(v,{...M});if(n.card){let C=n.card,N=C.legend==="auto"||C.legend==="toggle"?Fa(n,x,s,T):C.legend,q=N?.length?T?(0,we.jsx)(Rt,{items:N,hidden:E,onToggle:U,locale:i}):N:void 0,w=C.download?(0,we.jsx)(In,{data:x,columns:Gn(n),filename:C.title??r.type,formats:Array.isArray(C.download)?C.download:void 0,locale:i}):void 0;V=(0,we.jsx)(Cn,{number:C.number,title:C.title??Vn(r,l),subtitle:C.subtitle,legend:q,actions:w,source:C.source||void 0,note:C.note||void 0,accent:C.accent,takeaway:C.takeaway,level:C.level,sample:C.sample,replay:C.replay!==!1,className:e.className,locale:i,children:V})}let R=e.theme??n.theme;return R&&(V=(0,we.jsx)(Qe,{theme:R,children:V})),V}function Da({cfg:e,components:t}){let n=st();return Tr({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function Ar(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let a=JSON.parse(n);(0,Sr.hydrateRoot)(r,(0,Kt.createElement)(Qe,{theme:a.theme,cssVars:!0},(0,Kt.createElement)(Da,{cfg:a,components:{[e]:t}})))}Ar("heatmap",Wt);})();