ztd-charts-cli 0.5.1 → 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.
- package/dist/api.js +1 -1
- package/dist/{chunk-QVXYPBAX.js → chunk-4K4P2AWW.js} +28 -16
- package/dist/cli.js +1 -1
- package/dist/client/area.js +28 -0
- package/dist/client/bar.js +28 -0
- package/dist/client/beeswarm.js +28 -0
- package/dist/client/box.js +28 -0
- package/dist/client/bubble.js +28 -0
- package/dist/client/bullet.js +28 -0
- package/dist/client/bump.js +28 -0
- package/dist/client/calendar.js +28 -0
- package/dist/client/candlestick.js +28 -0
- package/dist/client/chord.js +28 -0
- package/dist/client/donut.js +28 -0
- package/dist/client/dumbbell.js +28 -0
- package/dist/client/funnel.js +28 -0
- package/dist/client/gauge.js +28 -0
- package/dist/client/heatmap.js +28 -0
- package/dist/client/histogram.js +28 -0
- package/dist/client/line.js +28 -0
- package/dist/client/lollipop.js +28 -0
- package/dist/client/marimekko.js +28 -0
- package/dist/client/parallel.js +28 -0
- package/dist/client/pareto.js +28 -0
- package/dist/client/pie.js +28 -0
- package/dist/client/radar.js +28 -0
- package/dist/client/radialBar.js +28 -0
- package/dist/client/react.js +66 -0
- package/dist/client/ridgeline.js +28 -0
- package/dist/client/sankey.js +28 -0
- package/dist/client/scatter.js +28 -0
- package/dist/client/segmented.js +28 -0
- package/dist/client/skyline.js +28 -0
- package/dist/client/slope.js +28 -0
- package/dist/client/sparkline.js +28 -0
- package/dist/client/stream.js +28 -0
- package/dist/client/sunburst.js +28 -0
- package/dist/client/treemap.js +28 -0
- package/dist/client/waffle.js +28 -0
- package/dist/client/waterfall.js +28 -0
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var tr=Object.create;var kt=Object.defineProperty;var nr=Object.getOwnPropertyDescriptor;var rr=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty;var Ge=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ir=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rr(t))!ar.call(e,o)&&o!==n&&kt(e,o,{get:()=>t[o],enumerable:!(r=nr(t,o))||r.enumerable});return e};var T=(e,t,n)=>(n=e!=null?tr(or(e)):{},ir(t||!e||!e.__esModule?kt(n,"default",{value:e,enumerable:!0}):n,e));var V=Ge((na,vt)=>{vt.exports=globalThis.__ztdReact.react});var Ct=Ge((ra,wt)=>{wt.exports=globalThis.__ztdReact["react-dom/client"]});var N=Ge((ha,Gt)=>{Gt.exports=globalThis.__ztdReact["react/jsx-runtime"]});var xt=T(V(),1),Qn=T(Ct(),1);var $e=T(V(),1);var _e=T(V(),1);var $t=T(V(),1),Me=(0,$t.createContext)(void 0);var ur=T(V(),1);var sr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Tt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Mt='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',se={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:Tt,monoFamily:Mt,radius:18,radiusCode:14,radiusMark:4},lr={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:Tt,monoFamily:Mt,radius:18,radiusCode:14,radiusMark:4},Ue={dark:se,light:lr};function Ye(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function qe(e){let t={};for(let n of sr){let r=e[n];typeof r=="string"&&(t[Ye(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 Xe(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 cr=`
|
|
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,${se.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,${se.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${se.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 St=!1;function ke(){if(St||typeof document>"u"||(St=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=cr,document.head.appendChild(e)}var Se=T(V(),1),oe=typeof window<"u"&&typeof document<"u",ne=oe?Se.useLayoutEffect:Se.useEffect;function Ae(){return typeof performance<"u"?performance.now():Date.now()}function W(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Re(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var At={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},Rt={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var mr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],dr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function fr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function hr(e){return fr(mr,e)}function Nt(e,t){let n=hr(e);return{text:n?n[t]:e,...dr[n?.id??"basic"]}}var Q=T(V(),1);var Et=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),ae="en-US",Ft=new Map;function Je(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=Ft.get(r);return o||(o=new Intl.NumberFormat(e,n),Ft.set(r,o)),o}function Ze(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Qe(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ae,...r}=t;return Ze(Je(n,r).format(e))}var _t=e=>e!==0&&Math.abs(e)<.05,It=(e,t,n="")=>`${Qe(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ne(e,t={}){if(!Number.isFinite(e))return"-";if(_t(e)&&t.maximumFractionDigits===void 0)return It(e,t.locale??ae,"%");let n=Math.abs(e);return`${Qe(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function gr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=ae,...r}=t;if(W(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,l]=a[i],u=o/s,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),m=Math.round(u*10**h)/10**h;if(i>0&&m>=a[i-1][0]/s){i--;continue}return(e<0&&m!==0?"-":"")+Qe(m,{locale:n,...r,maximumFractionDigits:h})+l}}return Ze(Je(n,{notation:"compact",...r}).format(e))}var pr=(e,t=W(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Fe(e,t=ae,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Je(t,o);return l=>Number.isFinite(l)?`${i}${Ze(s.format(l))}${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=>Ne(o,{locale:t});case"ratio":return o=>Ne(o*100,{locale:t});case"compact":return o=>gr(o,{locale:t});case"currency":return r(pr(t));default:{let o=r({maximumFractionDigits:1});return a=>_t(a)?It(a,t):o(a)}}}function br(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var yr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var xr=["january","february","march","april","may","june","july","august","september","october","november","december"],Pt=e=>{let t=e.toLowerCase();return t.length<3?0:xr.findIndex(n=>n.startsWith(t))+1},Dt=e=>+e+(+e<30?2e3:1900);function Ot(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var kr=[/^(\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})일)?$/],vr=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Bt=/\{([^{}]+)\}/g;function wr(e,t){let n;for(let r of kr)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?[Dt(n[3]),+n[2],+n[1],1]:[Dt(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=vr.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=Pt(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=Pt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function zt(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(yr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return zt(`${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=wr(n,t);if(r)return br(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 Lt=new Map;function Ht(e,t={month:"short",day:"numeric"}){let n=zt(e);if(!n)return"-";let{locale:r=ae,...o}=t,a=r+JSON.stringify(o),i=Lt.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Lt.set(a,i)),i.format(n)}var Vt={white:"#ffffff",black:"#000000",transparent:"#00000000"};function jt(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Vt[t.toLowerCase()]&&(t=Vt[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 Cr(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 et(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $r(e){return[et(e[0]),et(e[1]),et(e[2])]}function tt(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 Wt(e){let[t,n,r]=$r(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 Tr([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[tt(4.0767416621*o-3.3077115913*a+.2309699292*i),tt(-1.2684380046*o+2.6097574011*a-.3413193965*i),tt(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Kt(e,t,n){let r=jt(e),o=jt(t);if(!r||!o)return e;let a=Wt(r),i=Wt(o),s=Math.max(0,Math.min(1,n));return Cr(Tr([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 nt=T(N(),1),Pe=(0,Q.createContext)({theme:se,cssVars:!0});function Mr(e,t=se){return e?typeof e=="string"?Ue[e]??t:Xe(t,e):t}function Le(e){let t=(0,Q.useContext)(Pe),n=e.base?Ue[e.base]:t.theme,r=(0,Q.useMemo)(()=>Mr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,Q.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,Q.useMemo)(()=>qe(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,nt.jsx)(Pe.Provider,{value:i,children:(0,nt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Sr=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function De(e){return Sr.has(e)}function Ar(e,t){let n=r=>t?`var(${Ye(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?De(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?De(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)})`:Kt(e[r],e[o],a)}}}function ie(e){let t=(0,Q.useContext)(Pe);return(0,Q.useMemo)(()=>{let n=Xe(t.theme,e);return Ar(n,t.cssVars)},[t.theme,t.cssVars,e])}function ee(e){let t=(0,Q.useContext)(Pe);return e??t.locale??ae}function Ut(e){return e?qe(e):{}}var Ee=T(V(),1),rt=(0,Ee.createContext)(void 0);function Yt(e){let t=(0,Ee.useContext)(rt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var y=T(N(),1),Rr={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`},Nr={en:Rr,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Fr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},ot=e=>Nr[W(ee(e))];function at(e){let t=ie(e.theme),n=ot(e.locale),[r,o]=(0,_e.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(h=>!s.has(h.label)).length,u=(0,y.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((h,m)=>{let g=!s.has(h.label),b=g&&l===1,d=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Pr,{p:t,item:h,off:!g}),(0,y.jsx)("span",{style:g?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,y.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,y.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":g,"aria-disabled":b||void 0,onClick:()=>{b||(i(h.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:d}):d},m)})});return i?(0,y.jsxs)(y.Fragment,{children:[u,(0,y.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Fr,children:r?n.shown(l,e.items.length):""})]}):u}function Pr({p:e,item:t,off:n}){let r=t.color?De(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,y.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,y.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,y.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,y.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 Dr(e){let t=ie(e.theme),n=Nt(e.level,W(ee(e.locale)));return(0,y.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 Lr(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,y.jsxs)(y.Fragment,{children:[e.slice(0,r),(0,y.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function qt(e){let t=ie(e.theme),n=ot(e.locale),[r,o]=(0,_e.useState)(0);ne(()=>ke(),[]);let a=()=>{o(g=>g+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,y.jsx)(at,{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,u=e.replay||e.onReplay,h=e.source!==void 0||e.note!==void 0?(0,y.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,m=e.takeaway!==void 0||e.level||e.sample?(0,y.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,y.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,y.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,y.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,y.jsx)(Dr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,y.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,y.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,y.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,y.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:Lr(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,y.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,y.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,y.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,y.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,y.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,y.jsx)("span",{}),i]}):null]}),(0,y.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,y.jsx)(rt.Provider,{value:r,children:(0,y.jsx)(Me.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,y.jsxs)(y.Fragment,{children:[h,m]}):m]})}function it(e){let t=ie(e.theme),n=ot(e.locale),r=e.height??220;if(ne(()=>ke(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,y.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,y.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,y.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,y.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,y.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,y.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,y.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,y.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,y.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,y.jsx)(y.Fragment,{children:e.children})}function le(e,t,n,r,o="max"){let a=new Set,i=n.length,s=u=>{if(i&&u!=="none"){if(u==="first")a.add(0);else if(u==="last")a.add(i-1);else if(u==="max"||u==="min"){let h=-1,m=u==="max"?-1/0:1/0;r.forEach((g,b)=>{Number.isFinite(g)&&(u==="max"?g>m:g<m)&&(m=g,h=b)}),h>=0&&a.add(h)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((u,h)=>{h<i&&u!==null&&u!==void 0&&e(u,h)&&a.add(h)}),a;let l=Array.isArray(e)?e:[e];for(let u of l)typeof u=="number"?u>=0&&u<i&&a.add(u):u==="max"||u==="min"||u==="first"||u==="last"||u==="none"?s(u):n.forEach((h,m)=>{h===u&&a.add(m)});return a}function Xt(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 ve(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 Jt(e,t){return ve(e+1,t).slice(0,e)}function Zt(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Er(e,t){if(e==null||typeof e!="object")return;let n=e;if(Zt(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Zt(r,o))return;r=r[o]}return r}}function we(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 Qt(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Er(r,n)}function ge(e,t){let n=Qt(e,t);return(r,o)=>we(n(r,o))}function pe(e,t){let n=Qt(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 st(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var Z=T(V(),1);function _r(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let u=e[l];if(u==='"')n=!n;else if(!n&&(u===`
|
|
23
|
+
`||u==="\r"))break;t.push(n?"":u)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let u=o(l);u>s&&(s=u,i=l)}return i}var Ir=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function en(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Ir.test(t)||/^[-+]?\.\d+$/.test(t)){let n=we(t);if(Number.isFinite(n))return n}return t}function fe(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??_r(o),i=[],s=[],l="",u=!1;for(let d=0;d<o.length;d++){let p=o[d];u?p==='"'?o[d+1]==='"'?(l+='"',d++):u=!1:l+=p:p==='"'&&!l.trim()?(u=!0,l=""):p===a?(s.push(l),l=""):p===`
|
|
24
|
+
`||p==="\r"?(p==="\r"&&o[d+1]===`
|
|
25
|
+
`&&d++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let h=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!h.length)return[];let m=d=>n?en(d):d;if(!r)return h.map(d=>Object.fromEntries(d.map((p,M)=>[String(M),m(p)])));let g=[],b=new Set;return h[0].forEach((d,p)=>{let M=d.trim()||`col${p+1}`,k=M;for(let w=2;b.has(k);w++)k=`${M}_${w}`;b.add(k),g.push(k)}),h.slice(1).map(d=>Object.fromEntries(g.map((p,M)=>[p,m(d[M]??"")])))}function lt(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,l)=>[s,r&&typeof i[l]=="string"?en(i[l]):i[l]??null])))}function Or(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,l)=>Object.fromEntries(a.map(u=>[u,e[u][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function tn(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 ue(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ue(JSON.parse(t))}catch{}return fe(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?lt(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)?ue(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?lt(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)?ue(t.rows):Array.isArray(t.values)?lt(t.values):Array.isArray(t.items)?ue(t.items):Array.isArray(t.results)?ue(t.results):Or(t)}return[]}function nn(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 Br(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(W(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return fe(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 fe(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):fe(a)}async function zr(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 Br(a,t.parse,o,t.locale)}return t.select&&(r=tn(r,t.select)),t.transform?t.transform(r):ue(r)}function rn(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Z.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Z.useState)(0),u=ee(t.locale),h=(0,Z.useRef)(t);h.current={...t,locale:u};let m=(0,Z.useRef)(e);m.current=e;let g=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",b=t.deps??[],d=JSON.stringify(b.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),p=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{let k=m.current;if(!k||!r){i(C=>C.status==="loading"?{...C,status:"idle"}:C);return}let w=new AbortController,R=!0;return p.current=!0,i(C=>({...C,data:o?C.data:[],status:"loading",error:null})),zr(k,{...h.current,signal:w.signal}).then(C=>{R&&i({data:C,status:"success",error:null,updatedAt:Date.now()})}).catch(C=>{!R||w.signal.aborted||i($=>({...$,status:"error",error:C instanceof Error?C:new Error(String(C))}))}).finally(()=>{R&&(p.current=!1)}),()=>{R=!1,p.current=!1,w.abort()}},[g,r,s,d,o]),(0,Z.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{p.current||l(w=>w+1)},n);return()=>clearInterval(k)},[n,r]);let M=(0,Z.useCallback)(()=>l(k=>k+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:M}}var ct=T(N(),1),Hr=["csv","svg","png"],Vr=/^[=+\-@\t\r\n=+-@]/,jr=/var\(|color-mix\(/;function on(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?Ot(e.getTime()):String(e);return`"${(Vr.test(t)&&!Number.isFinite(we(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Wr(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Kr(e,t){return`\uFEFF${[t.map(on),...e.map(r=>t.map(o=>on(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function Gr(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function ut(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var an=2,ce=16;function sn(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 ln(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 un(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,l]=[a+ce*2,i+ce*2],u=o.cloneNode(!0),h=u.querySelectorAll("*"),m=new Map;o.querySelectorAll("*").forEach((d,p)=>{let M;for(let k of Array.from(d.attributes)){if(!jr.test(k.value))continue;let w=(M??(M=getComputedStyle(d))).getPropertyValue(k.name);w&&h[p].setAttribute(k.name,sn(w,m))}}),u.removeAttribute("style");for(let[d,p]of Object.entries({viewBox:`${-ce} ${-ce} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(d,String(p));let g=sn(getComputedStyle(r).backgroundColor,m),b=o.parentElement?.querySelector("canvas")??null;if(n){let d=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(ln("rect",{x:-ce,y:-ce,width:s,height:l,fill:g}),d),b&&u.insertBefore(ln("image",{href:b.toDataURL(),width:a,height:i}),d)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:l,vw:a,vh:i,bg:g,canvas:b}}function Ur(e,t){let n=un(e,an,!1);if(!n)return;let r=an,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,ce*r,ce*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(l=>l&&ut(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function cn(e){let t=ie(e.theme),n=W(ee(e.locale))==="ko",r=Gr(e.filename),o=(a,i)=>{if(a==="csv")return ut(new Blob([Kr(e.data,e.columns?.length?e.columns:Wr(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Ur(i,r);let s=un(i,1,!0);s&&ut(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,ct.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Hr.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,ct.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,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},a)})})}var dn=T(N(),1);function mn(e,t=ae){let n=Fe(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?Ht(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,u=s.replace(Bt,(h,m)=>o(a,m.trim())??(l=!0,""));l||i.push(u)}return i.length?i.map((s,l)=>(0,dn.jsx)("div",{children:s},l)):null}}var f=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),te=f("label","string",!0,"Item name field"),G=f("value","number",!0,"Value field"),Yr=[te,G],qr=[te,G],Xr=[f("label","string",!0,"Stage name"),f("value","number",!0,"Users at the stage")],Jr=[te,G],Zr=[f("label","string",!0,"Leaf (lowest level) name"),G,f("group","string",!1,"Parent group field")],Qr=[f("label","string",!0,"Leaf name"),G,f("group","string",!1,"Parent group field")],eo=[te,f("value","number",!0,"Change (total rows may omit it)"),f("type","string",!1,'"total" makes a total bar')],to=[te,G],no=[f("x","string",!0,"Column field"),f("series","string",!0,"Stacked series field"),G],ro=[f("x","string",!0,"Column field"),f("y","string",!0,"Row field"),G],oo=[f("axis","string",!0,"Metric (axis) field"),f("value","number",!0,"Value field",{multi:!0}),f("series","string",!1,"Series field")],ao=[f("x","number",!0,"x value"),f("y","number",!0,"y value"),f("size","number",!1,"Circle size"),f("label","string",!1,"Name")],hn=f("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),io=[f("x","any",!0,"x field (date, number or category)"),f("y","number",!0,"y field. An array for wide tables",{multi:!0}),f("series","string",!1,"Series field (long tables)"),f("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),hn],so=[f("x","any",!0,"x field"),f("y","number",!0,"y field. An array for wide tables",{multi:!0}),f("series","string",!1,"Series field"),f("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],lo=[f("x","any",!0,"x field"),f("y","number",!0,"y field",{multi:!0}),f("series","string",!1,"Series field")],uo=[f("x","string",!0,"Category field"),f("y","number",!0,"Value field. An array for wide tables",{multi:!0}),f("series","string",!1,"Series field"),f("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})],co=[te,G],mo=[f("value","number",!0,"Value field",{prop:"valueKey"}),f("target","number",!1,"Target field",{prop:"targetKey"})],fo=[te,f("value","number",!0,"Actual value field"),f("target","number",!1,"Target field")],ho=[f("x","any",!1,"x field"),f("y","number",!0,"y field")],go=[te,f("x","string",!1,"Period field (long tables)"),f("value","number",!1,"Value field (long tables)")],po=[te,f("start","number",!0,"Before value"),f("end","number",!0,"After value")],bo=[te,G],yo=[f("value","number",!0,"Value field"),f("group","string",!1,"Group (row) field"),f("label","string",!1,"Dot name")],xo=[f("group","string",!0,"Group field"),f("value","number",!0,"Value field")],ko=[f("source","string",!0,"Source node"),f("target","string",!0,"Target node"),G],vo=[f("source","string",!0,"Sending group"),f("target","string",!0,"Receiving group"),G],wo=[f("date","date",!0,"Date field"),G],Co=[f("x","any",!0,"Period field"),f("series","string",!0,"Item field"),f("rank","number",!1,"Rank field (1 is first)"),f("value","number",!1,"Value field (instead of rank, largest is first)")],$o=[f("group","string",!0,"Group field"),f("value","number",!0,"Value field")],To=[f("label","string",!1,"Row name field")],Mo=[f("x","date",!0,"Date (period) field"),f("open","number",!0,"Open price field"),f("high","number",!0,"High price field"),f("low","number",!0,"Low price field"),f("close","number",!0,"Close price field"),f("volume","number",!1,"Volume field")],So=[te,G],Ao=[f("x","any",!0,"Period field (date or category)"),f("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),f("series","string",!1,"Series field (long tables, back row only)"),f("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Ro=[f("value","number",!1,"Sample value field (raw rows)"),f("group","string",!1,"Group field. Up to 2 groups overlap"),f("x0","number",!1,"Bin start (pre-binned rows)"),f("x1","number",!1,"Bin end (pre-binned rows)"),f("count","number",!1,"Samples in the bin (pre-binned rows)")],No=[f("x","number",!0,"x value"),f("y","number",!0,"y value"),f("series","string",!1,"Series field (one color per series)"),f("label","string",!1,"Name")],fn={pie:Yr,donut:qr,funnel:Xr,waffle:Jr,treemap:Zr,sunburst:Qr,waterfall:eo,pareto:to,marimekko:no,heatmap:ro,radar:oo,bubble:ao,line:io,area:so,stream:lo,bar:uo,radialBar:co,gauge:mo,bullet:fo,sparkline:ho,slope:go,dumbbell:po,lollipop:bo,beeswarm:yo,ridgeline:xo,sankey:ko,chord:vo,calendar:wo,bump:Co,box:$o,parallel:To,candlestick:Mo,segmented:So,skyline:Ao,histogram:Ro,scatter:No},be={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 gn(e,t){return t==="ko"?e.nameKo:e.name}function pn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var mt=["line","area","bar","scatter"];function dt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function bn(e,t,n){return mt.includes(e)&&!dt(e,t,n).length}function yn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Fo={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 Ie(e){let t=fn[e]?e:Fo[e]??Object.keys(be).find(n=>n.toLowerCase()===e.toLowerCase()||be[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!be[t]))return{type:t,component:be[t].component,name:be[t].name,nameKo:be[t].nameKo,encoding:fn[t]}}function xn(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 Ie(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 Po=Math.PI*2;function Oe(e,t,n){return e<t?t:e>n?n:e}function kn(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function P(e){return Math.round(e*100)/100}function ft(e,t,n,r,o){if(n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),n<=.01||r<=.01)return"";let a=typeof o=="number"?{tl:o,tr:o,br:o,bl:o}:o,i=Math.min(n,r)/2,s=Oe(a.tl??0,0,i),l=Oe(a.tr??0,0,i),u=Oe(a.br??0,0,i),h=Oe(a.bl??0,0,i);return`M${P(e+s)},${P(t)}H${P(e+n-l)}`+(l?`A${P(l)},${P(l)} 0 0 1 ${P(e+n)},${P(t+l)}`:"")+`V${P(t+r-u)}`+(u?`A${P(u)},${P(u)} 0 0 1 ${P(e+n-u)},${P(t+r)}`:"")+`H${P(e+h)}`+(h?`A${P(h)},${P(h)} 0 0 1 ${P(e)},${P(t+r-h)}`:"")+`V${P(t+s)}`+(s?`A${P(s)},${P(s)} 0 0 1 ${P(e+s)},${P(t)}`:"")+"Z"}function vn(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 fe(t.csv)}return null}var Y=T(V(),1);var A=T(N(),1),Be=60;var wn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Cn(e){let{c:t,events:n}=e,r=(0,Y.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ne(()=>{ke()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,Y.useContext)(Me),u=e.ariaLabel??l??e.kind,h=(0,Y.useMemo)(()=>s?`${n.length}${n.slice(0,Be).map(x=>`${x.label}${x.series??""}${x.formatted??x.value??""}`).join("")}`:"",[n,s]),m=(0,Y.useMemo)(()=>(0,A.jsx)(Do,{label:u,events:n,t:t.t}),[u,h,t.t]),g=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let x=()=>{g.current=null};return window.addEventListener("scroll",x,{capture:!0,passive:!0}),window.addEventListener("resize",x,{passive:!0}),()=>{window.removeEventListener("scroll",x,{capture:!0}),window.removeEventListener("resize",x)}},[]),(0,Y.useEffect)(()=>{g.current=null},[t.width,t.height]);let b=x=>{if(x.target!==x.currentTarget)return;if(e.onKey?.(x)){x.preventDefault();return}let S=t.active,_;switch(x.key){case"ArrowRight":case"ArrowDown":_=S===null?0:(S+1)%i;break;case"ArrowLeft":case"ArrowUp":_=S===null?i-1:(S-1+i)%i;break;case"Home":_=0;break;case"End":_=i-1;break;case"Escape":if(S===null)return;_=null;break;case"Enter":case" ":S!==null&&(x.preventDefault(),t.click(S));return;default:return}x.preventDefault(),t.setActive(_,"keyboard")},{via:d,node:p,setActive:M}=t;(0,Y.useEffect)(()=>{if(d!=="touch"||!p)return;let x=S=>{p.contains(S.target)||M(null)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[d,p,M]);let k=t.active!==null?n[t.active]:null,w=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,R=w&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,C=typeof e.renderTip=="function"&&k?e.renderTip(k):null,$=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${i})`:""),K;if(w){let x=w.x*R,S=t.width*R,_=`clamp(${(4-x).toFixed(1)}px, -50%, calc(${(S-x-4).toFixed(1)}px - 100%))`,re=w.y<64;K={position:"absolute",left:x,top:w.y*R,transform:`translate(${_}, ${re?"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*R-8)}}let O=x=>{g.current=null,x.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},J=x=>x?S=>{let _=g.current??(g.current=S.currentTarget.getBoundingClientRect());_.width&&x((S.clientX-_.left)/_.width*t.width,(S.clientY-_.top)/_.height*t.height,S)}:void 0,B=J(e.onPointerMove),j=J(e.onPointerDown),c=B||j?x=>{x.pointerType==="touch"&&B?.(x),j?.(x)}:void 0,v=J(e.onPointerUp),E=Ut(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":u,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?b:void 0,onBlur:x=>{t.via==="keyboard"&&!x.currentTarget.contains(x.relatedTarget)&&t.setActive(null)},onPointerLeave:O,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"),...E,...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:B,onPointerDown:c,onPointerUp:v,onPointerCancel:v,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,A.jsx)("title",{id:o,children:u}),(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,w?(0,A.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:K,children:C??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:w.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:w.title}),w.rows.map((x,S)=>(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(x.strong?"ink":"muted")},children:[x.color?(0,A.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:x.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,x.label]}),(0,A.jsx)("span",{style:{fontWeight:x.strong===!1?500:700},children:x.value})]},S))]})}):null,(0,A.jsx)("span",{className:"ztd-sr",style:wn,"aria-live":"polite","aria-atomic":"true",children:$}),s&&!t.pending?m:null]})}function Do({label:e,events:t,t:n}){return(0,A.jsx)("div",{className:"ztd-sr",style:wn,children:(0,A.jsxs)("table",{children:[(0,A.jsx)("caption",{children:n.table(e)}),(0,A.jsxs)("tbody",{children:[t.slice(0,Be).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>Be?(0,A.jsx)("tr",{children:(0,A.jsx)("td",{colSpan:2,children:n.more(t.length-Be)})}):null]})]})})}function ze(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 Tn(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function $n(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 He=new Map;function he(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=He.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);Tn(u)?i+=$n(u):s+=$n(u)}a=i+s*(n>=600?1.07:1),He.size>5e3&&He.clear(),He.set(o,a)}return a*t}function Lo(e,t,n,r=400){if(e=e.trim(),he(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;he(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(Tn(s.charCodeAt(0))?2:3)?"":s+o}function Mn(e,t,n,r=2,o=400){let a=[],i=e.trim();for(;a.length<r-1&&he(i,n,o)>t;){let s=i.lastIndexOf(" ");for(;s>0&&he(i.slice(0,s),n,o)>t;)s=i.lastIndexOf(" ",s-1);if(s<=0)break;a.push(i.slice(0,s).trimEnd()),i=i.slice(s+1).trimStart()}return[...a,Lo(i,t,n,o)]}var An=T(N(),1),Sn=10.5;function Rn(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function Nn(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.25]:[o*1.25,0];let i=Rn(a-o,n);return[Math.floor(o/i+1e-9)*i,Math.ceil(a/i-1e-9)*i]}function Eo(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=Rn(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,u=0;l<=o+a*1e-9&&u<200;l+=a,u++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function ye(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>Eo(n,r,l),s}var I=T(V(),1);var q=T(V(),1);function _o(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Io(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Dn(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=Io(i[i.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:_o(.25),rootMargin:"0px 0px -8% 0px"}),a=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 o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function Fn(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Ln(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(Fn(i))},[e]);return ne(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=u=>o(h=>h!==null&&Math.abs(h-u)<.5?h:u),s=()=>i(Fn(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let h=u[u.length-1]?.contentRect;h?i(h.width>0?Math.round(h.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var Oo=()=>()=>{};function Ve(){return(0,q.useSyncExternalStore)(Oo,()=>!0,()=>!1)}var Pn="(prefers-reduced-motion: reduce)";function En(e="auto"){let[t,n]=(0,q.useState)(()=>oe&&typeof window.matchMedia=="function"?window.matchMedia(Pn).matches:!1);return(0,q.useEffect)(()=>{if(e!=="auto"||!oe||typeof window.matchMedia!="function")return;let r=window.matchMedia(Pn),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function _n(e,t){let n=ie(e.theme),[r,o,a]=Ln(e.width),i=Ve(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,h=En(e.reducedMotion??"auto"),m=e.animate!==!1&&!h&&oe,g=Dn(r,e.animateOnView!==!1&&m),b=ee(e.locale),d=W(b),p=(0,I.useMemo)(()=>Fe(e.format,b,t.format),[e.format,b,t.format]),M=(0,I.useCallback)(D=>Ne(D,{locale:b}),[b]),k=(0,I.useMemo)(()=>Et(p,e.unit),[p,e.unit]),w=(0,I.useMemo)(()=>nn(e.data),[e.data]),[R,C]=(0,I.useState)(null),[$,K]=(0,I.useState)(null),O=(0,I.useRef)([]),J=(0,I.useRef)(e.onHover);J.current=e.onHover;let B=(0,I.useRef)(e.onClick);B.current=e.onClick;let j=(0,I.useRef)(null),c=(0,I.useRef)(null),v=(0,I.useRef)(null),E=(0,I.useCallback)((D,z="pointer")=>{if(v.current!==D){v.current=D;let H=D===null?null:O.current[D]??null;queueMicrotask(()=>J.current?.(H)),c.current?.(D)}j.current=D===null?null:z,C(D),K(j.current)},[]),x=(0,I.useCallback)(D=>{j.current!=="keyboard"&&(j.current=D===null?null:"sync",C(D),K(j.current))},[]),S=(0,I.useCallback)(D=>{let z=O.current[D];z&&B.current?.(z)},[]),_=Yt(e.replayKey),re=e.width!==void 0||(a??0)>0,F={enabled:m,active:g.visible&&re,near:g.near,replayKey:_,dataKey:w,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},U=(0,I.useCallback)((D,z=1)=>R===null||R===D?z:z*.38,[R]);return{p:n,width:s,height:u,measured:re,responsive:e.width===void 0,pending:oe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:F,fv:k,fmt:p,pct:M,locale:b,lang:d,t:d==="ko"?Rt:At,active:R,via:$,setActive:E,click:S,events:O,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:U,sig:w,description:e.description,reduced:h,publish:c,applySync:x}}var L=T(V(),1);function Bo(e){return 1-Math.pow(1-e,3)}function zo(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Ho(e){return e==="easeInOut"?zo:e==="linear"?t=>t:Bo}function Vo(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 xe(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 je(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 In(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 On(e,t,n,r){if(!t||!n||t.length!==n.length)return xe(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 l of xe(s,n[i]))o.push(l)}return o.length===r?o:xe(e,r)}var We=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||!je(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),In(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=je(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),l=r>0?Math.min(a*r,240):0;if(s){let u=i.to.length;s.from=On(s.cur,s.parts,i.parts,u),s.vel=On(s.curVel,s.parts,i.parts,u),s.parts=i.parts,s.to=i.to.slice(),In(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=je(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<1e-6),s.progress=s.done?1:0}else{let u=this.make(i,i.enter??i.from??i.to,n+l,0);u.done=je(u.from,u.to),this.tracks.set(i.key,u)}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=xe(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=Ho(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,u=s.to.length;if(s.from.length!==u&&(s.from=xe(s.from,u)),s.vel.length!==u&&(s.vel=xe(s.vel,u)),s.cur.length!==u&&(s.cur=new Array(u).fill(0),s.curVel=new Array(u).fill(0)),!(l>0)){for(let m=0;m<u;m++)s.cur[m]=s.from[m],s.curVel[m]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let m=Math.exp(-a*l),g=a*l>=8&&a*l<20,b=0;for(let d=0;d<u;d++){let p=s.from[d]-s.to[d],M=s.vel[d]+a*p;s.cur[d]=s.to[d]+(p+M*l)*m,s.curVel[d]=(s.vel[d]-a*M*l)*m,g&&b<.15&&(b=Math.max(b,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/a)))}h=a*l>=20||g&&b<.15,s.progress=Math.min(1,1-(1+a*l)*m)}else{let m=Math.min(1,l/o),g=r(m),b=Vo(this.easing,m)/o;for(let d=0;d<u;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*g,s.curVel[d]=(s.to[d]-s.from[d])*b;h=m>=1,s.progress=g}if(h){for(let m=0;m<u;m++)s.cur[m]=s.to[m],s.curVel[m]=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,Ke=0;function Bn(e){Ke=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"&&(Ke=requestAnimationFrame(Bn))}function zn(e){return Ce.add(e),!Ke&&typeof requestAnimationFrame<"u"&&(Ke=requestAnimationFrame(Bn)),()=>{Ce.delete(e)}}function jo(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 Hn(e,t){let n=(0,L.useMemo)(()=>jo(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:u=900,stagger:h=0}=t,m=(0,L.useRef)(null),g=(0,L.useRef)("init"),b=(0,L.useRef)(null),d=(0,L.useRef)(s),p=(0,L.useRef)(i),M=(0,L.useRef)(!1),k=(0,L.useRef)(0),[,w]=(0,L.useState)(0),R=(0,L.useRef)(null),C=(0,L.useRef)(!0);m.current||(m.current=new We,m.current.configure(l,u),m.current.snap(n),b.current=n);let $=m.current;if($.configure(l,u),b.current!==n){let c=g.current,v=!Object.is(d.current,s);$.sameTargets(n)?$.refreshData(n):!r||c==="init"?$.snap(n):c==="idle"?$.hold(n):c==="running"||v?$.update(n,Ae(),h):$.snap(n),b.current=n,d.current=s}let K=(0,L.useRef)(()=>!1);K.current=c=>{if(!C.current)return!1;let v=$.step(c);return!v&&g.current==="running"&&(g.current="done"),w(E=>(E+1)%1e9),v||(R.current=null),v};let O=(0,L.useCallback)(()=>{if(!oe||R.current||!$.animating)return;let c=v=>K.current(v);R.current=zn(c)},[$]);ne(()=>{let c=!Object.is(p.current,i);if(p.current=i,!r){(g.current!=="done"||$.animating)&&($.snap(b.current??n),g.current="done",w(v=>v+1));return}g.current==="init"||c&&a?($.hold(b.current??n),g.current="idle",M.current=!1,w(v=>v+1)):c&&(M.current=!0)},[r,i]),ne(()=>{!r||!a||!M.current||(M.current=!1,$.hold(b.current??n),g.current="idle",w(c=>c+1))},[a,r]),(0,L.useEffect)(()=>{r&&o&&g.current==="idle"&&($.start(Ae()),k.current+=1,g.current="running",O(),w(c=>c+1))},[r,o,i,$,O]),(0,L.useEffect)(()=>{$.animating&&O()}),(0,L.useEffect)(()=>(C.current=!0,()=>{C.current=!1,R.current?.(),R.current=null}),[]);let J=Ae(),B=$.elapsed(J),j=r&&g.current==="idle";return{items:$.items(),get:c=>$.get(c),elapsed:j?0:B,fade:(c,v=320)=>j?0:Number.isFinite(B)?Math.max(0,Math.min(1,(B-c)/v)):1,waiting:j,animating:$.animating,generation:k.current}}var Wo=T(V(),1);var jn=T(N(),1);var Vn=e=>e?"neutralStrong":"accent";var ht=T(N(),1);function Wn(e,t,n,r){if(typeof e!="function")return le(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 l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var gt=T(V(),1);var X=T(N(),1),Ko={kind:"Bullet chart",actual:"Actual",target:"Target",targetWord:"target",achieved:"Achieved",withTarget:e=>` (target ${e})`},Go={en:Ko,ko:{kind:"불릿 차트",actual:"실적",target:"목표",targetWord:"목표",achieved:"달성률",withTarget:e=>`(목표 ${e})`}};function pt(e){let n=e.independent===!1?16:0,r=_n(e,{height:()=>Math.max(90,e.data.length*40+8)+n,duration:800,stagger:110}),{p:o,width:a,height:i}=r,s=(0,gt.useMemo)(()=>{let c=pe(e.label,"label"),v=ge(e.value,"value"),E=ge(e.target,"target"),x=e.ranges??[],S=e.data.map((F,U)=>{let D=v(F,U),z=E(F,U),H=x.map(Te=>ge(Te,Te)(F,U)).filter(Number.isFinite),de=Nn(0,Math.max(D||0,z||0,...H),4)[1];return{i:U,label:c(F,U),value:D,target:z,ranges:H,max:de,hi:!1,datum:F}}),_=S.map(F=>Number.isFinite(F.target)&&F.target?F.value/F.target:1/0),re=le(e.highlight,S.map(F=>F.datum),S.map(F=>F.label),_,"min");return S.map(F=>({...F,hi:re.has(F.i)}))},[e.data,e.label,e.value,e.target,e.ranges,e.highlight]),l=Math.max(...s.map(c=>c.max),1),u=Math.min(a*.34,Math.max(...s.map(c=>he(c.label,11.5,600)),30)+10),h=c=>Number.isFinite(c)?r.fmt(c):"-",m=c=>Number.isFinite(c)?r.fv(c):"-",g=Math.max(...s.map(c=>he(h(c.value),12,800)),20)+12,b=u+6,d=a-g,p=(i-8-n)/Math.max(1,s.length),M=Math.max(6,Math.min(12,p*.26)),k=Math.max(12,Math.min(26,p*.58)),w=r.motion.stagger??110,R=(0,gt.useMemo)(()=>s.map((c,v)=>{let E=ye([0,e.independent===!1?l:c.max],[b,d]);return{key:`b:${c.label}`,to:[E(c.value||0),Number.isFinite(c.target)?E(c.target):b,1],from:[b,Number.isFinite(c.target)?E(c.target):b,0],enter:[b,b,0],delay:v*w,data:c}}),[s,b,d,l,e.independent,w]),C=Hn(R,r.motion),$=Xt(o,"accent"),K=[o.paint("neutralSoft"),o.paint("neutral"),o.mix("neutral","neutralStrong",.62)],O=Go[r.lang],J=s.map(c=>({datum:c.datum,index:c.i,key:c.label,label:c.label,value:Number.isFinite(c.value)?c.value:null,formatted:`${m(c.value)}${Number.isFinite(c.target)?` / ${O.targetWord} ${r.fv(c.target)}${Number.isFinite(c.value)?` (${r.pct(c.value/(c.target||1)*100)})`:""}`:""}`})),B=null;if(r.active!==null&&s[r.active]){let c=s[r.active];B={x:ye([0,e.independent===!1?l:c.max],[b,d])(c.value||0),y:4+p*c.i+p/2-k/2,title:c.label,rows:[{label:O.actual,value:m(c.value),color:c.hi?$.fill:o.paint("ink")},...Number.isFinite(c.target)?[{label:O.target,value:r.fv(c.target)},{label:O.achieved,value:r.pct(c.value/(c.target||1)*100)}]:[]]}}let j=e.description??`${O.kind}. ${s.map(c=>`${c.label} ${m(c.value)}${Number.isFinite(c.target)?O.withTarget(r.fv(c.target)):""}`).join(", ")}.`;return(0,X.jsxs)(Cn,{c:r,kind:O.kind,ariaLabel:e.ariaLabel,description:j,events:J,tip:B,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,children:[C.items.map(c=>{let v=c.data;if(c.exiting)return null;let E=v.i,x=ye([0,e.independent===!1?l:v.max],[b,d]),S=4+p*E+p/2,[_,re,F]=c.v,U=[0,...v.ranges,v.max].filter((z,H,de)=>H===0||z>de[H-1]),D=r.active===v.i;return(0,X.jsxs)("g",{className:"ztd-mark",opacity:r.dim(v.i),onPointerEnter:z=>r.setActive(v.i,z.pointerType==="touch"?"touch":"pointer"),onClick:()=>r.click(v.i),children:[(0,X.jsx)("rect",{x:0,y:S-p/2,width:a,height:p,fill:"transparent"}),U.slice(0,-1).map((z,H)=>{let de=U[H+1],Te=K[Math.min(K.length-1,Math.round(H/Math.max(1,U.length-2)*(K.length-1)))];return(0,X.jsx)("path",{d:ft(x(z),S-k/2,x(de)-x(z),k,{tl:H===0?3:0,bl:H===0?3:0,tr:H===U.length-2?3:0,br:H===U.length-2?3:0}),fill:Te,opacity:.35+.65*F},H)}),(0,X.jsx)("path",{d:ft(b,S-M/2,Math.max(0,_-b),M,2),fill:v.hi?$.fill:o.paint("ink")}),Number.isFinite(v.target)?(0,X.jsx)("line",{x1:re,x2:re,y1:S-k/2-2,y2:S+k/2+2,stroke:o.paint("ink"),strokeWidth:2.5,strokeLinecap:"round",opacity:F}):null,D&&r.via==="keyboard"?(0,X.jsx)("rect",{x:b-3,y:S-k/2-4,width:d-b+6,height:k+8,rx:5,fill:"none",stroke:o.paint("ink"),strokeWidth:1.5}):null,Mn(v.label,u-4,11.5,p>=34?2:1,700).map((z,H,de)=>(0,X.jsx)(ze,{x:u,y:S+(H-(de.length-1)/2)*13,anchor:"end",size:11.5,weight:v.hi?800:600,fill:o.paint("ink"),children:z},H)),(0,X.jsx)(ze,{x:a-2,y:S,anchor:"end",size:12,weight:v.hi?800:600,fill:o.paint(v.hi?"ink":"muted"),opacity:C.fade(E*w+300,260),children:h(v.value)})]},c.key)}),e.independent===!1?(0,X.jsx)("g",{"aria-hidden":"true",children:ye([0,l],[b,d]).ticks(4).map(c=>(0,X.jsx)(ze,{x:ye([0,l],[b,d])(c),y:i-9,anchor:"middle",size:Sn,fill:o.paint("muted"),children:r.fmt(c)},c))}):null]})}var Uo=T(V(),1);var yt=T(N(),1),Yo={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}, ${Re(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Kn={en:Yo,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}일 이동평균`}},bt=["ink","muted","dim"];function Gn(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,bt.length)}var qo=T(V(),1);var Xn=T(N(),1),Xo={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Re(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Jo={en:Xo,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Un=(e,t)=>Jo[e].other(t);function Yn(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,kn(o.map(a=>a.value)))}}var qn=e=>Number.isFinite(e)&&e>0?e:0;var me=T(N(),1);function Jn(e,t){let n=Ie(e);return n?.type==="scatter"&&t?.size!==void 0?Ie("bubble"):n}function Zo(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 Qo(e,t,n,r=!1){let o=Jn(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&mt.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),u=m=>m.filter(g=>!l.has(g.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(h.includes(o.type)){let m=pe(a.label,"label"),g=ge(a.value,"value"),b=o.type==="waffle",d=t.map((C,$)=>({r:C,label:m(C,$),value:b?g(C,$):qn(g(C,$))})),{kept:p,other:M}=b?{kept:d,other:null}:Yn(d,i.other,(C,$)=>({r:{},label:Un(W(n),C),value:$})),k=le(s,p.map(C=>C.r),p.map(C=>C.label),p.map(C=>C.value),b?"first":"max"),w=M?[...p,M]:p,R=ve(w.length,k);return w.map((C,$)=>({label:C.label,color:R[$]}))}if(o.type==="candlestick"){let m=Gn(Array.isArray(i.ma)?i.ma:void 0,t.length),g=Kn[W(n)];return[{label:g.up,color:i.upColor??"accent"},{label:g.down,color:i.downColor??"neutralStrong"},...m.map((b,d)=>({label:g.maLegend(b),color:bt[d],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let m=pe(a.series,"series"),g=st(t.map((d,p)=>m(d,p)));if(g.length<2)return[];let b=Jt(g.length,Wn(s,t,g,m));return u(g.map((d,p)=>({label:d,color:b[p],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let m=[];if(Array.isArray(a.y))m=a.y;else if(typeof a.series=="string"){let p=pe(a.series,"series");m=st(t.map((M,k)=>p(M,k)))}let g=dt(o.type,a,i);if(g.length){let p=ve(m.length,le(s,m,m,m.map(()=>0),"none")),M=m.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:m.map((k,w)=>({label:k,color:p[w]}));return[...u(M),...g.map((k,w)=>({label:k,color:Vn(w),shape:"line"}))]}if(m.length<2)return[];let b=le(s,m,m,m.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return u(m.map((p,M)=>({label:p,color:b.has(M)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let d=ve(m.length,b);return u(m.map((p,M)=>({label:p,color:d[M]})))}return[]}function Zn(e,t){let{spec:n}=e,r=Jn(n.type,n.encoding),o=(0,$e.useMemo)(()=>vn(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=pn(n,e.locale),s=ee(i),l=W(s),u=rn(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),h=yn(n),m=(0,$e.useMemo)(()=>h?mn(h,s):void 0,[h,s]),g=n.options?.hidden,b=Array.isArray(g)?g.map(String):[],d=b.join(""),[p,M]=(0,$e.useState)(null);if(!r)return(0,me.jsx)(it,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let k=o??u.data,w=t[r.type],R={...n.options??{}},C={...Zo(r,n.encoding),...R,...m?{tooltip:m}:{},data:k,...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},$=n.card?.legend==="toggle"&&bn(r.type,n.encoding??{},R),K=p&&p.base===d?p.hidden:b;$&&(C.hidden=K);let O=c=>M(v=>{let E=v&&v.base===d?v.hidden:b;return{base:d,hidden:E.includes(c)?E.filter(x=>x!==c):[...E,c]}}),J=C.height??220,B=a&&!k.length&&(u.loading||u.error||u.empty)?(0,me.jsx)(it,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:J,locale:i}):(0,me.jsx)(w,{...C});if(n.card){let c=n.card,v=c.legend==="auto"||c.legend==="toggle"?Qo(n,k,s,$):c.legend,E=v?.length?$?(0,me.jsx)(at,{items:v,hidden:K,onToggle:O,locale:i}):v:void 0,x=c.download?(0,me.jsx)(cn,{data:k,columns:xn(n),filename:c.title??r.type,formats:Array.isArray(c.download)?c.download:void 0,locale:i}):void 0;B=(0,me.jsx)(qt,{number:c.number,title:c.title??gn(r,l),subtitle:c.subtitle,legend:E,actions:x,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:B})}let j=e.theme??n.theme;return j&&(B=(0,me.jsx)(Le,{theme:j,children:B})),B}function ea({cfg:e,components:t}){let n=Ve();return Zn({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function er(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Qn.hydrateRoot)(r,(0,xt.createElement)(Le,{theme:o.theme,cssVars:!0},(0,xt.createElement)(ea,{cfg:o,components:{[e]:t}})))}er("bullet",pt);})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var mr=Object.create;var wt=Object.defineProperty;var dr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var qe=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var pr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fr(t))!gr.call(e,o)&&o!==n&&wt(e,o,{get:()=>t[o],enumerable:!(r=dr(t,o))||r.enumerable});return e};var N=(e,t,n)=>(n=e!=null?mr(hr(e)):{},pr(t||!e||!e.__esModule?wt(n,"default",{value:e,enumerable:!0}):n,e));var W=qe((ma,Ct)=>{Ct.exports=globalThis.__ztdReact.react});var Tt=qe((da,$t)=>{$t.exports=globalThis.__ztdReact["react-dom/client"]});var L=qe((Ca,Yt)=>{Yt.exports=globalThis.__ztdReact["react/jsx-runtime"]});var kt=N(W(),1),sr=N(Tt(),1);var Me=N(W(),1);var Be=N(W(),1);var St=N(W(),1),Ae=(0,St.createContext)(void 0);var xr=N(W(),1);var br=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Mt='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',At='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',se={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:Mt,monoFamily:At,radius:18,radiusCode:14,radiusMark:4},yr={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:Mt,monoFamily:At,radius:18,radiusCode:14,radiusMark:4},Xe={dark:se,light:yr};function Ye(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Je(e){let t={};for(let n of br){let r=e[n];typeof r=="string"&&(t[Ye(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 Ze(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 kr=`
|
|
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,${se.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,${se.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${se.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 Nt=!1;function we(){if(Nt||typeof document>"u"||(Nt=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=kr,document.head.appendChild(e)}var Ne=N(W(),1),oe=typeof window<"u"&&typeof document<"u",ne=oe?Ne.useLayoutEffect:Ne.useEffect;function Re(){return typeof performance<"u"?performance.now():Date.now()}function V(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function he(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Rt={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},Ft={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var vr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],wr={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 $r(e){return Cr(vr,e)}function Pt(e,t){let n=$r(e);return{text:n?n[t]:e,...wr[n?.id??"basic"]}}var Q=N(W(),1);var It=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),Z="en-US",Lt=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=Lt.get(r);return o||(o=new Intl.NumberFormat(e,n),Lt.set(r,o)),o}function et(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function tt(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=Z,...r}=t;return et(Qe(n,r).format(e))}var Ot=e=>e!==0&&Math.abs(e)<.05,Bt=(e,t,n="")=>`${tt(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Fe(e,t={}){if(!Number.isFinite(e))return"-";if(Ot(e)&&t.maximumFractionDigits===void 0)return Bt(e,t.locale??Z,"%");let n=Math.abs(e);return`${tt(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Tr(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=Z,...r}=t;if(V(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,l]=i[a],u=o/s,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),m=Math.round(u*10**h)/10**h;if(a>0&&m>=i[a-1][0]/s){a--;continue}return(e<0&&m!==0?"-":"")+tt(m,{locale:n,...r,maximumFractionDigits:h})+l}}return et(Qe(n,{notation:"compact",...r}).format(e))}var Sr=(e,t=V(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Pe(e,t=Z,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=Qe(t,o);return l=>Number.isFinite(l)?`${a}${et(s.format(l))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>Fe(o,{locale:t});case"ratio":return o=>Fe(o*100,{locale:t});case"compact":return o=>Tr(o,{locale:t});case"currency":return r(Sr(t));default:{let o=r({maximumFractionDigits:1});return i=>Ot(i)?Bt(i,t):o(i)}}}function Mr(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var nt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ar=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Nr=["january","february","march","april","may","june","july","august","september","october","november","december"],Dt=e=>{let t=e.toLowerCase();return t.length<3?0:Nr.findIndex(n=>n.startsWith(t))+1},Et=e=>+e+(+e<30?2e3:1900);function zt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Rr=[/^(\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})일)?$/],Ht=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,jt=/\{([^{}]+)\}/g;function Le(e,t){let n;for(let r of Rr)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?[Et(n[3]),+n[2],+n[1],1]:[Et(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=Ht.exec(e)){let r=+n[1],o=+n[3],i=r>12||o<=12&&t===!0;return[+n[4],i?o:r,i?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=Dt(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=Dt(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Vt=e=>Ar.test(e)||Le(e)!==null;function Wt(e){let t;for(let n of e){let r=typeof n=="string"?Ht.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function De(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(nt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return De(`${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=Le(n,t);if(r)return Mr(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 _t=new Map;function Kt(e,t={month:"short",day:"numeric"}){let n=De(e);if(!n)return"-";let{locale:r=Z,...o}=t,i=r+JSON.stringify(o),a=_t.get(i);return a||(a=new Intl.DateTimeFormat(r,o),_t.set(i,a)),a.format(n)}var Gt={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ut(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Gt[t.toLowerCase()]&&(t=Gt[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let i=parseInt(o,16);return o.length===6?[i>>16&255,i>>8&255,i&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 i=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function Fr(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 rt(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Pr(e){return[rt(e[0]),rt(e[1]),rt(e[2])]}function ot(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 qt(e){let[t,n,r]=Pr(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function Lr([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[ot(4.0767416621*o-3.3077115913*i+.2309699292*a),ot(-1.2684380046*o+2.6097574011*i-.3413193965*a),ot(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function Xt(e,t,n){let r=Ut(e),o=Ut(t);if(!r||!o)return e;let i=qt(r),a=qt(o),s=Math.max(0,Math.min(1,n));return Fr(Lr([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}var at=N(L(),1),Ee=(0,Q.createContext)({theme:se,cssVars:!0});function Dr(e,t=se){return e?typeof e=="string"?Xe[e]??t:Ze(t,e):t}function Ie(e){let t=(0,Q.useContext)(Ee),n=e.base?Xe[e.base]:t.theme,r=(0,Q.useMemo)(()=>Dr(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,Q.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,Q.useMemo)(()=>Je(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,at.jsx)(Ee.Provider,{value:a,children:(0,at.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Er=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function _e(e){return Er.has(e)}function _r(e,t){let n=r=>t?`var(${Ye(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?_e(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?_e(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:Xt(e[r],e[o],i)}}}function ae(e){let t=(0,Q.useContext)(Ee);return(0,Q.useMemo)(()=>{let n=Ze(t.theme,e);return _r(n,t.cssVars)},[t.theme,t.cssVars,e])}function ee(e){let t=(0,Q.useContext)(Ee);return e??t.locale??Z}function Jt(e){return e?Je(e):{}}var Oe=N(W(),1),it=(0,Oe.createContext)(void 0);function Zt(e){let t=(0,Oe.useContext)(it);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var w=N(L(),1),Ir={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`},Or={en:Ir,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Br={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},st=e=>Or[V(ee(e))];function lt(e){let t=ae(e.theme),n=st(e.locale),[r,o]=(0,Be.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),l=e.items.filter(h=>!s.has(h.label)).length,u=(0,w.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((h,m)=>{let f=!s.has(h.label),b=f&&l===1,d=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(zr,{p:t,item:h,off:!f}),(0,w.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,w.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,w.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":b||void 0,onClick:()=>{b||(a(h.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:d}):d},m)})});return a?(0,w.jsxs)(w.Fragment,{children:[u,(0,w.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Br,children:r?n.shown(l,e.items.length):""})]}):u}function zr({p:e,item:t,off:n}){let r=t.color?_e(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,w.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,w.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,w.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,w.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 Hr(e){let t=ae(e.theme),n=Pt(e.level,V(ee(e.locale)));return(0,w.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 jr(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,w.jsxs)(w.Fragment,{children:[e.slice(0,r),(0,w.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Qt(e){let t=ae(e.theme),n=st(e.locale),[r,o]=(0,Be.useState)(0);ne(()=>we(),[]);let i=()=>{o(f=>f+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,w.jsx)(lt,{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,u=e.replay||e.onReplay,h=e.source!==void 0||e.note!==void 0?(0,w.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,m=e.takeaway!==void 0||e.level||e.sample?(0,w.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,w.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,w.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,w.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,w.jsx)(Hr,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,w.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,w.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,w.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,w.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:jr(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,w.jsx)("button",{type:"button",className:"ztd-btn",onClick:i,"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,w.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,w.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,w.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,w.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,w.jsx)("span",{}),a]}):null]}),(0,w.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,w.jsx)(it.Provider,{value:r,children:(0,w.jsx)(Ae.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,w.jsxs)(w.Fragment,{children:[h,m]}):m]})}function ut(e){let t=ae(e.theme),n=st(e.locale),r=e.height??220;if(ne(()=>we(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,w.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,w.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,w.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,w.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,w.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,w.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,i)=>(0,w.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${i*90}ms`}},i))}):e.empty?(0,w.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,w.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,w.jsx)(w.Fragment,{children:e.children})}function le(e,t,n,r,o="max"){let i=new Set,a=n.length,s=u=>{if(a&&u!=="none"){if(u==="first")i.add(0);else if(u==="last")i.add(a-1);else if(u==="max"||u==="min"){let h=-1,m=u==="max"?-1/0:1/0;r.forEach((f,b)=>{Number.isFinite(f)&&(u==="max"?f>m:f<m)&&(m=f,h=b)}),h>=0&&i.add(h)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((u,h)=>{h<a&&u!==null&&u!==void 0&&e(u,h)&&i.add(h)}),i;let l=Array.isArray(e)?e:[e];for(let u of l)typeof u=="number"?u>=0&&u<a&&i.add(u):u==="max"||u==="min"||u==="first"||u==="last"||u==="none"?s(u):n.forEach((h,m)=>{h===u&&i.add(m)});return i}function en(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 Ce(e,t){let n=new Array(e),r=[];for(let i=0;i<e;i++)t.has(i)?n[i]="accent":r.push(i);let o=r.length;return r.forEach((i,a)=>{o===1?n[i]="neutral":a===0?n[i]="ink":a===o-1?n[i]="neutral":n[i]="neutralStrong"}),n}function tn(e,t){return Ce(e+1,t).slice(0,e)}function nn(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Vr(e,t){if(e==null||typeof e!="object")return;let n=e;if(nn(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!nn(r,o))return;r=r[o]}return r}}function ie(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 ge(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Vr(r,n)}function rn(e,t){let n=ge(e,t);return(r,o)=>ie(n(r,o))}function ze(e,t){let n=ge(e,t);return(r,o)=>{let i=n(r,o);return i==null?"":i instanceof Date?new Date(i.getTime()-i.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(i)}}function pe(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var Y=N(W(),1);function Wr(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let u=e[l];if(u==='"')n=!n;else if(!n&&(u===`
|
|
23
|
+
`||u==="\r"))break;t.push(n?"":u)}let r=t.join(""),o=l=>r.split(l).length-1,i=[","," ",";","|"],a=",",s=0;for(let l of i){let u=o(l);u>s&&(s=u,a=l)}return a}var Kr=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function on(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Kr.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ie(t);if(Number.isFinite(n))return n}return t}function fe(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??Wr(o),a=[],s=[],l="",u=!1;for(let d=0;d<o.length;d++){let x=o[d];u?x==='"'?o[d+1]==='"'?(l+='"',d++):u=!1:l+=x:x==='"'&&!l.trim()?(u=!0,l=""):x===i?(s.push(l),l=""):x===`
|
|
24
|
+
`||x==="\r"?(x==="\r"&&o[d+1]===`
|
|
25
|
+
`&&d++,s.push(l),a.push(s),s=[],l=""):l+=x}(l!==""||s.length)&&(s.push(l),a.push(s));let h=a.filter(d=>!(d.length===1&&d[0].trim()===""));if(!h.length)return[];let m=d=>n?on(d):d;if(!r)return h.map(d=>Object.fromEntries(d.map((x,$)=>[String($),m(x)])));let f=[],b=new Set;return h[0].forEach((d,x)=>{let $=d.trim()||`col${x+1}`,v=$;for(let T=2;b.has(v);T++)v=`${$}_${T}`;b.add(v),f.push(v)}),h.slice(1).map(d=>Object.fromEntries(f.map((x,$)=>[x,m(d[$]??"")])))}function ct(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof a[l]=="string"?on(a[l]):a[l]??null])))}function Gr(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(i=>Array.isArray(i))){let i=Object.keys(e),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,l)=>Object.fromEntries(i.map(u=>[u,e[u][l]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function an(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 ue(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return ue(JSON.parse(t))}catch{}return fe(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?ct(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)?ue(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?ct(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)?ue(t.rows):Array.isArray(t.values)?ct(t.values):Array.isArray(t.items)?ue(t.items):Array.isArray(t.results)?ue(t.results):Gr(t)}return[]}function sn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=i=>{try{return JSON.stringify(i)}catch{return String(i)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let i=0;i<t;i+=r)o.push(e[i]);return o.push(e[t-1]),`${t}:${n(o)}`}async function Ur(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",i=await e.text();if(t==="text")return i;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(i))throw new Error(V(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return fe(i);if(t==="json"||o.includes("json"))return JSON.parse(i);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return fe(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):fe(i)}async function qr(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),i=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!i.ok)throw new Error(`HTTP ${i.status}${i.statusText?` ${i.statusText}`:""}`);r=await Ur(i,t.parse,o,t.locale)}return t.select&&(r=an(r,t.select)),t.transform?t.transform(r):ue(r)}function ln(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,Y.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Y.useState)(0),u=ee(t.locale),h=(0,Y.useRef)(t);h.current={...t,locale:u};let m=(0,Y.useRef)(e);m.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",b=t.deps??[],d=JSON.stringify(b.map(v=>typeof v=="object"?JSON.stringify(v):String(v))),x=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{let v=m.current;if(!v||!r){a(S=>S.status==="loading"?{...S,status:"idle"}:S);return}let T=new AbortController,F=!0;return x.current=!0,a(S=>({...S,data:o?S.data:[],status:"loading",error:null})),qr(v,{...h.current,signal:T.signal}).then(S=>{F&&a({data:S,status:"success",error:null,updatedAt:Date.now()})}).catch(S=>{!F||T.signal.aborted||a(M=>({...M,status:"error",error:S instanceof Error?S:new Error(String(S))}))}).finally(()=>{F&&(x.current=!1)}),()=>{F=!1,x.current=!1,T.abort()}},[f,r,s,d,o]),(0,Y.useEffect)(()=>{if(!n||!r)return;let v=setInterval(()=>{x.current||l(T=>T+1)},n);return()=>clearInterval(v)},[n,r]);let $=(0,Y.useCallback)(()=>l(v=>v+1),[]);return{data:i.data,status:i.status,loading:i.status==="loading",error:i.error,empty:i.status==="success"&&i.data.length===0,updatedAt:i.updatedAt,reload:$}}var dt=N(L(),1),Xr=["csv","svg","png"],Yr=/^[=+\-@\t\r\n=+-@]/,Jr=/var\(|color-mix\(/;function un(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?zt(e.getTime()):String(e);return`"${(Yr.test(t)&&!Number.isFinite(ie(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 Qr(e,t){return`\uFEFF${[t.map(un),...e.map(r=>t.map(o=>un(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function eo(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function mt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var cn=2,ce=16;function mn(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,i,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function dn(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 fn(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,l]=[i+ce*2,a+ce*2],u=o.cloneNode(!0),h=u.querySelectorAll("*"),m=new Map;o.querySelectorAll("*").forEach((d,x)=>{let $;for(let v of Array.from(d.attributes)){if(!Jr.test(v.value))continue;let T=($??($=getComputedStyle(d))).getPropertyValue(v.name);T&&h[x].setAttribute(v.name,mn(T,m))}}),u.removeAttribute("style");for(let[d,x]of Object.entries({viewBox:`${-ce} ${-ce} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(d,String(x));let f=mn(getComputedStyle(r).backgroundColor,m),b=o.parentElement?.querySelector("canvas")??null;if(n){let d=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(dn("rect",{x:-ce,y:-ce,width:s,height:l,fill:f}),d),b&&u.insertBefore(dn("image",{href:b.toDataURL(),width:i,height:a}),d)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:l,vw:i,vh:a,bg:f,canvas:b}}function to(e,t){let n=fn(e,cn,!1);if(!n)return;let r=cn,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let i=o.getContext("2d");if(!i)return;i.fillStyle=n.bg,i.fillRect(0,0,o.width,o.height),n.canvas&&i.drawImage(n.canvas,ce*r,ce*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(l=>l&&mt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function hn(e){let t=ae(e.theme),n=V(ee(e.locale))==="ko",r=eo(e.filename),o=(i,a)=>{if(i==="csv")return mt(new Blob([Qr(e.data,e.columns?.length?e.columns:Zr(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return to(a,r);let s=fn(a,1,!0);s&&mt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,dt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Xr.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,dt.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(i,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:a},i)})})}var pn=N(L(),1);function gn(e,t=Z){let n=Pe(void 0,t),r=e.split(`
|
|
28
|
+
`),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Kt(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,u=s.replace(jt,(h,m)=>o(i,m.trim())??(l=!0,""));l||a.push(u)}return a.length?a.map((s,l)=>(0,pn.jsx)("div",{children:s},l)):null}}var g=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),te=g("label","string",!0,"Item name field"),G=g("value","number",!0,"Value field"),no=[te,G],ro=[te,G],oo=[g("label","string",!0,"Stage name"),g("value","number",!0,"Users at the stage")],ao=[te,G],io=[g("label","string",!0,"Leaf (lowest level) name"),G,g("group","string",!1,"Parent group field")],so=[g("label","string",!0,"Leaf name"),G,g("group","string",!1,"Parent group field")],lo=[te,g("value","number",!0,"Change (total rows may omit it)"),g("type","string",!1,'"total" makes a total bar')],uo=[te,G],co=[g("x","string",!0,"Column field"),g("series","string",!0,"Stacked series field"),G],mo=[g("x","string",!0,"Column field"),g("y","string",!0,"Row field"),G],fo=[g("axis","string",!0,"Metric (axis) field"),g("value","number",!0,"Value field",{multi:!0}),g("series","string",!1,"Series field")],ho=[g("x","number",!0,"x value"),g("y","number",!0,"y value"),g("size","number",!1,"Circle size"),g("label","string",!1,"Name")],yn=g("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),go=[g("x","any",!0,"x field (date, number or category)"),g("y","number",!0,"y field. An array for wide tables",{multi:!0}),g("series","string",!1,"Series field (long tables)"),g("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),yn],po=[g("x","any",!0,"x field"),g("y","number",!0,"y field. An array for wide tables",{multi:!0}),g("series","string",!1,"Series field"),g("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}),yn],bo=[g("x","any",!0,"x field"),g("y","number",!0,"y field",{multi:!0}),g("series","string",!1,"Series field")],yo=[g("x","string",!0,"Category field"),g("y","number",!0,"Value field. An array for wide tables",{multi:!0}),g("series","string",!1,"Series field"),g("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})],xo=[te,G],ko=[g("value","number",!0,"Value field",{prop:"valueKey"}),g("target","number",!1,"Target field",{prop:"targetKey"})],vo=[te,g("value","number",!0,"Actual value field"),g("target","number",!1,"Target field")],wo=[g("x","any",!1,"x field"),g("y","number",!0,"y field")],Co=[te,g("x","string",!1,"Period field (long tables)"),g("value","number",!1,"Value field (long tables)")],$o=[te,g("start","number",!0,"Before value"),g("end","number",!0,"After value")],To=[te,G],So=[g("value","number",!0,"Value field"),g("group","string",!1,"Group (row) field"),g("label","string",!1,"Dot name")],Mo=[g("group","string",!0,"Group field"),g("value","number",!0,"Value field")],Ao=[g("source","string",!0,"Source node"),g("target","string",!0,"Target node"),G],No=[g("source","string",!0,"Sending group"),g("target","string",!0,"Receiving group"),G],Ro=[g("date","date",!0,"Date field"),G],Fo=[g("x","any",!0,"Period field"),g("series","string",!0,"Item field"),g("rank","number",!1,"Rank field (1 is first)"),g("value","number",!1,"Value field (instead of rank, largest is first)")],Po=[g("group","string",!0,"Group field"),g("value","number",!0,"Value field")],Lo=[g("label","string",!1,"Row name field")],Do=[g("x","date",!0,"Date (period) field"),g("open","number",!0,"Open price field"),g("high","number",!0,"High price field"),g("low","number",!0,"Low price field"),g("close","number",!0,"Close price field"),g("volume","number",!1,"Volume field")],Eo=[te,G],_o=[g("x","any",!0,"Period field (date or category)"),g("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),g("series","string",!1,"Series field (long tables, back row only)"),g("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Io=[g("value","number",!1,"Sample value field (raw rows)"),g("group","string",!1,"Group field. Up to 2 groups overlap"),g("x0","number",!1,"Bin start (pre-binned rows)"),g("x1","number",!1,"Bin end (pre-binned rows)"),g("count","number",!1,"Samples in the bin (pre-binned rows)")],Oo=[g("x","number",!0,"x value"),g("y","number",!0,"y value"),g("series","string",!1,"Series field (one color per series)"),g("label","string",!1,"Name")],bn={pie:no,donut:ro,funnel:oo,waffle:ao,treemap:io,sunburst:so,waterfall:lo,pareto:uo,marimekko:co,heatmap:mo,radar:fo,bubble:ho,line:go,area:po,stream:bo,bar:yo,radialBar:xo,gauge:ko,bullet:vo,sparkline:wo,slope:Co,dumbbell:$o,lollipop:To,beeswarm:So,ridgeline:Mo,sankey:Ao,chord:No,calendar:Ro,bump:Fo,box:Po,parallel:Lo,candlestick:Do,segmented:Eo,skyline:_o,histogram:Io,scatter:Oo},be={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 xn(e,t){return t==="ko"?e.nameKo:e.name}function kn(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var ft=["line","area","bar","scatter"];function ht(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function vn(e,t,n){return ft.includes(e)&&!ht(e,t,n).length}function wn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Bo={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 He(e){let t=bn[e]?e:Bo[e]??Object.keys(be).find(n=>n.toLowerCase()===e.toLowerCase()||be[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!be[t]))return{type:t,component:be[t].component,name:be[t].name,nameKo:be[t].nameKo,encoding:bn[t]}}function Cn(e){let t=new Set,n=i=>{Array.isArray(i)?i.forEach(n):typeof i=="string"&&i&&t.add(i)},r=e.encoding??{};for(let i of He(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}var zo=Math.PI*2;function $n(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function re(e){return Math.round(e*100)/100}function Tn(e,t=!0){let n=e.length;if(!n)return"";let r=l=>`${t?"M":"L"}${re(l[0])},${re(l[1])}`;if(n<3)return r(e[0])+e.slice(1).map(l=>`L${re(l[0])},${re(l[1])}`).join("");let o=[],i=[];for(let l=0;l<n-1;l++){let u=e[l+1][0]-e[l][0];o.push(u),i.push(u===0?0:(e[l+1][1]-e[l][1])/u)}let a=[i[0]];for(let l=1;l<n-1;l++)if(i[l-1]*i[l]<=0)a.push(0);else{let u=2*o[l]+o[l-1],h=o[l]+2*o[l-1];a.push((u+h)/(u/i[l-1]+h/i[l]))}a.push(i[n-2]);let s=r(e[0]);for(let l=0;l<n-1;l++){let u=o[l]/3;s+=`C${re(e[l][0]+u)},${re(e[l][1]+a[l]*u)} ${re(e[l+1][0]-u)},${re(e[l+1][1]-a[l+1]*u)} ${re(e[l+1][0])},${re(e[l+1][1])}`}return s}function Sn(e,t,n,r){return Math.max(0,Math.min(r-1,Math.round((e-t)/(n-t||1)*(r-1))))}function Mn(e,t=!0){let n=e.map((a,s)=>({v:a,i:s})).sort((a,s)=>t?s.v-a.v:a.v-s.v),r=new Array(e.length),o=0,i=null;return n.forEach((a,s)=>{(i===null||a.v!==i)&&(o=s+1),r[a.i]=o,i=a.v}),r}function An(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 fe(t.csv)}return null}var U=N(W(),1);var P=N(L(),1),je=60,gt=8;function Nn(e,t){return e.length>gt?[...e.slice(0,gt),{label:t(e.length-gt),value:""}]:e}var Rn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Fn(e){let{c:t,events:n}=e,r=(0,U.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,ne(()=>{we()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,U.useContext)(Ae),u=e.ariaLabel??l??e.kind,h=(0,U.useMemo)(()=>s?`${n.length}${n.slice(0,je).map(c=>`${c.label}${c.series??""}${c.formatted??c.value??""}`).join("")}`:"",[n,s]),m=(0,U.useMemo)(()=>(0,P.jsx)(Ho,{label:u,events:n,t:t.t}),[u,h,t.t]),f=(0,U.useRef)(null);(0,U.useEffect)(()=>{let c=()=>{f.current=null};return window.addEventListener("scroll",c,{capture:!0,passive:!0}),window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("scroll",c,{capture:!0}),window.removeEventListener("resize",c)}},[]),(0,U.useEffect)(()=>{f.current=null},[t.width,t.height]);let b=c=>{if(c.target!==c.currentTarget)return;if(e.onKey?.(c)){c.preventDefault();return}let p=t.active,y;switch(c.key){case"ArrowRight":case"ArrowDown":y=p===null?0:(p+1)%a;break;case"ArrowLeft":case"ArrowUp":y=p===null?a-1:(p-1+a)%a;break;case"Home":y=0;break;case"End":y=a-1;break;case"Escape":if(p===null)return;y=null;break;case"Enter":case" ":p!==null&&(c.preventDefault(),t.click(p));return;default:return}c.preventDefault(),t.setActive(y,"keyboard")},{via:d,node:x,setActive:$}=t;(0,U.useEffect)(()=>{if(d!=="touch"||!x)return;let c=p=>{x.contains(p.target)||$(null)};return document.addEventListener("pointerdown",c),()=>document.removeEventListener("pointerdown",c)},[d,x,$]);let v=t.active!==null?n[t.active]:null,T=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,F=T&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,S=typeof e.renderTip=="function"&&v?e.renderTip(v):null,M=e.announce??(t.via==="keyboard"&&v?`${v.label}${v.series?` ${v.series}`:""}: ${v.formatted??v.value??""} (${(t.active??0)+1}/${a})`:""),z;if(T){let c=T.x*F,p=t.width*F,y=`clamp(${(4-c).toFixed(1)}px, -50%, calc(${(p-c-4).toFixed(1)}px - 100%))`,A=T.y<64;z={position:"absolute",left:c,top:T.y*F,transform:`translate(${y}, ${A?"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*F-8)}}let K=c=>{f.current=null,c.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},D=c=>c?p=>{let y=f.current??(f.current=p.currentTarget.getBoundingClientRect());y.width&&c((p.clientX-y.left)/y.width*t.width,(p.clientY-y.top)/y.height*t.height,p)}:void 0,E=D(e.onPointerMove),_=D(e.onPointerDown),C=E||_?c=>{c.pointerType==="touch"&&E?.(c),_?.(c)}:void 0,R=D(e.onPointerUp),k=Jt(e.theme);return(0,P.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":u,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?b:void 0,onBlur:c=>{t.via==="keyboard"&&!c.currentTarget.contains(c.relatedTarget)&&t.setActive(null)},onPointerLeave:K,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"),...k,...e.style},children:[t.pending?null:e.underlay,(0,P.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${i}`,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:C,onPointerUp:R,onPointerCancel:R,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,P.jsx)("title",{id:o,children:u}),(0,P.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,P.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,T?(0,P.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:z,children:S??(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:T.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:T.title}),T.rows.map((c,p)=>(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(c.strong?"ink":"muted")},children:[c.color?(0,P.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:c.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,c.label]}),(0,P.jsx)("span",{style:{fontWeight:c.strong===!1?500:700},children:c.value})]},p))]})}):null,(0,P.jsx)("span",{className:"ztd-sr",style:Rn,"aria-live":"polite","aria-atomic":"true",children:M}),s&&!t.pending?m:null]})}function Ho({label:e,events:t,t:n}){return(0,P.jsx)("div",{className:"ztd-sr",style:Rn,children:(0,P.jsxs)("table",{children:[(0,P.jsx)("caption",{children:n.table(e)}),(0,P.jsxs)("tbody",{children:[t.slice(0,je).map((r,o)=>(0,P.jsxs)("tr",{children:[(0,P.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,P.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>je?(0,P.jsx)("tr",{children:(0,P.jsx)("td",{colSpan:2,children:n.more(t.length-je)})}):null]})]})})}function ye(e){let t=e.baseline??"central";return(0,P.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 Ln(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Pn(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 Ve=new Map;function me(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=Ve.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);Ln(u)?a+=Pn(u):s+=Pn(u)}i=a+s*(n>=600?1.07:1),Ve.size>5e3&&Ve.clear(),Ve.set(o,i)}return i*t}function $e(e,t,n,r=400){if(e=e.trim(),me(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let l=i+a+1>>1;me(e.slice(0,l)+o,n,r)<=t?i=l:a=l-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(Ln(s.charCodeAt(0))?2:3)?"":s+o}function Dn(e,t,n,r,o=400){return $e(e,n-me(` ${t}`,r,o),r,o)}var xe=N(L(),1),En=10.5;function jo(e,t,n=En,r=8,o=400,i){let a=t.length;if(a<=1)return t.map((m,f)=>f);let s=t.map(m=>me(m,n,o)),l=(m,f)=>Math.abs(e[f]-e[m])<(s[m]+s[f])/2+r,u=[];for(let m of i??[])u.some(f=>l(f,m))||u.push(m);let h=m=>!u.some(f=>l(f,m));for(let m=1;m<=a;m++){let f=u.slice();for(let b=0;b<a;b+=m)h(b)&&f.push(b);if(m>1&&(a-1)%m>m/2&&h(a-1)&&f.push(a-1),f.sort((b,d)=>b-d),f.every((b,d)=>!d||!l(f[d-1],b)))return f}return[0,a-1]}function _n(e){let{p:t,labels:n,centers:r,y:o,width:i}=e,a=e.size??En,s=n.map((u,h)=>{let m=2*Math.max(0,Math.min(r[h],i-r[h]))-2;return $e(u,Math.min(e.maxWidth??160,m),a,e.strong?.has(h)?700:500)}),l=jo(r,s,a,6,600,e.strong);return(0,xe.jsx)("g",{"aria-hidden":"true",children:l.map(u=>{let h=e.strong?.has(u);return(0,xe.jsxs)("g",{children:[(0,xe.jsx)(ye,{x:r[u],y:o,anchor:"middle",size:a,weight:h?700:500,fill:t.paint(h?"ink":"muted"),children:s[u]}),e.sub?.[u]?(0,xe.jsx)(ye,{x:r[u],y:o+a+3,anchor:"middle",size:a-1,fill:t.paint("muted"),children:e.sub[u]}):null]},u)})})}function In(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let l=o(a);return l>=0?(r[l]||(i[l]=t(l),r[l]=1),i[l]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var Vo=(e,t,n)=>e==="date"?De(t,n)?.getTime()??NaN:ie(t);function Wo(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Vt(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function On(e,t,n,r,o={}){let i=ge(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:ge(n,"y"),u=!a&&r!==void 0?ge(r,"series"):null,h=e.map((k,c)=>i(k,c)),m=o.xType??Wo(h),f=o.locale??Z,b,d,x;if(m==="band"){let k=h.map(p=>String(p??""));b=pe(k);let c=new Map(b.map((p,y)=>[p,y]));d=b.map((p,y)=>y),x=Int32Array.from(k,p=>c.get(p)??-1)}else{let k=m==="date"?o.dayFirst??Wt(h):void 0,c=h.map(A=>Vo(m,A,k)),p=Array.from(new Set(c.filter(A=>Number.isFinite(A)))).sort((A,I)=>A-I),y=new Map(p.map((A,I)=>[A,I]));d=p,b=p.map(String),x=Int32Array.from(c,A=>y.get(A)??-1)}let $=o.dateFormat,v=k=>typeof k=="string"?Le(k.trim())?.[3]:void 0,T=m==="date"&&h.length<5e3?v(h[0]):void 0,F=(T===2||T===3)&&h.every(k=>v(k)===T),S=F&&T===3;if(m==="date"&&!$){let k=d.length>1?d[d.length-1]-d[0]:0;$=F&&T===2||k>864e5*120?{month:"short"}:k<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},k>864e5*800&&($={year:"numeric",month:"short"})}let M;if(m==="band")M=b;else if(S&&!o.dateFormat){let k=V(f)==="ko";M=d.map(c=>{let p=new Date(c),y=Math.floor(p.getMonth()/3)+1;return k?`${p.getFullYear()}년 ${y}분기`:`Q${y} ${p.getFullYear()}`})}else{let k=d.every(nt),c=m==="date"?new Intl.DateTimeFormat(f,$):new Intl.NumberFormat(f,k?{useGrouping:!1}:{maximumFractionDigits:6});M=d.length>1e3?In(d.length,p=>c.format(d[p])):d.map(p=>c.format(p))}let z=s?[...s]:u?pe(e.map((k,c)=>String(u(k,c)??""))):[""],K=new Map(z.map((k,c)=>[k,c])),D=z.map(()=>new Array(b.length).fill(NaN)),E=z.map(()=>new Array(b.length).fill(null)),_=o.aggregate??"sum",C=_==="mean"?z.map(()=>new Uint32Array(b.length)):null,R=(k,c,p,y)=>{let A=D[k][c];_==="last"?D[k][c]=p:_==="count"?D[k][c]=(Number.isFinite(A)?A:0)+1:_==="mean"?Number.isFinite(p)&&(D[k][c]=(Number.isFinite(A)?A:0)+p,C[k][c]++):D[k][c]=Number.isFinite(A)?A+(Number.isFinite(p)?p:0):p,E[k][c]=y};for(let k=0;k<e.length;k++){let c=x[k];if(c<0)continue;let p=e[k];if(s)for(let y=0;y<s.length;y++)R(y,c,ie(p[s[y]]),p);else{let y=u?K.get(String(u(p,k)??""))??0:0;R(y,c,ie(l(p,k)),p)}}if(C)for(let k=0;k<D.length;k++)for(let c=0;c<b.length;c++)C[k][c]>1&&(D[k][c]/=C[k][c]);return{type:m,keys:b,xnum:d,labels:M,series:z,values:D,rows:E}}var j=N(W(),1);var q=N(W(),1);function Ko(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Go(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function Hn(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(a=>{let s=Go(a[a.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:Ko(.25),rootMargin:"0px 0px -8% 0px"}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function Bn(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function jn(e){let[t,n]=(0,q.useState)(null),[r,o]=(0,q.useState)(e??null),i=(0,q.useCallback)(a=>{n(a),a&&e===void 0&&o(Bn(a))},[e]);return ne(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=u=>o(h=>h!==null&&Math.abs(h-u)<.5?h:u),s=()=>a(Bn(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let h=u[u.length-1]?.contentRect;h?a(h.width>0?Math.round(h.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var Uo=()=>()=>{};function We(){return(0,q.useSyncExternalStore)(Uo,()=>!0,()=>!1)}var zn="(prefers-reduced-motion: reduce)";function Vn(e="auto"){let[t,n]=(0,q.useState)(()=>oe&&typeof window.matchMedia=="function"?window.matchMedia(zn).matches:!1);return(0,q.useEffect)(()=>{if(e!=="auto"||!oe||typeof window.matchMedia!="function")return;let r=window.matchMedia(zn),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function Wn(e,t){let n=ae(e.theme),[r,o,i]=jn(e.width),a=We(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,h=Vn(e.reducedMotion??"auto"),m=e.animate!==!1&&!h&&oe,f=Hn(r,e.animateOnView!==!1&&m),b=ee(e.locale),d=V(b),x=(0,j.useMemo)(()=>Pe(e.format,b,t.format),[e.format,b,t.format]),$=(0,j.useCallback)(O=>Fe(O,{locale:b}),[b]),v=(0,j.useMemo)(()=>It(x,e.unit),[x,e.unit]),T=(0,j.useMemo)(()=>sn(e.data),[e.data]),[F,S]=(0,j.useState)(null),[M,z]=(0,j.useState)(null),K=(0,j.useRef)([]),D=(0,j.useRef)(e.onHover);D.current=e.onHover;let E=(0,j.useRef)(e.onClick);E.current=e.onClick;let _=(0,j.useRef)(null),C=(0,j.useRef)(null),R=(0,j.useRef)(null),k=(0,j.useCallback)((O,H="pointer")=>{if(R.current!==O){R.current=O;let ve=O===null?null:K.current[O]??null;queueMicrotask(()=>D.current?.(ve)),C.current?.(O)}_.current=O===null?null:H,S(O),z(_.current)},[]),c=(0,j.useCallback)(O=>{_.current!=="keyboard"&&(_.current=O===null?null:"sync",S(O),z(_.current))},[]),p=(0,j.useCallback)(O=>{let H=K.current[O];H&&E.current?.(H)},[]),y=Zt(e.replayKey),A=e.width!==void 0||(i??0)>0,I={enabled:m,active:f.visible&&A,near:f.near,replayKey:y,dataKey:T,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},X=(0,j.useCallback)((O,H=1)=>F===null||F===O?H:H*.38,[F]);return{p:n,width:s,height:u,measured:A,responsive:e.width===void 0,pending:oe&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:I,fv:v,fmt:x,pct:$,locale:b,lang:d,t:d==="ko"?Ft:Rt,active:F,via:M,setActive:k,click:p,events:K,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:X,sig:T,description:e.description,reduced:h,publish:C,applySync:c}}var B=N(W(),1);function qo(e){return 1-Math.pow(1-e,3)}function Xo(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Yo(e){return e==="easeInOut"?Xo:e==="linear"?t=>t:qo}function Jo(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 ke(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),i=Math.floor(o),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function Ke(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 Kn(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 Gn(e,t,n,r){if(!t||!n||t.length!==n.length)return ke(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let l of ke(s,n[a]))o.push(l)}return o.length===r?o:ke(e,r)}var Ge=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||!Ke(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 i=t.from??t.to,a=t.enter??i;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:i.slice(),enter:a.slice(),exit:(t.exit??a).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),i=this.make(r,r.to,0,0);o&&(i.order=o.order),i.done=!0,i.progress=1,n.set(r.key,i)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let i=this.tracks.get(o.key),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}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),Kn(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Ke(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,i=0;for(let a of t){o.add(a.key);let s=this.tracks.get(a.key),l=r>0?Math.min(i*r,240):0;if(s){let u=a.to.length;s.from=Gn(s.cur,s.parts,a.parts,u),s.vel=Gn(s.curVel,s.parts,a.parts,u),s.parts=a.parts,s.to=a.to.slice(),Kn(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=Ke(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<1e-6),s.progress=s.done?1:0}else{let u=this.make(a,a.enter??a.from??a.to,n+l,0);u.done=Ke(u.from,u.to),this.tracks.set(a.key,u)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=ke(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=Yo(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,u=s.to.length;if(s.from.length!==u&&(s.from=ke(s.from,u)),s.vel.length!==u&&(s.vel=ke(s.vel,u)),s.cur.length!==u&&(s.cur=new Array(u).fill(0),s.curVel=new Array(u).fill(0)),!(l>0)){for(let m=0;m<u;m++)s.cur[m]=s.from[m],s.curVel[m]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let m=Math.exp(-i*l),f=i*l>=8&&i*l<20,b=0;for(let d=0;d<u;d++){let x=s.from[d]-s.to[d],$=s.vel[d]+i*x;s.cur[d]=s.to[d]+(x+$*l)*m,s.curVel[d]=(s.vel[d]-i*$*l)*m,f&&b<.15&&(b=Math.max(b,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/i)))}h=i*l>=20||f&&b<.15,s.progress=Math.min(1,1-(1+i*l)*m)}else{let m=Math.min(1,l/o),f=r(m),b=Jo(this.easing,m)/o;for(let d=0;d<u;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*f,s.curVel[d]=(s.to[d]-s.from[d])*b;h=m>=1,s.progress=f}if(h){for(let m=0;m<u;m++)s.cur[m]=s.to[m],s.curVel[m]=0;s.done=!0,s.progress=1,s.exiting&&a.push(s.key)}else n=!0}for(let s of a)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}},Te=new Set,Ue=0;function Un(e){Ue=0;let t=Array.from(Te);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Te.delete(n)}Te.size&&typeof requestAnimationFrame<"u"&&(Ue=requestAnimationFrame(Un))}function qn(e){return Te.add(e),!Ue&&typeof requestAnimationFrame<"u"&&(Ue=requestAnimationFrame(Un)),()=>{Te.delete(e)}}function Zo(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 Xn(e,t){let n=(0,B.useMemo)(()=>Zo(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:u=900,stagger:h=0}=t,m=(0,B.useRef)(null),f=(0,B.useRef)("init"),b=(0,B.useRef)(null),d=(0,B.useRef)(s),x=(0,B.useRef)(a),$=(0,B.useRef)(!1),v=(0,B.useRef)(0),[,T]=(0,B.useState)(0),F=(0,B.useRef)(null),S=(0,B.useRef)(!0);m.current||(m.current=new Ge,m.current.configure(l,u),m.current.snap(n),b.current=n);let M=m.current;if(M.configure(l,u),b.current!==n){let C=f.current,R=!Object.is(d.current,s);M.sameTargets(n)?M.refreshData(n):!r||C==="init"?M.snap(n):C==="idle"?M.hold(n):C==="running"||R?M.update(n,Re(),h):M.snap(n),b.current=n,d.current=s}let z=(0,B.useRef)(()=>!1);z.current=C=>{if(!S.current)return!1;let R=M.step(C);return!R&&f.current==="running"&&(f.current="done"),T(k=>(k+1)%1e9),R||(F.current=null),R};let K=(0,B.useCallback)(()=>{if(!oe||F.current||!M.animating)return;let C=R=>z.current(R);F.current=qn(C)},[M]);ne(()=>{let C=!Object.is(x.current,a);if(x.current=a,!r){(f.current!=="done"||M.animating)&&(M.snap(b.current??n),f.current="done",T(R=>R+1));return}f.current==="init"||C&&i?(M.hold(b.current??n),f.current="idle",$.current=!1,T(R=>R+1)):C&&($.current=!0)},[r,a]),ne(()=>{!r||!i||!$.current||($.current=!1,M.hold(b.current??n),f.current="idle",T(C=>C+1))},[i,r]),(0,B.useEffect)(()=>{r&&o&&f.current==="idle"&&(M.start(Re()),v.current+=1,f.current="running",K(),T(C=>C+1))},[r,o,a,M,K]),(0,B.useEffect)(()=>{M.animating&&K()}),(0,B.useEffect)(()=>(S.current=!0,()=>{S.current=!1,F.current?.(),F.current=null}),[]);let D=Re(),E=M.elapsed(D),_=r&&f.current==="idle";return{items:M.items(),get:C=>M.get(C),elapsed:_?0:E,fade:(C,R=320)=>_?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-C)/R)):1,waiting:_,animating:M.animating,generation:v.current}}var Qo=N(W(),1);var Jn=N(L(),1);var Yn=e=>e?"neutralStrong":"accent";var pt=N(L(),1);function Zn(e,t,n,r){if(typeof e!="function")return le(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let l=o.get(r(a,s));l!==void 0&&e(a,s)&&i.add(l)}),i}var Se=N(W(),1);var J=N(L(),1),ea={kind:"Bump chart",rank:e=>`#${e}`,desc:(e,t,n)=>`Rank changes of ${he(e,"item")}, from ${t} to ${n}`},ta={en:ea,ko:{kind:"범프 차트",rank:e=>`${e}위`,desc:(e,t,n)=>`${e}개 항목의 순위 변화, ${t}부터 ${n}까지`}};function bt(e){let t=Wn(e,{height:c=>Math.max(200,Math.min(300,c*.55)),duration:1100,stagger:90}),{p:n,width:r,height:o}=t,i=e.rank!==void 0||e.value===void 0,a=(0,Se.useMemo)(()=>On(e.data,e.x,i?e.rank??"rank":e.value,e.series,{xType:"band",locale:t.locale,aggregate:"last"}),[e.data,e.x,e.rank,e.value,e.series,i,t.locale]),s=a.keys.length,l=a.series.length,u=(0,Se.useMemo)(()=>{let c=a.series.map(()=>new Array(s).fill(NaN));for(let A=0;A<s;A++)if(i)a.series.forEach((I,X)=>c[X][A]=a.values[X][A]);else{let I=a.series.map((O,H)=>Number.isFinite(a.values[H][A])?a.values[H][A]:-1/0),X=Mn(I,!0);a.series.forEach((O,H)=>c[H][A]=Number.isFinite(a.values[H][A])?X[H]:NaN)}let p=c.map(A=>{let I=A.find(Number.isFinite)??0,X=[...A].reverse().find(Number.isFinite)??0;return I-X}),y=le(e.highlight,a.series,a.series,p,"max");return a.series.map((A,I)=>({s:I,name:A,ranks:c[I],hi:y.has(I)}))},[a,s,i,e.highlight]),h=Math.max(l,...u.flatMap(c=>c.ranks.filter(Number.isFinite))),m=Math.min(r*.24,Math.max(...u.map(c=>me(c.name,11,800)),20)+16),f=ta[t.lang],b=Math.min(r*.26,Math.max(...u.map(c=>me(`${f.rank([...c.ranks].reverse().find(Number.isFinite)??"")} ${c.name}`,11,800)),20)+16),d=12,x=24,$=m,v=r-b,T=c=>s>1?$+c*(v-$)/(s-1):($+v)/2,F=(o-d-x)/Math.max(1,h-1||1),S=c=>d+(c-1)*F,M=t.motion.stagger??90,z=(0,Se.useMemo)(()=>[...u].sort((c,p)=>Number(c.hi)-Number(p.hi)),[u]),K=(0,Se.useMemo)(()=>z.map((c,p)=>({key:`b:${c.name}`,to:[1,...c.ranks.map(y=>Number.isFinite(y)?S(y):NaN)],from:[0,...c.ranks.map(y=>Number.isFinite(y)?S(y):NaN)],enter:[0,...c.ranks.map(y=>Number.isFinite(y)?S(y):NaN)],delay:p*M*.6,parts:[1,c.ranks.length],data:c})),[z,M,o,h]),D=Xn(K,t.motion),E=en(n,"accent"),_=a.keys.map((c,p)=>({datum:null,index:p,key:c,label:a.labels[p],value:null,formatted:[...u].filter(y=>Number.isFinite(y.ranks[p])).sort((y,A)=>y.ranks[p]-A.ranks[p]).map(y=>`${f.rank(y.ranks[p])} ${y.name}`).join(", ")})),C=null;if(t.active!==null&&a.keys[t.active]!==void 0){let c=t.active,p=[...u].filter(y=>Number.isFinite(y.ranks[c])).sort((y,A)=>y.ranks[c]-A.ranks[c]).map(y=>({label:y.name,value:f.rank(y.ranks[c]),color:y.hi?E.fill:n.paint("neutralStrong"),strong:y.hi}));C={x:T(c),y:d,title:a.labels[c],rows:Nn(p,t.t.more)}}let R=t.motion.duration??1100,k=e.description??`${f.kind}. ${f.desc(l,a.labels[0]??"",a.labels[s-1]??"")}.`;return(0,J.jsxs)(Fn,{c:t,kind:f.kind,ariaLabel:e.ariaLabel,description:k,events:_,tip:C,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(c,p,y)=>s&&t.setActive(Sn(c,$,v,s),y.pointerType==="touch"?"touch":"pointer"),children:[(0,J.jsx)("rect",{x:$,y:0,width:Math.max(0,v-$),height:o-x,fill:"transparent"}),t.active!==null?(0,J.jsx)("line",{x1:T(t.active),x2:T(t.active),y1:d-8,y2:o-x+2,stroke:n.paint("line2"),strokeWidth:Math.max(8,(v-$)/Math.max(1,s-1)*.6),pointerEvents:"none"}):null,D.items.map(c=>{let p=c.data,y=c.v[0],I=c.v.slice(1).map((H,ve)=>[T(ve),H]).filter(H=>Number.isFinite(H[1])),X=p.hi?E.fill:n.paint("neutralStrong"),O=y<.999;return(0,J.jsxs)("g",{opacity:c.exiting?.4:1,pointerEvents:"none",children:[(0,J.jsx)("path",{d:Tn(I),fill:"none",stroke:X,strokeOpacity:p.hi?1:.6,strokeWidth:p.hi?3.4:2,strokeLinecap:"round",strokeLinejoin:"round",pathLength:O?1:void 0,strokeDasharray:O?"1 1":void 0,strokeDashoffset:O?1-y:void 0}),I.map(([H,ve],vt)=>{let ur=I.length>1?vt/(I.length-1):1,cr=Math.max(0,Math.min(1,(y-ur)*8+(y>=.999?1:0)));return(0,J.jsx)("circle",{cx:H,cy:ve,r:p.hi?4.6:3.4,fill:p.hi?X:n.paint("panel"),stroke:X,strokeWidth:p.hi?0:1.6,opacity:Math.min(1,cr)},vt)})]},c.key)}),t.showLabels?u.map(c=>{let p=c.ranks.find(Number.isFinite),y=[...c.ranks].reverse().find(Number.isFinite),A=c.hi,I=n.paint(A?"ink":"muted");return(0,J.jsxs)("g",{opacity:D.fade(R*.55,300),children:[p!==void 0?(0,J.jsx)(ye,{x:$-10,y:S(p),anchor:"end",size:11,weight:A?800:500,fill:I,children:$e(c.name,m-10,11,A?800:500)}):null,y!==void 0?(0,J.jsx)(ye,{x:v+10,y:S(y),size:11,weight:A?800:500,fill:I,children:`${f.rank(y)} ${Dn(c.name,f.rank(y),b-10,11,A?800:500)}`}):null]},c.name)}):null,(0,J.jsx)(_n,{p:n,width:r,labels:a.labels,centers:a.keys.map((c,p)=>T(p)),y:o-x+14})]})}var na=N(W(),1);var xt=N(L(),1),ra={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}, ${he(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Qn={en:ra,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}일 이동평균`}},yt=["ink","muted","dim"];function er(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,yt.length)}var oa=N(W(),1);var or=N(L(),1),aa={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${he(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},ia={en:aa,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},tr=(e,t)=>ia[e].other(t);function nr(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((i,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,$n(o.map(i=>i.value)))}}var rr=e=>Number.isFinite(e)&&e>0?e:0;var de=N(L(),1);function ar(e,t){let n=He(e);return n?.type==="scatter"&&t?.size!==void 0?He("bubble"):n}function sa(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 la(e,t,n,r=!1){let o=ar(e.type,e.encoding);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&ft.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),u=m=>m.filter(f=>!l.has(f.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(h.includes(o.type)){let m=ze(i.label,"label"),f=rn(i.value,"value"),b=o.type==="waffle",d=t.map((S,M)=>({r:S,label:m(S,M),value:b?f(S,M):rr(f(S,M))})),{kept:x,other:$}=b?{kept:d,other:null}:nr(d,a.other,(S,M)=>({r:{},label:tr(V(n),S),value:M})),v=le(s,x.map(S=>S.r),x.map(S=>S.label),x.map(S=>S.value),b?"first":"max"),T=$?[...x,$]:x,F=Ce(T.length,v);return T.map((S,M)=>({label:S.label,color:F[M]}))}if(o.type==="candlestick"){let m=er(Array.isArray(a.ma)?a.ma:void 0,t.length),f=Qn[V(n)];return[{label:f.up,color:a.upColor??"accent"},{label:f.down,color:a.downColor??"neutralStrong"},...m.map((b,d)=>({label:f.maLegend(b),color:yt[d],shape:"line"}))]}if(o.type==="scatter"){if(typeof i.series!="string")return[];let m=ze(i.series,"series"),f=pe(t.map((d,x)=>m(d,x)));if(f.length<2)return[];let b=tn(f.length,Zn(s,t,f,m));return u(f.map((d,x)=>({label:d,color:b[x],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let m=[];if(Array.isArray(i.y))m=i.y;else if(typeof i.series=="string"){let x=ze(i.series,"series");m=pe(t.map(($,v)=>x($,v)))}let f=ht(o.type,i,a);if(f.length){let x=Ce(m.length,le(s,m,m,m.map(()=>0),"none")),$=m.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:m.map((v,T)=>({label:v,color:x[T]}));return[...u($),...f.map((v,T)=>({label:v,color:Yn(T),shape:"line"}))]}if(m.length<2)return[];let b=le(s,m,m,m.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return u(m.map((x,$)=>({label:x,color:b.has($)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let d=Ce(m.length,b);return u(m.map((x,$)=>({label:x,color:d[$]})))}return[]}function ir(e,t){let{spec:n}=e,r=ar(n.type,n.encoding),o=(0,Me.useMemo)(()=>An(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=kn(n,e.locale),s=ee(a),l=V(s),u=ln(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),h=wn(n),m=(0,Me.useMemo)(()=>h?gn(h,s):void 0,[h,s]),f=n.options?.hidden,b=Array.isArray(f)?f.map(String):[],d=b.join(""),[x,$]=(0,Me.useState)(null);if(!r)return(0,de.jsx)(ut,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let v=o??u.data,T=t[r.type],F={...n.options??{}},S={...sa(r,n.encoding),...F,...m?{tooltip:m}:{},data:v,...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:a},M=n.card?.legend==="toggle"&&vn(r.type,n.encoding??{},F),z=x&&x.base===d?x.hidden:b;M&&(S.hidden=z);let K=C=>$(R=>{let k=R&&R.base===d?R.hidden:b;return{base:d,hidden:k.includes(C)?k.filter(c=>c!==C):[...k,C]}}),D=S.height??220,E=i&&!v.length&&(u.loading||u.error||u.empty)?(0,de.jsx)(ut,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:D,locale:a}):(0,de.jsx)(T,{...S});if(n.card){let C=n.card,R=C.legend==="auto"||C.legend==="toggle"?la(n,v,s,M):C.legend,k=R?.length?M?(0,de.jsx)(lt,{items:R,hidden:z,onToggle:K,locale:a}):R:void 0,c=C.download?(0,de.jsx)(hn,{data:v,columns:Cn(n),filename:C.title??r.type,formats:Array.isArray(C.download)?C.download:void 0,locale:a}):void 0;E=(0,de.jsx)(Qt,{number:C.number,title:C.title??xn(r,l),subtitle:C.subtitle,legend:k,actions:c,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:a,children:E})}let _=e.theme??n.theme;return _&&(E=(0,de.jsx)(Ie,{theme:_,children:E})),E}function ua({cfg:e,components:t}){let n=We();return ir({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function lr(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,sr.hydrateRoot)(r,(0,kt.createElement)(Ie,{theme:o.theme,cssVars:!0},(0,kt.createElement)(ua,{cfg:o,components:{[e]:t}})))}lr("bump",bt);})();
|