ztd-charts-cli 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/api.js +1 -1
  2. package/dist/{chunk-GTATC42I.js → chunk-ZZGASY2Y.js} +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/client/area.js +5 -5
  5. package/dist/client/bar.js +5 -5
  6. package/dist/client/barRace.js +3 -3
  7. package/dist/client/beeswarm.js +3 -3
  8. package/dist/client/box.js +6 -6
  9. package/dist/client/bubble.js +6 -6
  10. package/dist/client/bullet.js +5 -5
  11. package/dist/client/bump.js +6 -6
  12. package/dist/client/calendar.js +5 -5
  13. package/dist/client/candlestick.js +4 -4
  14. package/dist/client/chord.js +5 -5
  15. package/dist/client/choropleth.js +5 -5
  16. package/dist/client/donut.js +6 -6
  17. package/dist/client/dumbbell.js +3 -3
  18. package/dist/client/flowMap.js +4 -4
  19. package/dist/client/funnel.js +3 -3
  20. package/dist/client/gauge.js +3 -3
  21. package/dist/client/heatmap.js +5 -5
  22. package/dist/client/histogram.js +5 -5
  23. package/dist/client/line.js +5 -5
  24. package/dist/client/lollipop.js +6 -6
  25. package/dist/client/marimekko.js +6 -6
  26. package/dist/client/network.js +5 -5
  27. package/dist/client/parallel.js +6 -6
  28. package/dist/client/pareto.js +5 -5
  29. package/dist/client/pie.js +6 -6
  30. package/dist/client/radar.js +6 -6
  31. package/dist/client/radialBar.js +3 -3
  32. package/dist/client/ridgeline.js +4 -4
  33. package/dist/client/sankey.js +4 -4
  34. package/dist/client/scatter.js +6 -6
  35. package/dist/client/segmented.js +3 -3
  36. package/dist/client/skyline.js +9 -9
  37. package/dist/client/slope.js +5 -5
  38. package/dist/client/sparkline.js +6 -6
  39. package/dist/client/stream.js +6 -6
  40. package/dist/client/sunburst.js +6 -6
  41. package/dist/client/symbolMap.js +5 -5
  42. package/dist/client/tileMap.js +6 -6
  43. package/dist/client/timeline.js +10 -10
  44. package/dist/client/tree.js +5 -5
  45. package/dist/client/treemap.js +3 -3
  46. package/dist/client/waffle.js +5 -5
  47. package/dist/client/waterfall.js +5 -5
  48. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- (()=>{var mo=Object.create;var an=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty;var xt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var bo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ho(t))!po.call(e,o)&&o!==n&&an(e,o,{get:()=>t[o],enumerable:!(r=fo(t,o))||r.enumerable});return e};var T=(e,t,n)=>(n=e!=null?mo(go(e)):{},bo(t||!e||!e.__esModule?an(n,"default",{value:e,enumerable:!0}):n,e));var H=xt((Ea,sn)=>{sn.exports=globalThis.__ztdReact.react});var cn=xt((Oa,ln)=>{ln.exports=globalThis.__ztdReact["react-dom/client"]});var L=xt((qa,In)=>{In.exports=globalThis.__ztdReact["react/jsx-runtime"]});var rn=T(H(),1),co=T(cn(),1);var Ve=T(H(),1);var rt=T(H(),1);var un=T(H(),1),Ce=(0,un.createContext)(void 0);var hn=T(H(),1);var yo=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],mn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',dn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ge={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:mn,monoFamily:dn,radius:18,radiusCode:14,radiusMark:4},kt={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:mn,monoFamily:dn,radius:18,radiusCode:14,radiusMark:4},wt={dark:ge,light:kt};function We(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function vt(e){let t={};for(let n of yo){let r=e[n];typeof r=="string"&&(t[We(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 $t(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 xo=`
1
+ (()=>{var mo=Object.create;var an=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty;var xt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var bo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ho(t))!po.call(e,o)&&o!==n&&an(e,o,{get:()=>t[o],enumerable:!(r=fo(t,o))||r.enumerable});return e};var T=(e,t,n)=>(n=e!=null?mo(go(e)):{},bo(t||!e||!e.__esModule?an(n,"default",{value:e,enumerable:!0}):n,e));var H=xt((Oi,sn)=>{sn.exports=globalThis.__ztdReact.react});var cn=xt((Ii,ln)=>{ln.exports=globalThis.__ztdReact["react-dom/client"]});var L=xt((Zi,In)=>{In.exports=globalThis.__ztdReact["react/jsx-runtime"]});var rn=T(H(),1),co=T(cn(),1);var Ve=T(H(),1);var rt=T(H(),1);var un=T(H(),1),Ce=(0,un.createContext)(void 0);var hn=T(H(),1);var yo=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],mn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',dn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ge={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:mn,monoFamily:dn,radius:18,radiusCode:14,radiusMark:4},kt={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:mn,monoFamily:dn,radius:18,radiusCode:14,radiusMark:4},wt={dark:ge,light:kt};function We(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function $t(e){let t={};for(let n of yo){let r=e[n];typeof r=="string"&&(t[We(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 vt(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 xo=`
2
2
  .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
3
  .ztd-root:focus{outline:none}
4
4
  .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ge.accent});outline-offset:3px;border-radius:6px}
@@ -19,10 +19,10 @@
19
19
  @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
20
  .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
21
  @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
- `;function gn(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function pn(e,t){let[n]=(0,hn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var fn=!1;function Oe(){if(fn||typeof document>"u"||(fn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=xo,document.head.appendChild(e)}var Ke=T(H(),1),ne=typeof window<"u"&&typeof document<"u",ce=ne?Ke.useLayoutEffect:Ke.useEffect;function Ue(){return typeof performance<"u"?performance.now():Date.now()}function j(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function de(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var bn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},yn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ko=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],wo={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function vo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function $o(e){return vo(ko,e)}function xn(e,t){let n=$o(e);return{text:n?n[t]:e,...wo[n?.id??"basic"]}}var kn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Se(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),kn[t.toLowerCase()]&&(t=kn[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 $n(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 Tt(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Ae(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wn(e){return .2126*Ae(e[0])+.7152*Ae(e[1])+.0722*Ae(e[2])}function Ct(e,t,n){let r=typeof e=="string"?Se(e):e,o=typeof t=="string"?Se(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Se(n):n:null;o[3]<1&&i&&(o=Tt(o,i));let a=r[3]<1?Tt(r,o):r,s=wn(a),l=wn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Mo(e){return[Ae(e[0]),Ae(e[1]),Ae(e[2])]}function Mt(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 vn(e){let[t,n,r]=Mo(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 To([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[Mt(4.0767416621*o-3.3077115913*i+.2309699292*a),Mt(-1.2684380046*o+2.6097574011*i-.3413193965*a),Mt(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function Xe(e,t,n){let r=Se(e),o=Se(t);if(!r||!o)return e;let i=vn(r),a=vn(o),s=Math.max(0,Math.min(1,n));return $n(To([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)))}function St(e,t,n){let r=t[0],o=-1;for(let i of t){let a=Ct(i,e,n);a>o&&(o=a,r=i)}return r}function V(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 Co(e,t){let n=St(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ct(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):St(t,["#FFFFFF","#000000"])}function Ye(e,t){let n=Xe(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Co(e,n),raw:n}}function re(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=V(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=V(e,"neutral");else if(s===0)r[a]=V(e,"ink");else if(s===i-1)r[a]=V(e,"neutral");else if(i===3)r[a]=V(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?V(e,"strong"):Ye(e,1-l)}}),r}var At="mix:";function pe(e){return e({theme:kt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${At}${o}`}).map(n=>n.fill)}function Mn(e,t){return t?.startsWith(At)?e.mix("neutralStrong","neutral",Number(t.slice(At.length))):e.color(t)}function Ie(e,t,n){return re(e,t+1,n).slice(0,t)}function Tn(e,t,n,r="neutral"){let o=V(e,"accent"),i=V(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function Cn(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=V(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=V(e,"neutral"):s===0?r[a]=V(e,"strong"):s===i-1?r[a]=V(e,"neutral"):r[a]=Ye(e,1-s/(i-1))}),r}var oe=T(H(),1);var qe=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),X="en-US",Sn=new Map;function Nt(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=Sn.get(r);return o||(o=new Intl.NumberFormat(e,n),Sn.set(r,o)),o}function Rt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ne(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;return Rt(Nt(n,r).format(e))}var Ft=e=>e!==0&&Math.abs(e)<.05,_t=(e,t,n="")=>`${Ne(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Je(e,t={}){if(!Number.isFinite(e))return"-";if(Ft(e)&&t.maximumFractionDigits===void 0)return _t(e,t.locale??X,"%");let n=Math.abs(e);return`${Ne(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Fn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;if(j(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],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+Ne(u,{locale:n,...r,maximumFractionDigits:d})+l}}return Rt(Nt(n,{notation:"compact",...r}).format(e))}var So=(e,t=j(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function we(e,t=X,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=Nt(t,o);return l=>Number.isFinite(l)?`${a}${Rt(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=>Je(o,{locale:t});case"ratio":return o=>Je(o*100,{locale:t});case"compact":return o=>Fn(o,{locale:t});case"currency":return r(So(t));default:{let o=r({maximumFractionDigits:1});return i=>Ft(i)?_t(i,t):o(i)}}}function _n(e,t=X,n=0){return e!==void 0?we(e,t):n>=1e5?r=>Ft(r)?_t(r,t):Fn(r,{locale:t}):r=>Ne(r,{locale:t})}function Ao(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Pt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,No=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Ro=["january","february","march","april","may","june","july","august","september","october","november","december"],An=e=>{let t=e.toLowerCase();return t.length<3?0:Ro.findIndex(n=>n.startsWith(t))+1},Nn=e=>+e+(+e<30?2e3:1900);function Pn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Fo=[/^(\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})일)?$/],Dn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Ln=/\{([^{}]+)\}/g;function Ze(e,t){let n;for(let r of Fo)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?[Nn(n[3]),+n[2],+n[1],1]:[Nn(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=Dn.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=An(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=An(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var En=e=>No.test(e)||Ze(e)!==null;function On(e){let t;for(let n of e){let r=typeof n=="string"?Dn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Qe(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(Pt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Qe(`${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=Ze(n,t);if(r)return Ao(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 Rn=new Map;function ze(e,t={month:"short",day:"numeric"}){let n=Qe(e);if(!n)return"-";let{locale:r=X,...o}=t,i=r+JSON.stringify(o),a=Rn.get(i);return a||(a=new Intl.DateTimeFormat(r,o),Rn.set(i,a)),a.format(n)}var Dt=T(L(),1),et=(0,oe.createContext)({theme:ge,cssVars:!0});function _o(e,t=ge){return e?typeof e=="string"?wt[e]??t:$t(t,e):t}function tt(e){let t=(0,oe.useContext)(et),n=e.base?wt[e.base]:t.theme,r=(0,oe.useMemo)(()=>_o(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,oe.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,oe.useMemo)(()=>vt(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Dt.jsx)(et.Provider,{value:a,children:(0,Dt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Po=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function zn(e){return Po.has(e)}function Do(e,t){let n=r=>t?`var(${We(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?zn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?zn(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)})`:Xe(e[r],e[o],i)}}}function ie(e){let t=(0,oe.useContext)(et);return(0,oe.useMemo)(()=>{let n=$t(t.theme,e);return Do(n,t.cssVars)},[t.theme,t.cssVars,e])}function J(e){let t=(0,oe.useContext)(et);return e??t.locale??X}function Bn(e){return e?vt(e):{}}var nt=T(H(),1),Lt=(0,nt.createContext)(void 0);function Hn(e){let t=(0,nt.useContext)(Lt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var C=T(L(),1),Lo={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`},Eo={en:Lo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Oo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Et=e=>Eo[j(J(e))];function Ot(e){let t=ie(e.theme),n=Et(e.locale),[r,o]=(0,rt.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(0,C.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((d,u)=>{let f=!s.has(d.label),h=f&&l===1,m=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Io,{p:t,item:d,off:!f}),(0,C.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,C.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,C.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":h||void 0,onClick:()=>{h||(a(d.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:h?"default":void 0},children:m}):m},u)})});return a?(0,C.jsxs)(C.Fragment,{children:[c,(0,C.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Oo,children:r?n.shown(l,e.items.length):""})]}):c}function Io({p:e,item:t,off:n}){let r=Mn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,C.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,C.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,C.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,C.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 zo(e){let t=ie(e.theme),n=xn(e.level,j(J(e.locale)));return(0,C.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 Bo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,C.jsxs)(C.Fragment,{children:[e.slice(0,r),(0,C.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function jn(e){let t=ie(e.theme),n=Et(e.locale),[r,o]=(0,rt.useState)(0);ce(()=>Oe(),[]);let i=()=>{o(f=>f+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,C.jsx)(Ot,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=e.source!==void 0||e.note!==void 0?(0,C.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,C.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,C.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,C.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,C.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,C.jsx)(zo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,C.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,C.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,C.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,C.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:Bo(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,C.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,C.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,C.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,C.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,C.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,C.jsx)("span",{}),a]}):null]}),(0,C.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,C.jsx)(Lt.Provider,{value:r,children:(0,C.jsx)(Ce.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,C.jsxs)(C.Fragment,{children:[d,u]}):u]})}function It(e){let t=ie(e.theme),n=Et(e.locale),r=e.height??220;if(ce(()=>Oe(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,C.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,C.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,C.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,C.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,C.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,C.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,C.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,C.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,C.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,C.jsx)(C.Fragment,{children:e.children})}var De=T(H(),1);var q=T(H(),1);var z=T(L(),1),ot=60;var it={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Gn(e){let{c:t,events:n}=e,r=(0,q.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,ce(()=>{Oe()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,q.useContext)(Ce),c=e.ariaLabel??l??e.kind,d=(0,q.useMemo)(()=>s?`${n.length}${n.slice(0,ot).map(g=>`${g.label}${g.series??""}${g.formatted??g.value??""}`).join("")}`:"",[n,s]),u=(0,q.useMemo)(()=>(0,z.jsx)(Ho,{label:c,events:n,t:t.t}),[c,d,t.t]),f=(0,q.useRef)(null);(0,q.useEffect)(()=>{let g=()=>{f.current=null};return window.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{window.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[]),(0,q.useEffect)(()=>{f.current=null},[t.width,t.height]);let h=g=>{if(g.target!==g.currentTarget)return;if(e.onKey?.(g)){g.preventDefault();return}let w=t.active,A;switch(g.key){case"ArrowRight":case"ArrowDown":A=w===null?0:(w+1)%a;break;case"ArrowLeft":case"ArrowUp":A=w===null?a-1:(w-1+a)%a;break;case"Home":A=0;break;case"End":A=a-1;break;case"Escape":if(w===null)return;A=null;break;case"Enter":case" ":w!==null&&(g.preventDefault(),t.click(w));return;default:return}g.preventDefault(),t.setActive(A,"keyboard")},{via:m,node:p,setActive:v}=t;(0,q.useEffect)(()=>{if(m!=="touch"||!p)return;let g=w=>{p.contains(w.target)||v(null)};return document.addEventListener("pointerdown",g),()=>document.removeEventListener("pointerdown",g)},[m,p,v]);let k=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,M=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,R=typeof e.renderTip=="function"&&k?e.renderTip(k):null,x=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${a})`:""),N;if($){let g=$.x*M,w=t.width*M,A=`clamp(${(4-g).toFixed(1)}px, -50%, calc(${(w-g-4).toFixed(1)}px - 100%))`,_=$.y<64;N={position:"absolute",left:g,top:$.y*M,transform:`translate(${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*M-8)}}let P=g=>{f.current=null,g.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},D=g=>g?w=>{let A=f.current??(f.current=w.currentTarget.getBoundingClientRect());A.width&&g((w.clientX-A.left)/A.width*t.width,(w.clientY-A.top)/A.height*t.height,w)}:void 0,O=D(e.onPointerMove),E=D(e.onPointerDown),F=O||E?g=>{g.pointerType==="touch"&&O?.(g),E?.(g)}:void 0,S=D(e.onPointerUp),y=Bn(e.theme);return(0,z.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:g=>{t.via==="keyboard"&&!g.currentTarget.contains(g.relatedTarget)&&t.setActive(null)},onPointerLeave:P,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"),...y,...e.style},children:[t.pending?null:e.underlay,(0,z.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:O,onPointerDown:F,onPointerUp:S,onPointerCancel:S,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,z.jsx)("title",{id:o,children:c}),(0,z.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,z.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,z.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:R??(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((g,w)=>(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,z.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(g.strong?"ink":"muted")},children:[g.color?(0,z.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:g.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,g.label]}),(0,z.jsx)("span",{style:{fontWeight:g.strong===!1?500:700},children:g.value})]},w))]})}):null,(0,z.jsx)("span",{className:"ztd-sr",style:it,"aria-live":"polite","aria-atomic":"true",children:x}),s&&!t.pending?u:null]})}function Ho({label:e,events:t,t:n}){return(0,z.jsx)("div",{className:"ztd-sr",style:it,children:(0,z.jsxs)("table",{children:[(0,z.jsx)("caption",{children:n.table(e)}),(0,z.jsxs)("tbody",{children:[t.slice(0,ot).map((r,o)=>(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,z.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>ot?(0,z.jsx)("tr",{children:(0,z.jsx)("td",{colSpan:2,children:n.more(t.length-ot)})}):null]})]})})}function zt(e){let t=e.baseline??"central";return(0,z.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})}var b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Q=b("label","string",!0,"Item name field"),K=b("value","number",!0,"Value field"),jo=[Q,K],Go=[Q,K],Vo=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],Wo=[Q,K],Ko=[b("label","string",!0,"Leaf (lowest level) name"),K,b("group","string",!1,"Parent group field")],Uo=[b("label","string",!0,"Leaf name"),K,b("group","string",!1,"Parent group field")],Xo=[Q,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],Yo=[Q,K],Jo=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),K],qo=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),K],Zo=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],Qo=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],Wn=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ei=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Wn],ti=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),Wn],ni=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],ri=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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})],oi=[Q,K],ii=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],ai=[Q,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],si=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],li=[Q,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],ci=[Q,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],ui=[Q,K],mi=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],di=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],fi=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),K],hi=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),K],gi=[b("date","date",!0,"Date field"),K],pi=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],bi=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],yi=[b("label","string",!1,"Row name field")],xi=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],ki=[Q,K],wi=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],vi=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],$i=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),K],Mi=[Q,K,b("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Ti=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],Ci=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Si=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Ai=[b("region","string",!0,"Region name or code, matched to a region of options.map"),K],Ni=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Ri=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],Fi=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],Vn={pie:jo,donut:Go,funnel:Vo,waffle:Wo,treemap:Ko,sunburst:Uo,waterfall:Xo,pareto:Yo,marimekko:Jo,heatmap:qo,radar:Zo,bubble:Qo,line:ei,area:ti,stream:ni,bar:ri,radialBar:oi,gauge:ii,bullet:ai,sparkline:si,slope:li,dumbbell:ci,lollipop:ui,beeswarm:mi,ridgeline:di,sankey:fi,chord:hi,calendar:gi,bump:pi,box:bi,parallel:yi,candlestick:xi,segmented:ki,skyline:wi,histogram:vi,scatter:Fi,tileMap:$i,barRace:Mi,network:Ti,timeline:Ci,tree:Si,choropleth:Ai,symbolMap:Ni,flowMap:Ri},Re={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:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function Kn(e,t){return t==="ko"?e.nameKo:e.name}function Un(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Xn=["line","area","bar","scatter"],Yn=24,Bt=["line","area","bar","scatter","timeline"];function Ht(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Jn(e,t,n){return Bt.includes(e)&&!Ht(e,t,n).length&&!(e==="scatter"&&at(n))}function at(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function qn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var _i={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",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function st(e){let t=Vn[e]?e:_i[e]??Object.keys(Re).find(n=>n.toLowerCase()===e.toLowerCase()||Re[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Re[t]))return{type:t,component:Re[t].component,name:Re[t].name,nameKo:Re[t].nameKo,encoding:Vn[t]}}function Zn(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 st(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]}function Qn(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Pi(e,t){if(e==null||typeof e!="object")return;let n=e;if(Qn(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Qn(r,o))return;r=r[o]}return r}}function ue(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 ve(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Pi(r,n)}function lt(e,t){let n=ve(e,t);return(r,o)=>ue(n(r,o))}function fe(e,t){let n=ve(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 ae(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Di(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
- `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,i=[","," ",";","|"],a=",",s=0;for(let l of i){let c=o(l);c>s&&(s=c,a=l)}return a}var Li=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function er(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Li.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ue(t);if(Number.isFinite(n))return n}return t}function $e(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??Di(o),a=[],s=[],l="",c=!1;for(let m=0;m<o.length;m++){let p=o[m];c?p==='"'?o[m+1]==='"'?(l+='"',m++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===i?(s.push(l),l=""):p===`
22
+ `;function gn(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function pn(e,t){let[n]=(0,hn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var fn=!1;function Oe(){if(fn||typeof document>"u"||(fn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=xo,document.head.appendChild(e)}var Ke=T(H(),1),ne=typeof window<"u"&&typeof document<"u",ce=ne?Ke.useLayoutEffect:Ke.useEffect;function Ue(){return typeof performance<"u"?performance.now():Date.now()}function j(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function de(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var bn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},yn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ko=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],wo={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function $o(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function vo(e){return $o(ko,e)}function xn(e,t){let n=vo(e);return{text:n?n[t]:e,...wo[n?.id??"basic"]}}var kn={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Se(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),kn[t.toLowerCase()]&&(t=kn[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 vn(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 Tt(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Ae(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function wn(e){return .2126*Ae(e[0])+.7152*Ae(e[1])+.0722*Ae(e[2])}function Ct(e,t,n){let r=typeof e=="string"?Se(e):e,o=typeof t=="string"?Se(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Se(n):n:null;o[3]<1&&a&&(o=Tt(o,a));let i=r[3]<1?Tt(r,o):r,s=wn(i),l=wn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Mo(e){return[Ae(e[0]),Ae(e[1]),Ae(e[2])]}function Mt(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 $n(e){let[t,n,r]=Mo(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 To([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[Mt(4.0767416621*o-3.3077115913*a+.2309699292*i),Mt(-1.2684380046*o+2.6097574011*a-.3413193965*i),Mt(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Xe(e,t,n){let r=Se(e),o=Se(t);if(!r||!o)return e;let a=$n(r),i=$n(o),s=Math.max(0,Math.min(1,n));return vn(To([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)))}function St(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Ct(a,e,n);i>o&&(o=i,r=a)}return r}function V(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 Co(e,t){let n=St(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ct(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):St(t,["#FFFFFF","#000000"])}function Ye(e,t){let n=Xe(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Co(e,n),raw:n}}function re(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=V(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=V(e,"neutral");else if(s===0)r[i]=V(e,"ink");else if(s===a-1)r[i]=V(e,"neutral");else if(a===3)r[i]=V(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?V(e,"strong"):Ye(e,1-l)}}),r}var At="mix:";function pe(e){return e({theme:kt,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${At}${o}`}).map(n=>n.fill)}function Mn(e,t){return t?.startsWith(At)?e.mix("neutralStrong","neutral",Number(t.slice(At.length))):e.color(t)}function Ie(e,t,n){return re(e,t+1,n).slice(0,t)}function Tn(e,t,n,r="neutral"){let o=V(e,"accent"),a=V(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function Cn(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=V(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=V(e,"neutral"):s===0?r[i]=V(e,"strong"):s===a-1?r[i]=V(e,"neutral"):r[i]=Ye(e,1-s/(a-1))}),r}var oe=T(H(),1);var qe=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),X="en-US",Sn=new Map;function Nt(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=Sn.get(r);return o||(o=new Intl.NumberFormat(e,n),Sn.set(r,o)),o}function Rt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Ne(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;return Rt(Nt(n,r).format(e))}var Ft=e=>e!==0&&Math.abs(e)<.05,_t=(e,t,n="")=>`${Ne(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Je(e,t={}){if(!Number.isFinite(e))return"-";if(Ft(e)&&t.maximumFractionDigits===void 0)return _t(e,t.locale??X,"%");let n=Math.abs(e);return`${Ne(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Fn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=X,...r}=t;if(j(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],c=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**d)/10**d;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+Ne(u,{locale:n,...r,maximumFractionDigits:d})+l}}return Rt(Nt(n,{notation:"compact",...r}).format(e))}var So=(e,t=j(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function we(e,t=X,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Nt(t,o);return l=>Number.isFinite(l)?`${i}${Rt(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=>Je(o,{locale:t});case"ratio":return o=>Je(o*100,{locale:t});case"compact":return o=>Fn(o,{locale:t});case"currency":return r(So(t));default:{let o=r({maximumFractionDigits:1});return a=>Ft(a)?_t(a,t):o(a)}}}function _n(e,t=X,n=0){return e!==void 0?we(e,t):n>=1e5?r=>Ft(r)?_t(r,t):Fn(r,{locale:t}):r=>Ne(r,{locale:t})}function Ao(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var Pt=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,No=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Ro=["january","february","march","april","may","june","july","august","september","october","november","december"],An=e=>{let t=e.toLowerCase();return t.length<3?0:Ro.findIndex(n=>n.startsWith(t))+1},Nn=e=>+e+(+e<30?2e3:1900);function Pn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Fo=[/^(\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})일)?$/],Dn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Ln=/\{([^{}]+)\}/g;function Ze(e,t){let n;for(let r of Fo)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?[Nn(n[3]),+n[2],+n[1],1]:[Nn(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=Dn.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=An(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=An(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var En=e=>No.test(e)||Ze(e)!==null;function On(e){let t;for(let n of e){let r=typeof n=="string"?Dn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Qe(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(Pt(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Qe(`${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=Ze(n,t);if(r)return Ao(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 Rn=new Map;function ze(e,t={month:"short",day:"numeric"}){let n=Qe(e);if(!n)return"-";let{locale:r=X,...o}=t,a=r+JSON.stringify(o),i=Rn.get(a);return i||(i=new Intl.DateTimeFormat(r,o),Rn.set(a,i)),i.format(n)}var Dt=T(L(),1),et=(0,oe.createContext)({theme:ge,cssVars:!0});function _o(e,t=ge){return e?typeof e=="string"?wt[e]??t:vt(t,e):t}function tt(e){let t=(0,oe.useContext)(et),n=e.base?wt[e.base]:t.theme,r=(0,oe.useMemo)(()=>_o(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,oe.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,oe.useMemo)(()=>$t(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Dt.jsx)(et.Provider,{value:i,children:(0,Dt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var Po=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function zn(e){return Po.has(e)}function Do(e,t){let n=r=>t?`var(${We(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?zn(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?zn(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)})`:Xe(e[r],e[o],a)}}}function ae(e){let t=(0,oe.useContext)(et);return(0,oe.useMemo)(()=>{let n=vt(t.theme,e);return Do(n,t.cssVars)},[t.theme,t.cssVars,e])}function J(e){let t=(0,oe.useContext)(et);return e??t.locale??X}function Bn(e){return e?$t(e):{}}var nt=T(H(),1),Lt=(0,nt.createContext)(void 0);function Hn(e){let t=(0,nt.useContext)(Lt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var C=T(L(),1),Lo={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`},Eo={en:Lo,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var Oo={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Et=e=>Eo[j(J(e))];function Ot(e){let t=ae(e.theme),n=Et(e.locale),[r,o]=(0,rt.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,c=(0,C.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((d,u)=>{let f=!s.has(d.label),h=f&&l===1,m=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Io,{p:t,item:d,off:!f}),(0,C.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,C.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,C.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":h||void 0,onClick:()=>{h||(i(d.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:h?"default":void 0},children:m}):m},u)})});return i?(0,C.jsxs)(C.Fragment,{children:[c,(0,C.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:Oo,children:r?n.shown(l,e.items.length):""})]}):c}function Io({p:e,item:t,off:n}){let r=Mn(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,C.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,C.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,C.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,C.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 zo(e){let t=ae(e.theme),n=xn(e.level,j(J(e.locale)));return(0,C.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 Bo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,C.jsxs)(C.Fragment,{children:[e.slice(0,r),(0,C.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function jn(e){let t=ae(e.theme),n=Et(e.locale),[r,o]=(0,rt.useState)(0);ce(()=>Oe(),[]);let a=()=>{o(f=>f+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,C.jsx)(Ot,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,d=e.source!==void 0||e.note!==void 0?(0,C.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,C.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,C.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,C.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,C.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,C.jsx)(zo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,C.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,C.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,C.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,C.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:Bo(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,C.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,C.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,C.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,C.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,C.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,C.jsx)("span",{}),i]}):null]}),(0,C.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,C.jsx)(Lt.Provider,{value:r,children:(0,C.jsx)(Ce.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,C.jsxs)(C.Fragment,{children:[d,u]}):u]})}function It(e){let t=ae(e.theme),n=Et(e.locale),r=e.height??220;if(ce(()=>Oe(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,C.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,C.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,C.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,C.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,C.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,C.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,C.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,C.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,C.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,C.jsx)(C.Fragment,{children:e.children})}var De=T(H(),1);var q=T(H(),1);var z=T(L(),1),ot=60;var at={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Gn(e){let{c:t,events:n}=e,r=(0,q.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ce(()=>{Oe()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,q.useContext)(Ce),c=e.ariaLabel??l??e.kind,d=(0,q.useMemo)(()=>s?`${n.length}${n.slice(0,ot).map(g=>`${g.label}${g.series??""}${g.formatted??g.value??""}`).join("")}`:"",[n,s]),u=(0,q.useMemo)(()=>(0,z.jsx)(Ho,{label:c,events:n,t:t.t}),[c,d,t.t]),f=(0,q.useRef)(null);(0,q.useEffect)(()=>{let g=()=>{f.current=null};return window.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{window.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[]),(0,q.useEffect)(()=>{f.current=null},[t.width,t.height]);let h=g=>{if(g.target!==g.currentTarget)return;if(e.onKey?.(g)){g.preventDefault();return}let w=t.active,A;switch(g.key){case"ArrowRight":case"ArrowDown":A=w===null?0:(w+1)%i;break;case"ArrowLeft":case"ArrowUp":A=w===null?i-1:(w-1+i)%i;break;case"Home":A=0;break;case"End":A=i-1;break;case"Escape":if(w===null)return;A=null;break;case"Enter":case" ":w!==null&&(g.preventDefault(),t.click(w));return;default:return}g.preventDefault(),t.setActive(A,"keyboard")},{via:m,node:p,setActive:$}=t;(0,q.useEffect)(()=>{if(m!=="touch"||!p)return;let g=w=>{p.contains(w.target)||$(null)};return document.addEventListener("pointerdown",g),()=>document.removeEventListener("pointerdown",g)},[m,p,$]);let k=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,M=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,R=typeof e.renderTip=="function"&&k?e.renderTip(k):null,x=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${i})`:""),N;if(v){let g=v.x*M,w=t.width*M,A=`clamp(${(4-g).toFixed(1)}px, -50%, calc(${(w-g-4).toFixed(1)}px - 100%))`,_=v.y<64;N={position:"absolute",left:g,top:v.y*M,transform:`translate(${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*M-8)}}let P=g=>{f.current=null,g.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},D=g=>g?w=>{let A=f.current??(f.current=w.currentTarget.getBoundingClientRect());A.width&&g((w.clientX-A.left)/A.width*t.width,(w.clientY-A.top)/A.height*t.height,w)}:void 0,O=D(e.onPointerMove),E=D(e.onPointerDown),F=O||E?g=>{g.pointerType==="touch"&&O?.(g),E?.(g)}:void 0,S=D(e.onPointerUp),y=Bn(e.theme);return(0,z.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:g=>{t.via==="keyboard"&&!g.currentTarget.contains(g.relatedTarget)&&t.setActive(null)},onPointerLeave:P,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"),...y,...e.style},children:[t.pending?null:e.underlay,(0,z.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:O,onPointerDown:F,onPointerUp:S,onPointerCancel:S,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,z.jsx)("title",{id:o,children:c}),(0,z.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,z.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,v?(0,z.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:R??(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:v.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:v.title}),v.rows.map((g,w)=>(0,z.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,z.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(g.strong?"ink":"muted")},children:[g.color?(0,z.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:g.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,g.label]}),(0,z.jsx)("span",{style:{fontWeight:g.strong===!1?500:700},children:g.value})]},w))]})}):null,(0,z.jsx)("span",{className:"ztd-sr",style:at,"aria-live":"polite","aria-atomic":"true",children:x}),s&&!t.pending?u:null]})}function Ho({label:e,events:t,t:n}){return(0,z.jsx)("div",{className:"ztd-sr",style:at,children:(0,z.jsxs)("table",{children:[(0,z.jsx)("caption",{children:n.table(e)}),(0,z.jsxs)("tbody",{children:[t.slice(0,ot).map((r,o)=>(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,z.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>ot?(0,z.jsx)("tr",{children:(0,z.jsx)("td",{colSpan:2,children:n.more(t.length-ot)})}):null]})]})})}function zt(e){let t=e.baseline??"central";return(0,z.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})}var b=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Q=b("label","string",!0,"Item name field"),K=b("value","number",!0,"Value field"),jo=[Q,K],Go=[Q,K],Vo=[b("label","string",!0,"Stage name"),b("value","number",!0,"Users at the stage")],Wo=[Q,K],Ko=[b("label","string",!0,"Leaf (lowest level) name"),K,b("group","string",!1,"Parent group field")],Uo=[b("label","string",!0,"Leaf name"),K,b("group","string",!1,"Parent group field")],Xo=[Q,b("value","number",!0,"Change (total rows may omit it)"),b("type","string",!1,'"total" makes a total bar')],Yo=[Q,K],Jo=[b("x","string",!0,"Column field"),b("series","string",!0,"Stacked series field"),K],qo=[b("x","string",!0,"Column field"),b("y","string",!0,"Row field"),K],Zo=[b("axis","string",!0,"Metric (axis) field"),b("value","number",!0,"Value field",{multi:!0}),b("series","string",!1,"Series field")],Qo=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("size","number",!1,"Circle size"),b("label","string",!1,"Name")],Wn=b("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),ea=[b("x","any",!0,"x field (date, number or category)"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables)"),b("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Wn],ta=[b("x","any",!0,"x field"),b("y","number",!0,"y field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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}),Wn],na=[b("x","any",!0,"x field"),b("y","number",!0,"y field",{multi:!0}),b("series","string",!1,"Series field")],ra=[b("x","string",!0,"Category field"),b("y","number",!0,"Value field. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field"),b("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})],oa=[Q,K],aa=[b("value","number",!0,"Value field",{prop:"valueKey"}),b("target","number",!1,"Target field",{prop:"targetKey"})],ia=[Q,b("value","number",!0,"Actual value field"),b("target","number",!1,"Target field")],sa=[b("x","any",!1,"x field"),b("y","number",!0,"y field")],la=[Q,b("x","string",!1,"Period field (long tables)"),b("value","number",!1,"Value field (long tables)")],ca=[Q,b("start","number",!0,"Before value"),b("end","number",!0,"After value")],ua=[Q,K],ma=[b("value","number",!0,"Value field"),b("group","string",!1,"Group (row) field"),b("label","string",!1,"Dot name")],da=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],fa=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),K],ha=[b("source","string",!0,"Sending group"),b("target","string",!0,"Receiving group"),K],ga=[b("date","date",!0,"Date field"),K],pa=[b("x","any",!0,"Period field"),b("series","string",!0,"Item field"),b("rank","number",!1,"Rank field (1 is first)"),b("value","number",!1,"Value field (instead of rank, largest is first)")],ba=[b("group","string",!0,"Group field"),b("value","number",!0,"Value field")],ya=[b("label","string",!1,"Row name field")],xa=[b("x","date",!0,"Date (period) field"),b("open","number",!0,"Open price field"),b("high","number",!0,"High price field"),b("low","number",!0,"Low price field"),b("close","number",!0,"Close price field"),b("volume","number",!1,"Volume field")],ka=[Q,K],wa=[b("x","any",!0,"Period field (date or category)"),b("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),b("series","string",!1,"Series field (long tables, back row only)"),b("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],$a=[b("value","number",!1,"Sample value field (raw rows)"),b("group","string",!1,"Group field. Up to 2 groups overlap"),b("x0","number",!1,"Bin start (pre-binned rows)"),b("x1","number",!1,"Bin end (pre-binned rows)"),b("count","number",!1,"Samples in the bin (pre-binned rows)")],va=[b("region","string",!0,"Region name or code, matched to a tile of options.map"),K],Ma=[Q,K,b("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Ta=[b("source","string",!0,"Source node"),b("target","string",!0,"Target node"),b("value","number",!1,"Link weight. Without it every row counts 1")],Ca=[b("label","string",!0,"Row name. Items with the same name share a row"),b("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),b("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),b("group","string",!1,"Group field (one color per group, and the legend)"),b("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Sa=[b("label","string",!0,"Node name field"),b("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),b("group","string",!1,"Parent group field (flat rows, as in the treemap)"),b("id","string",!1,"Row id for id/parent rows. Defaults to the label"),b("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],Aa=[b("region","string",!0,"Region name or code, matched to a region of options.map"),K],Na=[b("lon","number",!1,"Longitude (degrees)"),b("lat","number",!1,"Latitude (degrees)"),b("size","number",!1,"Value (circle area). Without it all circles match"),b("label","string",!1,"Place name"),b("region","string",!1,"Region of options.map, for rows without lon and lat"),b("group","string",!1,"Group field (one color per group)")],Ra=[b("source","string",!0,"Start: a name in options.places or a region"),b("target","string",!0,"End"),b("value","number",!1,"Amount. Without it each row counts 1")],Fa=[b("x","number",!0,"x value"),b("y","number",!0,"y value"),b("series","string",!1,"Series field (one color per series)"),b("label","string",!1,"Name")],Vn={pie:jo,donut:Go,funnel:Vo,waffle:Wo,treemap:Ko,sunburst:Uo,waterfall:Xo,pareto:Yo,marimekko:Jo,heatmap:qo,radar:Zo,bubble:Qo,line:ea,area:ta,stream:na,bar:ra,radialBar:oa,gauge:aa,bullet:ia,sparkline:sa,slope:la,dumbbell:ca,lollipop:ua,beeswarm:ma,ridgeline:da,sankey:fa,chord:ha,calendar:ga,bump:pa,box:ba,parallel:ya,candlestick:xa,segmented:ka,skyline:wa,histogram:$a,scatter:Fa,tileMap:va,barRace:Ma,network:Ta,timeline:Ca,tree:Sa,choropleth:Aa,symbolMap:Na,flowMap:Ra},Re={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:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function Kn(e,t){return t==="ko"?e.nameKo:e.name}function Un(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Xn=["line","area","bar","scatter"],Yn=24,Bt=["line","area","bar","scatter","timeline"];function Ht(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Jn(e,t,n){return Bt.includes(e)&&!Ht(e,t,n).length&&!(e==="scatter"&&it(n))}function it(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function qn(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var _a={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",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function st(e){let t=Vn[e]?e:_a[e]??Object.keys(Re).find(n=>n.toLowerCase()===e.toLowerCase()||Re[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Re[t]))return{type:t,component:Re[t].component,name:Re[t].name,nameKo:Re[t].nameKo,encoding:Vn[t]}}function Zn(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 st(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]}function Qn(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Pa(e,t){if(e==null||typeof e!="object")return;let n=e;if(Qn(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Qn(r,o))return;r=r[o]}return r}}function ue(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 $e(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Pa(r,n)}function lt(e,t){let n=$e(e,t);return(r,o)=>ue(n(r,o))}function fe(e,t){let n=$e(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 ie(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Da(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
+ `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var La=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function er(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(La.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ue(t);if(Number.isFinite(n))return n}return t}function ve(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Da(o),i=[],s=[],l="",c=!1;for(let m=0;m<o.length;m++){let p=o[m];c?p==='"'?o[m+1]==='"'?(l+='"',m++):c=!1:l+=p:p==='"'&&!l.trim()?(c=!0,l=""):p===a?(s.push(l),l=""):p===`
24
24
  `||p==="\r"?(p==="\r"&&o[m+1]===`
25
- `&&m++,s.push(l),a.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),a.push(s));let d=a.filter(m=>!(m.length===1&&m[0].trim()===""));if(!d.length)return[];let u=m=>n?er(m):m;if(!r)return d.map(m=>Object.fromEntries(m.map((p,v)=>[String(v),u(p)])));let f=[],h=new Set;return d[0].forEach((m,p)=>{let v=m.trim()||`col${p+1}`,k=v;for(let $=2;h.has(k);$++)k=`${v}_${$}`;h.add(k),f.push(k)}),d.slice(1).map(m=>Object.fromEntries(f.map((p,v)=>[p,u(m[v]??"")])))}function jt(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"?er(a[l]):a[l]??null])))}function Ei(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(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function tr(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 be(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return be(JSON.parse(t))}catch{}return $e(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?jt(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)?be(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?jt(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)?be(t.rows):Array.isArray(t.values)?jt(t.values):Array.isArray(t.items)?be(t.items):Array.isArray(t.results)?be(t.results):Ei(t)}return[]}function ct(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)}`}function Gt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let f=0;f<n;f++){let h=a(f,c),m=h-a(f,c-1),p=0;for(let v=0;v<f;v++)p+=a(v,c)-a(v,c-1);d+=h,u+=(m/2+p)*h}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,f=0;for(let h=0;h<n;h++){let m=e[h][l],p=Number.isFinite(m)?m:0;p>=0?(o[h][l]=u,u+=p,i[h][l]=u):(o[h][l]=f,f+=p,i[h][l]=f)}continue}let c=0;for(let u=0;u<n;u++)c+=a(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let f=a(u,l);t==="expand"&&(f=c?f/c*100:0),o[u][l]=d,d+=f,i[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,i[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let f=0;f<r;f++)o[u][f]-=d,i[u][f]-=d}return{y0:o,y1:i}}function nr(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function rr(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((f,h)=>{f>u&&(u=f,d=h)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),i=[],a=[],s=0,l=0;for(let c of o)s<l?(i.push(c),s+=r[c]):(a.push(c),l+=r[c]);return[...a.reverse(),...i]}var Fe=Math.PI*2;function or(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ye(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function ir(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Oi(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ar(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 ut=new Map;function Me(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=ut.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Oi(c)?a+=ar(c):s+=ar(c)}i=a+s*(n>=600?1.07:1),ut.size>5e3&&ut.clear(),ut.set(o,i)}return i*t}var lr=T(L(),1),Ii=e=>Array.isArray(e)&&e.length===2;function sr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ii(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var ur=T(L(),1),Vt=10.5;function zi(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>Ne(a,{locale:n,maximumFractionDigits:i}))}function cr(e,t,n){let r=18;for(let o of zi(e,t,n))r=Math.max(r,Me(o,Vt));return Math.ceil(r+8)}function mt(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 _e(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,l=mt(a,n),c=[o,i];for(let d=0;d<4;d++){let u=Math.ceil(i/l-1e-9)*l,f=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-f<=l*.3?f:o-a*s,i===0?0:u-i<=l*.3?u:i+a*s];let h=mt(c[1]-c[0],n);if(h===l)break;l=h}return c}function mr(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.25]:[o*1.25,0];let a=mt(i-o,n);return[Math.floor(o/a+1e-9)*a,Math.ceil(i/a-1e-9)*a]}function dr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=mt(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let l=s,c=0;l<=o+i*1e-9&&c<200;l+=i,c++)a.push(Number((Math.round(l/i)*i).toPrecision(12)));return a}function Wt(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(l=>o+(l-n)*a);return s.domain=e,s.range=t,s.invert=l=>a===0?n:n+(l-o)/a,s.ticks=(l=4)=>dr(n,r,l),s}function Kt(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[i,a]=_e(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function Bi(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(c,d=1)=>{let u=[];for(let f=Math.floor(r);f<=Math.ceil(o);f++)if(!(f%d))for(let h of c){let m=Number((h*10**f).toPrecision(12));m>=e*(1-1e-9)&&m<=t*(1+1e-9)&&u.push(m)}return u},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let l=a([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:dr(e,t,3)}function fr(e,t){let n=Wt([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>Bi(e[0],e[1],Math.abs(t[1]-t[0])),r}function Be(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Hi=864e5;function hr(e,t,n,r=X){let o=t-e;if(!(o>0))return[{t:e,label:ze(e,{locale:r,month:"short",day:"numeric"})}];let i=o/Hi,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,f,h=!1)=>{let m=new Date(d),p=-1,v=0;for(;m.getTime()<=t&&v++<500;){if(m.getTime()>=e){let k=m.getFullYear(),$=h&&!l&&k!==p;a.push({t:m.getTime(),label:ze(m,{locale:r,...f,...$?{year:"numeric"}:{}})}),p=k}u(m)}};if(i<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=d)??12,f=new Date(s);f.setMinutes(0,0,0),c(f,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=i/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),f=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(f>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,m=>m.setFullYear(m.getFullYear()+f/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),m=h.getMonth()%f;m&&h.setMonth(h.getMonth()+(f-m)),c(h,p=>p.setMonth(p.getMonth()+f),{month:"short"},!0)}}return a}function gr(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 ji=(e,t,n)=>e==="date"?Qe(t,n)?.getTime()??NaN:ue(t);function Gi(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&En(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Te(e,t,n,r,o={}){let i=ve(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:ve(n,"y"),c=!a&&r!==void 0?ve(r,"series"):null,d=e.map((y,g)=>i(y,g)),u=o.xType??Gi(d),f=o.locale??X,h,m,p;if(u==="band"){let y=d.map(w=>String(w??""));h=ae(y);let g=new Map(h.map((w,A)=>[w,A]));m=h.map((w,A)=>A),p=Int32Array.from(y,w=>g.get(w)??-1)}else{let y=u==="date"?o.dayFirst??On(d):void 0,g=d.map(_=>ji(u,_,y)),w=Array.from(new Set(g.filter(_=>Number.isFinite(_)))).sort((_,B)=>_-B),A=new Map(w.map((_,B)=>[_,B]));m=w,h=w.map(String),p=Int32Array.from(g,_=>A.get(_)??-1)}let v=o.dateFormat,k=y=>typeof y=="string"?Ze(y.trim())?.[3]:void 0,$=u==="date"&&d.length<5e3?k(d[0]):void 0,M=($===2||$===3)&&d.every(y=>k(y)===$),R=M&&$===3;if(u==="date"&&!v){let y=m.length>1?m[m.length-1]-m[0]:0;v=M&&$===2||y>864e5*120?{month:"short"}:y<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},y>864e5*800&&(v={year:"numeric",month:"short"})}let x;if(u==="band")x=h;else if(R&&!o.dateFormat){let y=j(f)==="ko";x=m.map(g=>{let w=new Date(g),A=Math.floor(w.getMonth()/3)+1;return y?`${w.getFullYear()}년 ${A}분기`:`Q${A} ${w.getFullYear()}`})}else{let y=m.every(Pt),g=u==="date"?new Intl.DateTimeFormat(f,v):new Intl.NumberFormat(f,y?{useGrouping:!1}:{maximumFractionDigits:6});x=m.length>1e3?gr(m.length,w=>g.format(m[w])):m.map(w=>g.format(w))}let N=s?[...s]:c?ae(e.map((y,g)=>String(c(y,g)??""))):[""],P=new Map(N.map((y,g)=>[y,g])),D=N.map(()=>new Array(h.length).fill(NaN)),O=N.map(()=>new Array(h.length).fill(null)),E=o.aggregate??"sum",F=E==="mean"?N.map(()=>new Uint32Array(h.length)):null,S=(y,g,w,A)=>{let _=D[y][g];E==="last"?D[y][g]=w:E==="count"?D[y][g]=(Number.isFinite(_)?_:0)+1:E==="mean"?Number.isFinite(w)&&(D[y][g]=(Number.isFinite(_)?_:0)+w,F[y][g]++):D[y][g]=Number.isFinite(_)?_+(Number.isFinite(w)?w:0):w,O[y][g]=A};for(let y=0;y<e.length;y++){let g=p[y];if(g<0)continue;let w=e[y];if(s)for(let A=0;A<s.length;A++)S(A,g,ue(w[s[A]]),w);else{let A=c?P.get(String(c(w,y)??""))??0:0;S(A,g,ue(l(w,y)),w)}}if(F)for(let y=0;y<D.length;y++)for(let g=0;g<h.length;g++)F[y][g]>1&&(D[y][g]/=F[y][g]);return{type:u,keys:h,xnum:m,labels:x,series:N,values:D,rows:O}}var Vi=140,je=12,pr=14,Ut=20,br=12.5;function Wi(e,t,n=Yn){let r=fe(t,t),o=new Map;e.forEach((a,s)=>{let l=r(a,s),c=o.get(l);c?c.push(a):o.set(l,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function Ki(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+je)/(Vi+je))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ui(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*je)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var He=e=>e.filter(Number.isFinite);function dt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=lt(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return He(n)}function yr(e,t,n,r,o,i){return Te(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function Xi(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let x=t.flat(),N=r.refLines??{},[P,D]=Be([...dt(x,r.x??"x"),...He([Number(N.x)])]),[O,E]=Be([...dt(x,r.y??"y"),...He([Number(N.y)])].filter(S=>!s||S>0)),F=r.zero??!1;return{y:c??(s?Kt(O,E,a):_e(O,E,a,{zero:F,pad:.08})),x:r.xDomain??_e(P,D,Math.max(2,Math.round(o/110)),{zero:F,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",f=n[0]?.keys.join(""),h=n.every(x=>x.keys.join("")===f),m=n.length>0&&n.every(x=>x.type!=="band"&&x.type===n[0].type),p=r.xDomain??(!d&&m?Be(n.flatMap(x=>He(x.xnum))):void 0),v=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(v==="percent")return{x:p,sameKeys:h};if(c)return{y:c,x:p,sameKeys:h};let k=[];t.forEach((x,N)=>{let P=n[N];if(v==="stacked"||v==="auto"&&P.series.length>1){let O=Gt(P.values,"zero");O.y0.forEach(E=>k.push(...E)),O.y1.forEach(E=>k.push(...E))}else P.values.forEach(O=>k.push(...O));d&&!u&&r.line!==void 0&&yr(e,x,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(O=>k.push(...O)),d||k.push(...dt(x,r.lower),...dt(x,r.upper))}),d&&k.push(0),u||k.push(...sr(r.annotations));for(let x of r.referenceLines??[])k.push(x.y);r.signColors&&k.push(Number(r.baseline??0));let[$,M]=Be(He(k).filter(x=>!s||x>0));return{y:s?Kt($,M,a):d?_e($,M,u?Math.max(2,Math.round(o/120)):a):_e($,M,a,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function Yi(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Te(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?fr:Wt)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),d=cr(c,_n(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(x=>x.series),f=r.endLabels??n.some(x=>x.series.length>1),h=d+6,m=i-(f?Math.min(i*.28,Math.max(...u.map(x=>Me(x,11,700)),20)+14):10),p=l.keys.length,[v,k]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=l.type==="number"?p>12:p>hr(v,k,Math.max(2,Math.floor((m-h)/64)),s).length;if(l.type==="band"||!p||$)return;let M=x=>h+(l.xnum[x]-v)/(k-v)*(m-h),R=x=>Me(l.labels[x],Vt);for(let x=1;;x++){let N=Array.from({length:Math.ceil(p/x)},(P,D)=>D*x);if(x>=p||N.every((P,D)=>!D||M(P)-M(N[D-1])>=(R(P)+R(N[D-1]))/2+8))return N.map(P=>({value:l.xnum[P],label:l.labels[P]}))}}function Ji(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function qi(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${Ji(`${e}|${t}|${o}|${ct(r)}`)}`}function Zi(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var Qi={en:{intro:(e,t)=>`${de(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},Xt=18;function xr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=Wi(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Ki(s,a,e.columns),{pw:c,ph:d}=Ui(s,l,e.height),u=e.scale!=="free",f=t==="scatter"?[]:o.map(F=>yr(t,F,n,n.y,n.series,n.aggregate)),h=u?Xi(t,o,f,n,c,d):{sameKeys:!1},m=u?Yi(t,o,f,n,h,c,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",v=u&&(!p||h.sameKeys),k=u&&(p||h.x!==void 0||h.sameKeys),$=new Set(Zi(e.highlight,r)?[e.highlight].flat():[]),M=$.size>0,R=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,x=e.syncId??qi(t,e.by,n,e.data),N=qe(we(n.format,e.locale),n.unit),P=Qi[e.lang],D=[],O=r.map(F=>F===""?P.blank:F);return{panels:r.map((F,S)=>{let y=o[S],g=O[S],w=S%l,A;if(t!=="scatter"){let B=f[S],Y=me=>B.values.reduce((ke,on)=>ke+(Number.isFinite(on[me])?on[me]:0),0),I=B.keys.map((me,ke)=>ke).filter(me=>B.values.some(ke=>Number.isFinite(ke[me]))),U=I[I.length-1];D.push({first:I.length?Y(I[0]):NaN,last:I.length?Y(U):NaN,total:I.reduce((me,ke)=>me+Y(ke),0)}),t!=="bar"&&B.series.length===1&&U!==void 0&&(A=N(B.values[0][U]))}else D.push({first:NaN,last:NaN,total:y.length});let _={data:y,width:c,height:d,ariaLabel:e.title?`${e.title}, ${g}`:g,syncId:x,highlight:M?$.has(F)?R?()=>!0:void 0:"none":e.highlight,showYAxis:!v||w===0,showXAxis:!k||S+l>=a};return h.y&&(_.yDomain=h.y),h.x&&(_.xDomain=h.x),m&&(_.xTicks=m),{value:F,label:g,props:_,last:A,isPicked:$.has(F)}}),cols:l,pw:c,ph:d,isPanelPick:M,description:ea(t,e.by,O,D,i,N,P)}}function ea(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=c=>ir(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=a.endHigh(n[c],i(r[c].last)));let d=n.filter((u,f)=>r[f].last<r[f].first);s+=d.length?a.falling(`${d.slice(0,5).join(", ")}${d.length>5?a.more:""}`):a.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?a.total(n[c],i(r[c].total)):a.points(n[c],r[c].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var Z=T(H(),1);function ta(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function na(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var ft={threshold:.25,enoughPx:96,rootMargin:"0px"};function vr(e,t=!0){let[n,r]=(0,Z.useState)({visible:!t,near:!t});return(0,Z.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(a=>{let s=na(a[a.length-1],ft.threshold,ft.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:ta(ft.threshold),rootMargin:ft.rootMargin}),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 kr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function ht(e){let[t,n]=(0,Z.useState)(null),[r,o]=(0,Z.useState)(e??null),i=(0,Z.useCallback)(a=>{n(a),a&&e===void 0&&o(kr(a))},[e]);return ce(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>a(kr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?a(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var ra=()=>()=>{};function Pe(){return(0,Z.useSyncExternalStore)(ra,()=>!0,()=>!1)}var wr="(prefers-reduced-motion: reduce)";function gt(e="auto"){let[t,n]=(0,Z.useState)(()=>ne&&typeof window.matchMedia=="function"?window.matchMedia(wr).matches:!1);return(0,Z.useEffect)(()=>{if(e!=="auto"||!ne||typeof window.matchMedia!="function")return;let r=window.matchMedia(wr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var se=T(L(),1),oa=60,ia=420;function $r(e){let t=ie(),n=e.chartProps??{},[,r,o]=ht(e.width),i=e.width??(o||480),a=J(e.locale??n.locale),s=j(a),l=(0,De.useContext)(Ce),c=e.title??l,d=e.chart.facetPlan,u=(0,De.useMemo)(()=>{let k=xr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:c,locale:a,lang:s});return d?d(k,n,a):k},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,$)=>typeof $=="function"?String($):$),e.highlight,e.syncId,i,e.height,c,a,s,d]),f=`${(0,De.useId)().replace(/:/g,"")}fd`,h=gt(n.reducedMotion??"auto"),m=Pe(),p=pn({motion:{enabled:n.animate!==!1&&!h&&ne},hydrated:m},{waiting:!1,generation:0}),v=e.chart;return(0,se.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":f,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,se.jsx)("p",{id:f,style:it,children:e.description??u.description}),(0,se.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:je,rowGap:pr,...u.legend?{marginTop:Xt}:null},children:u.panels.map((k,$)=>{let M=t.paint(k.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,se.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...gn(p,!1,"fade",$*oa,ia)},children:[(0,se.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Ut,fontSize:br,fontWeight:700,lineHeight:`${Ut}px`,color:M},children:[(0,se.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,se.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,se.jsx)(v,{...n,...k.props})]},k.value)})}),u.legend?(0,se.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Xt},children:u.legend}):null]})}var Mr=["max","min","first","last","none"];function le(e,t,n,r,o="max"){let i=new Set,a=n.length,s=c=>{if(a&&c!=="none"){if(c==="first")i.add(0);else if(c==="last")i.add(a-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((f,h)=>{Number.isFinite(f)&&(c==="max"?f>u:f<u)&&(u=f,d=h)}),d>=0&&i.add(d)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((c,d)=>{d<a&&c!==null&&c!==void 0&&e(c,d)&&i.add(d)}),i;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<a&&i.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&i.add(u)});return i}var ee=T(H(),1);async function aa(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(j(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return $e(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 $e(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):$e(i)}async function sa(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 aa(i,t.parse,o,t.locale)}return t.select&&(r=tr(r,t.select)),t.transform?t.transform(r):be(r)}function Tr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,ee.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ee.useState)(0),c=J(t.locale),d=(0,ee.useRef)(t);d.current={...t,locale:c};let u=(0,ee.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],m=JSON.stringify(h.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),p=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{let k=u.current;if(!k||!r){a(R=>R.status==="loading"?{...R,status:"idle"}:R);return}let $=new AbortController,M=!0;return p.current=!0,a(R=>({...R,data:o?R.data:[],status:"loading",error:null})),sa(k,{...d.current,signal:$.signal}).then(R=>{M&&a({data:R,status:"success",error:null,updatedAt:Date.now()})}).catch(R=>{!M||$.signal.aborted||a(x=>({...x,status:"error",error:R instanceof Error?R:new Error(String(R))}))}).finally(()=>{M&&(p.current=!1)}),()=>{M=!1,p.current=!1,$.abort()}},[f,r,s,m,o]),(0,ee.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{p.current||l($=>$+1)},n);return()=>clearInterval(k)},[n,r]);let v=(0,ee.useCallback)(()=>l(k=>k+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:v}}var Jt=T(L(),1),la=["csv","svg","png"],ca=/^[=+\-@\t\r\n=+-@]/,ua=/var\(|color-mix\(/;function Cr(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?Pn(e.getTime()):String(e);return`"${(ca.test(t)&&!Number.isFinite(ue(t))?`'${t}`:t).replace(/"/g,'""')}"`}function ma(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function da(e,t){return`\uFEFF${[t.map(Cr),...e.map(r=>t.map(o=>Cr(r[o])))].map(r=>r.join(",")).join(`\r
25
+ `&&m++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(m=>!(m.length===1&&m[0].trim()===""));if(!d.length)return[];let u=m=>n?er(m):m;if(!r)return d.map(m=>Object.fromEntries(m.map((p,$)=>[String($),u(p)])));let f=[],h=new Set;return d[0].forEach((m,p)=>{let $=m.trim()||`col${p+1}`,k=$;for(let v=2;h.has(k);v++)k=`${$}_${v}`;h.add(k),f.push(k)}),d.slice(1).map(m=>Object.fromEntries(f.map((p,$)=>[p,u(m[$]??"")])))}function jt(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"?er(i[l]):i[l]??null])))}function Ea(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(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function tr(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 be(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return be(JSON.parse(t))}catch{}return ve(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?jt(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)?be(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?jt(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)?be(t.rows):Array.isArray(t.values)?jt(t.values):Array.isArray(t.items)?be(t.items):Array.isArray(t.results)?be(t.results):Ea(t)}return[]}function ct(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)}`}function Gt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let d=e[l][c];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let d=0,u=0;for(let f=0;f<n;f++){let h=i(f,c),m=h-i(f,c-1),p=0;for(let $=0;$<f;$++)p+=i($,c)-i($,c-1);d+=h,u+=(m/2+p)*h}d&&(l-=u/d),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,f=0;for(let h=0;h<n;h++){let m=e[h][l],p=Number.isFinite(m)?m:0;p>=0?(o[h][l]=u,u+=p,a[h][l]=u):(o[h][l]=f,f+=p,a[h][l]=f)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let d=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let f=i(u,l);t==="expand"&&(f=c?f/c*100:0),o[u][l]=d,d+=f,a[u][l]=d}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let d=0;for(let u=0;u<r;u++)d+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;d/=r;for(let u=0;u<n;u++)for(let f=0;f<r;f++)o[u][f]-=d,a[u][f]-=d}return{y0:o,y1:a}}function nr(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function rr(e){let t=e.length,n=e.map(c=>{let d=0,u=-1/0;return c.forEach((f,h)=>{f>u&&(u=f,d=h)}),d}),r=e.map(c=>c.reduce((d,u)=>d+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,d)=>d).sort((c,d)=>n[c]-n[d]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var Fe=Math.PI*2;function or(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ye(e,t,n,r){return[e+n*Math.sin(r),t-n*Math.cos(r)]}function ar(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Oa(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function ir(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 ut=new Map;function Me(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=ut.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);Oa(c)?i+=ir(c):s+=ir(c)}a=i+s*(n>=600?1.07:1),ut.size>5e3&&ut.clear(),ut.set(o,a)}return a*t}var lr=T(L(),1),Ia=e=>Array.isArray(e)&&e.length===2;function sr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&Ia(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var ur=T(L(),1),Vt=10.5;function za(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>Ne(i,{locale:n,maximumFractionDigits:a}))}function cr(e,t,n){let r=18;for(let o of za(e,t,n))r=Math.max(r,Me(o,Vt));return Math.ceil(r+8)}function mt(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 _e(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.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=mt(i,n),c=[o,a];for(let d=0;d<4;d++){let u=Math.ceil(a/l-1e-9)*l,f=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-f<=l*.3?f:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let h=mt(c[1]-c[0],n);if(h===l)break;l=h}return c}function mr(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=mt(a-o,n);return[Math.floor(o/i+1e-9)*i,Math.ceil(a/i-1e-9)*i]}function dr(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=mt(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function Wt(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)=>dr(n,r,l),s}function Kt(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=_e(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function Ba(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,d=1)=>{let u=[];for(let f=Math.floor(r);f<=Math.ceil(o);f++)if(!(f%d))for(let h of c){let m=Number((h*10**f).toPrecision(12));m>=e*(1-1e-9)&&m<=t*(1+1e-9)&&u.push(m)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:dr(e,t,3)}function fr(e,t){let n=Wt([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>Ba(e[0],e[1],Math.abs(t[1]-t[0])),r}function Be(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var Ha=864e5;function hr(e,t,n,r=X){let o=t-e;if(!(o>0))return[{t:e,label:ze(e,{locale:r,month:"short",day:"numeric"})}];let a=o/Ha,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(d,u,f,h=!1)=>{let m=new Date(d),p=-1,$=0;for(;m.getTime()<=t&&$++<500;){if(m.getTime()>=e){let k=m.getFullYear(),v=h&&!l&&k!==p;i.push({t:m.getTime(),label:ze(m,{locale:r,...f,...v?{year:"numeric"}:{}})}),p=k}u(m)}};if(a<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=d)??12,f=new Date(s);f.setMinutes(0,0,0),c(f,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(d,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),c(d,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=a/30.44,u=Math.max(1,Math.ceil(d/Math.max(1,n))),f=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(f>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,m=>m.setFullYear(m.getFullYear()+f/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),m=h.getMonth()%f;m&&h.setMonth(h.getMonth()+(f-m)),c(h,p=>p.setMonth(p.getMonth()+f),{month:"short"},!0)}}return i}function gr(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var ja=(e,t,n)=>e==="date"?Qe(t,n)?.getTime()??NaN:ue(t);function Ga(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&En(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Te(e,t,n,r,o={}){let a=$e(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:$e(n,"y"),c=!i&&r!==void 0?$e(r,"series"):null,d=e.map((y,g)=>a(y,g)),u=o.xType??Ga(d),f=o.locale??X,h,m,p;if(u==="band"){let y=d.map(w=>String(w??""));h=ie(y);let g=new Map(h.map((w,A)=>[w,A]));m=h.map((w,A)=>A),p=Int32Array.from(y,w=>g.get(w)??-1)}else{let y=u==="date"?o.dayFirst??On(d):void 0,g=d.map(_=>ja(u,_,y)),w=Array.from(new Set(g.filter(_=>Number.isFinite(_)))).sort((_,B)=>_-B),A=new Map(w.map((_,B)=>[_,B]));m=w,h=w.map(String),p=Int32Array.from(g,_=>A.get(_)??-1)}let $=o.dateFormat,k=y=>typeof y=="string"?Ze(y.trim())?.[3]:void 0,v=u==="date"&&d.length<5e3?k(d[0]):void 0,M=(v===2||v===3)&&d.every(y=>k(y)===v),R=M&&v===3;if(u==="date"&&!$){let y=m.length>1?m[m.length-1]-m[0]:0;$=M&&v===2||y>864e5*120?{month:"short"}:y<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},y>864e5*800&&($={year:"numeric",month:"short"})}let x;if(u==="band")x=h;else if(R&&!o.dateFormat){let y=j(f)==="ko";x=m.map(g=>{let w=new Date(g),A=Math.floor(w.getMonth()/3)+1;return y?`${w.getFullYear()}년 ${A}분기`:`Q${A} ${w.getFullYear()}`})}else{let y=m.every(Pt),g=u==="date"?new Intl.DateTimeFormat(f,$):new Intl.NumberFormat(f,y?{useGrouping:!1}:{maximumFractionDigits:6});x=m.length>1e3?gr(m.length,w=>g.format(m[w])):m.map(w=>g.format(w))}let N=s?[...s]:c?ie(e.map((y,g)=>String(c(y,g)??""))):[""],P=new Map(N.map((y,g)=>[y,g])),D=N.map(()=>new Array(h.length).fill(NaN)),O=N.map(()=>new Array(h.length).fill(null)),E=o.aggregate??"sum",F=E==="mean"?N.map(()=>new Uint32Array(h.length)):null,S=(y,g,w,A)=>{let _=D[y][g];E==="last"?D[y][g]=w:E==="count"?D[y][g]=(Number.isFinite(_)?_:0)+1:E==="mean"?Number.isFinite(w)&&(D[y][g]=(Number.isFinite(_)?_:0)+w,F[y][g]++):D[y][g]=Number.isFinite(_)?_+(Number.isFinite(w)?w:0):w,O[y][g]=A};for(let y=0;y<e.length;y++){let g=p[y];if(g<0)continue;let w=e[y];if(s)for(let A=0;A<s.length;A++)S(A,g,ue(w[s[A]]),w);else{let A=c?P.get(String(c(w,y)??""))??0:0;S(A,g,ue(l(w,y)),w)}}if(F)for(let y=0;y<D.length;y++)for(let g=0;g<h.length;g++)F[y][g]>1&&(D[y][g]/=F[y][g]);return{type:u,keys:h,xnum:m,labels:x,series:N,values:D,rows:O}}var Va=140,je=12,pr=14,Ut=20,br=12.5;function Wa(e,t,n=Yn){let r=fe(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function Ka(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+je)/(Va+je))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function Ua(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*je)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var He=e=>e.filter(Number.isFinite);function dt(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=lt(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return He(n)}function yr(e,t,n,r,o,a){return Te(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function Xa(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let x=t.flat(),N=r.refLines??{},[P,D]=Be([...dt(x,r.x??"x"),...He([Number(N.x)])]),[O,E]=Be([...dt(x,r.y??"y"),...He([Number(N.y)])].filter(S=>!s||S>0)),F=r.zero??!1;return{y:c??(s?Kt(O,E,i):_e(O,E,i,{zero:F,pad:.08})),x:r.xDomain??_e(P,D,Math.max(2,Math.round(o/110)),{zero:F,pad:.06}),sameKeys:!0}}let d=e==="bar",u=d&&r.orientation==="horizontal",f=n[0]?.keys.join(""),h=n.every(x=>x.keys.join("")===f),m=n.length>0&&n.every(x=>x.type!=="band"&&x.type===n[0].type),p=r.xDomain??(!d&&m?Be(n.flatMap(x=>He(x.xnum))):void 0),$=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if($==="percent")return{x:p,sameKeys:h};if(c)return{y:c,x:p,sameKeys:h};let k=[];t.forEach((x,N)=>{let P=n[N];if($==="stacked"||$==="auto"&&P.series.length>1){let O=Gt(P.values,"zero");O.y0.forEach(E=>k.push(...E)),O.y1.forEach(E=>k.push(...E))}else P.values.forEach(O=>k.push(...O));d&&!u&&r.line!==void 0&&yr(e,x,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(O=>k.push(...O)),d||k.push(...dt(x,r.lower),...dt(x,r.upper))}),d&&k.push(0),u||k.push(...sr(r.annotations));for(let x of r.referenceLines??[])k.push(x.y);r.signColors&&k.push(Number(r.baseline??0));let[v,M]=Be(He(k).filter(x=>!s||x>0));return{y:s?Kt(v,M,i):d?_e(v,M,u?Math.max(2,Math.round(o/120)):i):_e(v,M,i,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function Ya(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Te(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?fr:Wt)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=cr(c,_n(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(x=>x.series),f=r.endLabels??n.some(x=>x.series.length>1),h=d+6,m=a-(f?Math.min(a*.28,Math.max(...u.map(x=>Me(x,11,700)),20)+14):10),p=l.keys.length,[$,k]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,v=l.type==="number"?p>12:p>hr($,k,Math.max(2,Math.floor((m-h)/64)),s).length;if(l.type==="band"||!p||v)return;let M=x=>h+(l.xnum[x]-$)/(k-$)*(m-h),R=x=>Me(l.labels[x],Vt);for(let x=1;;x++){let N=Array.from({length:Math.ceil(p/x)},(P,D)=>D*x);if(x>=p||N.every((P,D)=>!D||M(P)-M(N[D-1])>=(R(P)+R(N[D-1]))/2+8))return N.map(P=>({value:l.xnum[P],label:l.labels[P]}))}}function Ja(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function qa(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${Ja(`${e}|${t}|${o}|${ct(r)}`)}`}function Za(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var Qa={en:{intro:(e,t)=>`${de(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},Xt=18;function xr(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=Wa(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=Ka(s,i,e.columns),{pw:c,ph:d}=Ua(s,l,e.height),u=e.scale!=="free",f=t==="scatter"?[]:o.map(F=>yr(t,F,n,n.y,n.series,n.aggregate)),h=u?Xa(t,o,f,n,c,d):{sameKeys:!1},m=u?Ya(t,o,f,n,h,c,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",$=u&&(!p||h.sameKeys),k=u&&(p||h.x!==void 0||h.sameKeys),v=new Set(Za(e.highlight,r)?[e.highlight].flat():[]),M=v.size>0,R=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,x=e.syncId??qa(t,e.by,n,e.data),N=qe(we(n.format,e.locale),n.unit),P=Qa[e.lang],D=[],O=r.map(F=>F===""?P.blank:F);return{panels:r.map((F,S)=>{let y=o[S],g=O[S],w=S%l,A;if(t!=="scatter"){let B=f[S],Y=me=>B.values.reduce((ke,on)=>ke+(Number.isFinite(on[me])?on[me]:0),0),I=B.keys.map((me,ke)=>ke).filter(me=>B.values.some(ke=>Number.isFinite(ke[me]))),U=I[I.length-1];D.push({first:I.length?Y(I[0]):NaN,last:I.length?Y(U):NaN,total:I.reduce((me,ke)=>me+Y(ke),0)}),t!=="bar"&&B.series.length===1&&U!==void 0&&(A=N(B.values[0][U]))}else D.push({first:NaN,last:NaN,total:y.length});let _={data:y,width:c,height:d,ariaLabel:e.title?`${e.title}, ${g}`:g,syncId:x,highlight:M?v.has(F)?R?()=>!0:void 0:"none":e.highlight,showYAxis:!$||w===0,showXAxis:!k||S+l>=i};return h.y&&(_.yDomain=h.y),h.x&&(_.xDomain=h.x),m&&(_.xTicks=m),{value:F,label:g,props:_,last:A,isPicked:v.has(F)}}),cols:l,pw:c,ph:d,isPanelPick:M,description:ei(t,e.by,O,D,a,N,P)}}function ei(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>ar(r.map(d=>d[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let d=n.filter((u,f)=>r[f].last<r[f].first);s+=d.length?i.falling(`${d.slice(0,5).join(", ")}${d.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var Z=T(H(),1);function ti(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function ni(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var ft={threshold:.25,enoughPx:96,rootMargin:"0px"};function $r(e,t=!0){let[n,r]=(0,Z.useState)({visible:!t,near:!t});return(0,Z.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=ni(i[i.length-1],ft.threshold,ft.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:ti(ft.threshold),rootMargin:ft.rootMargin}),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 kr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function ht(e){let[t,n]=(0,Z.useState)(null),[r,o]=(0,Z.useState)(e??null),a=(0,Z.useCallback)(i=>{n(i),i&&e===void 0&&o(kr(i))},[e]);return ce(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(d=>d!==null&&Math.abs(d-c)<.5?d:c),s=()=>i(kr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let d=c[c.length-1]?.contentRect;d?i(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var ri=()=>()=>{};function Pe(){return(0,Z.useSyncExternalStore)(ri,()=>!0,()=>!1)}var wr="(prefers-reduced-motion: reduce)";function gt(e="auto"){let[t,n]=(0,Z.useState)(()=>ne&&typeof window.matchMedia=="function"?window.matchMedia(wr).matches:!1);return(0,Z.useEffect)(()=>{if(e!=="auto"||!ne||typeof window.matchMedia!="function")return;let r=window.matchMedia(wr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var se=T(L(),1),oi=60,ai=420;function vr(e){let t=ae(),n=e.chartProps??{},[,r,o]=ht(e.width),a=e.width??(o||480),i=J(e.locale??n.locale),s=j(i),l=(0,De.useContext)(Ce),c=e.title??l,d=e.chart.facetPlan,u=(0,De.useMemo)(()=>{let k=xr({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return d?d(k,n,i):k},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(k,v)=>typeof v=="function"?String(v):v),e.highlight,e.syncId,a,e.height,c,i,s,d]),f=`${(0,De.useId)().replace(/:/g,"")}fd`,h=gt(n.reducedMotion??"auto"),m=Pe(),p=pn({motion:{enabled:n.animate!==!1&&!h&&ne},hydrated:m},{waiting:!1,generation:0}),$=e.chart;return(0,se.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":f,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,se.jsx)("p",{id:f,style:at,children:e.description??u.description}),(0,se.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:je,rowGap:pr,...u.legend?{marginTop:Xt}:null},children:u.panels.map((k,v)=>{let M=t.paint(k.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,se.jsxs)("div",{"data-facet":k.value,style:{minWidth:0,...gn(p,!1,"fade",v*oi,ai)},children:[(0,se.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:Ut,fontSize:br,fontWeight:700,lineHeight:`${Ut}px`,color:M},children:[(0,se.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.label}),k.last!==void 0?(0,se.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:k.last}):null]}),(0,se.jsx)($,{...n,...k.props})]},k.value)})}),u.legend?(0,se.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:Xt},children:u.legend}):null]})}var Mr=["max","min","first","last","none"];function le(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let d=-1,u=c==="max"?-1/0:1/0;r.forEach((f,h)=>{Number.isFinite(f)&&(c==="max"?f>u:f<u)&&(u=f,d=h)}),d>=0&&a.add(d)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,d)=>{d<i&&c!==null&&c!==void 0&&e(c,d)&&a.add(d)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((d,u)=>{d===c&&a.add(u)});return a}var ee=T(H(),1);async function ii(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(j(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return ve(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 ve(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):ve(a)}async function si(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 ii(a,t.parse,o,t.locale)}return t.select&&(r=tr(r,t.select)),t.transform?t.transform(r):be(r)}function Tr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,ee.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,ee.useState)(0),c=J(t.locale),d=(0,ee.useRef)(t);d.current={...t,locale:c};let u=(0,ee.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],m=JSON.stringify(h.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),p=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{let k=u.current;if(!k||!r){i(R=>R.status==="loading"?{...R,status:"idle"}:R);return}let v=new AbortController,M=!0;return p.current=!0,i(R=>({...R,data:o?R.data:[],status:"loading",error:null})),si(k,{...d.current,signal:v.signal}).then(R=>{M&&i({data:R,status:"success",error:null,updatedAt:Date.now()})}).catch(R=>{!M||v.signal.aborted||i(x=>({...x,status:"error",error:R instanceof Error?R:new Error(String(R))}))}).finally(()=>{M&&(p.current=!1)}),()=>{M=!1,p.current=!1,v.abort()}},[f,r,s,m,o]),(0,ee.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{p.current||l(v=>v+1)},n);return()=>clearInterval(k)},[n,r]);let $=(0,ee.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:$}}var Jt=T(L(),1),li=["csv","svg","png"],ci=/^[=+\-@\t\r\n=+-@]/,ui=/var\(|color-mix\(/;function Cr(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?Pn(e.getTime()):String(e);return`"${(ci.test(t)&&!Number.isFinite(ue(t))?`'${t}`:t).replace(/"/g,'""')}"`}function mi(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function di(e,t){return`\uFEFF${[t.map(Cr),...e.map(r=>t.map(o=>Cr(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function fa(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Yt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Sr=2,xe=16;function Ar(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 Nr(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 Rr(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+xe*2,a+xe*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((m,p)=>{let v;for(let k of Array.from(m.attributes)){if(!ua.test(k.value))continue;let $=(v??(v=getComputedStyle(m))).getPropertyValue(k.name);$&&d[p].setAttribute(k.name,Ar($,u))}}),c.removeAttribute("style");for(let[m,p]of Object.entries({viewBox:`${-xe} ${-xe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(m,String(p));let f=Ar(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let m=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Nr("rect",{x:-xe,y:-xe,width:s,height:l,fill:f}),m),h&&c.insertBefore(Nr("image",{href:h.toDataURL(),width:i,height:a}),m)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:i,vh:a,bg:f,canvas:h}}function ha(e,t){let n=Rr(e,Sr,!1);if(!n)return;let r=Sr,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,xe*r,xe*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&&Yt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function Fr(e){let t=ie(e.theme),n=j(J(e.locale))==="ko",r=fa(e.filename),o=(i,a)=>{if(i==="csv")return Yt(new Blob([da(e.data,e.columns?.length?e.columns:ma(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return ha(a,r);let s=Rr(a,1,!0);s&&Yt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Jt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:la.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,Jt.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 Pr=T(L(),1);function _r(e,t=X){let n=we(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?ze(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,c=s.replace(Ln,(d,u)=>o(i,u.trim())??(l=!0,""));l||a.push(c)}return a.length?a.map((s,l)=>(0,Pr.jsx)("div",{children:s},l)):null}}function Dr(e,t,n=!1){let r=fe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=ae(o);if(!n)return i;let a=new Map;for(let s of o)a.set(s,(a.get(s)??0)+1);return i.map((s,l)=>[s,l]).sort((s,l)=>a.get(s[0])-a.get(l[0])||s[1]-l[1]).map(([s])=>s)}function Lr(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 $e(t.csv)}return null}var jr=T(H(),1);var W=T(H(),1);function Er(e,t){let n=ie(e.theme),[r,o,i]=ht(e.width),a=Pe(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=gt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&ne,f=vr(r,e.animateOnView!==!1&&u),h=J(e.locale),m=j(h),p=(0,W.useMemo)(()=>we(e.format,h,t.format),[e.format,h,t.format]),v=(0,W.useCallback)(I=>Je(I,{locale:h}),[h]),k=(0,W.useMemo)(()=>qe(p,e.unit),[p,e.unit]),$=(0,W.useMemo)(()=>ct(e.data),[e.data]),[M,R]=(0,W.useState)(null),[x,N]=(0,W.useState)(null),P=(0,W.useRef)([]),D=(0,W.useRef)(e.onHover);D.current=e.onHover;let O=(0,W.useRef)(e.onClick);O.current=e.onClick;let E=(0,W.useRef)(null),F=(0,W.useRef)(null),S=(0,W.useRef)(null),y=(0,W.useCallback)((I,U="pointer")=>{if(S.current!==I){S.current=I;let me=I===null?null:P.current[I]??null;queueMicrotask(()=>D.current?.(me)),F.current?.(I)}E.current=I===null?null:U,R(I),N(E.current)},[]),g=(0,W.useCallback)(I=>{E.current!=="keyboard"&&(E.current=I===null?null:"sync",R(I),N(E.current))},[]),w=(0,W.useCallback)(I=>{let U=P.current[I];U&&O.current?.(U)},[]),A=Hn(e.replayKey),_=e.width!==void 0||(i??0)>0,B={enabled:u,active:f.visible&&_,near:f.near,replayKey:A,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Y=(0,W.useCallback)((I,U=1)=>M===null||M===I?U:U*.38,[M]);return{p:n,width:s,height:c,measured:_,responsive:e.width===void 0,pending:ne&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:B,fv:k,fmt:p,pct:v,locale:h,lang:m,t:m==="ko"?yn:bn,active:M,via:x,setActive:y,click:w,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Y,sig:$,description:e.description,reduced:d,publish:F,applySync:g}}var G=T(H(),1);function ga(e){return 1-Math.pow(1-e,3)}function pa(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function ba(e){return e==="easeInOut"?pa:e==="linear"?t=>t:ga}function ya(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 Le(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 pt(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 Or(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 Ir(e,t,n,r){if(!t||!n||t.length!==n.length)return Le(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 Le(s,n[a]))o.push(l)}return o.length===r?o:Le(e,r)}var bt=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||!pt(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),Or(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=pt(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 c=a.to.length;s.from=Ir(s.cur,s.parts,a.parts,c),s.vel=Ir(s.curVel,s.parts,a.parts,c),s.parts=a.parts,s.to=a.to.slice(),Or(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=pt(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(a,a.enter??a.from??a.to,n+l,0);c.done=pt(c.from,c.to),this.tracks.set(a.key,c)}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=Le(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=ba(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,c=s.to.length;if(s.from.length!==c&&(s.from=Le(s.from,c)),s.vel.length!==c&&(s.vel=Le(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-i*l),f=i*l>=8&&i*l<20,h=0;for(let m=0;m<c;m++){let p=s.from[m]-s.to[m],v=s.vel[m]+i*p;s.cur[m]=s.to[m]+(p+v*l)*u,s.curVel[m]=(s.vel[m]-i*v*l)*u,f&&h<.15&&(h=Math.max(h,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/i)))}d=i*l>=20||f&&h<.15,s.progress=Math.min(1,1-(1+i*l)*u)}else{let u=Math.min(1,l/o),f=r(u),h=ya(this.easing,u)/o;for(let m=0;m<c;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*f,s.curVel[m]=(s.to[m]-s.from[m])*h;d=u>=1,s.progress=f}if(d){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&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}},Ge=new Set,yt=0;function zr(e){yt=0;let t=Array.from(Ge);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ge.delete(n)}Ge.size&&typeof requestAnimationFrame<"u"&&(yt=requestAnimationFrame(zr))}function Br(e){return Ge.add(e),!yt&&typeof requestAnimationFrame<"u"&&(yt=requestAnimationFrame(zr)),()=>{Ge.delete(e)}}function xa(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 Hr(e,t){let n=(0,G.useMemo)(()=>xa(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,G.useRef)(null),f=(0,G.useRef)("init"),h=(0,G.useRef)(null),m=(0,G.useRef)(s),p=(0,G.useRef)(a),v=(0,G.useRef)(!1),k=(0,G.useRef)(0),[,$]=(0,G.useState)(0),M=(0,G.useRef)(null),R=(0,G.useRef)(!0);u.current||(u.current=new bt,u.current.configure(l,c),u.current.snap(n),h.current=n);let x=u.current;if(x.configure(l,c),h.current!==n){let F=f.current,S=!Object.is(m.current,s);x.sameTargets(n)?x.refreshData(n):!r||F==="init"?x.snap(n):F==="idle"?x.hold(n):F==="running"||S?x.update(n,Ue(),d):x.snap(n),h.current=n,m.current=s}let N=(0,G.useRef)(()=>!1);N.current=F=>{if(!R.current)return!1;let S=x.step(F);return!S&&f.current==="running"&&(f.current="done"),$(y=>(y+1)%1e9),S||(M.current=null),S};let P=(0,G.useCallback)(()=>{if(!ne||M.current||!x.animating)return;let F=S=>N.current(S);M.current=Br(F)},[x]);ce(()=>{let F=!Object.is(p.current,a);if(p.current=a,!r){(f.current!=="done"||x.animating)&&(x.snap(h.current??n),f.current="done",$(S=>S+1));return}f.current==="init"||F&&i?(x.hold(h.current??n),f.current="idle",v.current=!1,$(S=>S+1)):F&&(v.current=!0)},[r,a]),ce(()=>{!r||!i||!v.current||(v.current=!1,x.hold(h.current??n),f.current="idle",$(F=>F+1))},[i,r]),(0,G.useEffect)(()=>{r&&o&&f.current==="idle"&&(x.start(Ue()),k.current+=1,f.current="running",P(),$(F=>F+1))},[r,o,a,x,P]),(0,G.useEffect)(()=>{x.animating&&P()}),(0,G.useEffect)(()=>(R.current=!0,()=>{R.current=!1,M.current?.(),M.current=null}),[]);let D=Ue(),O=x.elapsed(D),E=r&&f.current==="idle";return{items:x.items(),get:F=>x.get(F),elapsed:E?0:O,fade:(F,S=320)=>E?0:Number.isFinite(O)?Math.max(0,Math.min(1,(O-F)/S)):1,waiting:E,animating:x.animating,generation:k.current}}var qt=T(L(),1);function Gr(e,t,n,r,o){if(r)return o==="categorical"?re(e,t,n):Cn(e,t,n);if(o==="categorical")return re(e,t,n);let i=V(e,"strong"),a=V(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var ka=T(H(),1);var Zt=T(L(),1);var Vr=e=>e?"neutralStrong":"accent";var Qt=T(L(),1);function Wr(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 wa=T(H(),1);var tn=T(L(),1),va={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}, ${de(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Kr={en:va,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}일 이동평균`}},en=["ink","muted","dim"];function Ur(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,en.length)}var $a=T(H(),1);var Zr=T(L(),1),Ma={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${de(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ta={en:Ma,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Xr=(e,t)=>Ta[e].other(t);function Yr(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,or(o.map(i=>i.value)))}}var Jr=e=>Number.isFinite(e)&&e>0?e:0;function qr(e,t,n,r){return r==="emphasis"?Tn(e,t,n):re(e,t,n)}var Ee=T(H(),1);var te=T(L(),1),Ca={kind:"Radar chart",desc:(e,t,n)=>`${de(e,"metric")} (${t}), ${de(n,"series","series")}`},Sa={en:Ca,ko:{kind:"레이더 차트",desc:(e,t,n)=>`지표 ${e}개(${t}), 계열 ${n}개`}};function nn(e){let t=Er(e,{height:y=>Math.max(220,Math.min(300,y*.66)),duration:900,stagger:160}),{p:n,width:r,height:o}=t,i=(0,Ee.useMemo)(()=>Te(e.data,e.axis??"axis",e.value,e.series,{xType:"band",locale:t.locale}),[e.data,e.axis,e.value,e.series,t.locale]),a=i.labels,s=a.length,l=(0,Ee.useMemo)(()=>le(e.highlight,i.series,i.series,i.series.map(()=>0),"first"),[i,e.highlight]),c=Math.max(0,...i.values.flat().filter(Number.isFinite)),d=e.max??mr(0,c,e.levels??4)[1],u=e.levels??4,f=Math.max(...a.map(y=>Me(y,11.5,600)),20)+10,h=Math.max(30,Math.min(r/2-f,o/2-22)),m=r/2,p=o/2+2,v=y=>y/Math.max(1,s)*Fe,k=(0,Ee.useMemo)(()=>i.series.map((y,g)=>({s:g,name:y,r:i.values[g].map(w=>Number.isFinite(w)?Math.max(0,w)/d*h:0),hi:l.has(g)})),[i,d,h,l]),$=t.motion.stagger??160,M=(0,Ee.useMemo)(()=>[...k].sort((y,g)=>Number(y.hi)-Number(g.hi)),[k]),R=(0,Ee.useMemo)(()=>M.map((y,g)=>({key:`r:${y.name}`,to:y.r,from:y.r.map(()=>0),enter:y.r.map(()=>0),delay:g*$,data:y})),[M,$]),x=Hr(R,t.motion),N=V(n,"accent"),P=a.map((y,g)=>({datum:null,index:g,key:y,label:y,value:i.values[[...l][0]??0]?.[g]??null,formatted:i.series.map((w,A)=>`${w||t.t.value} ${t.fv(i.values[A][g])}`).join(", ")})),D=null;if(t.active!==null&&a[t.active]!==void 0){let y=t.active,g=Math.max(...k.map(_=>_.r[y]??0)),[w,A]=ye(m,p,g,v(y));D={x:w,y:A,title:a[y],rows:k.map(_=>({label:_.name||t.t.value,value:t.fv(i.values[_.s][y]),color:_.hi?N.fill:n.paint("neutralStrong"),strong:_.hi}))}}let O=y=>e.circular?`M${m-y},${p}a${y},${y} 0 1 0 ${y*2},0a${y},${y} 0 1 0 ${-y*2},0`:a.map((g,w)=>{let[A,_]=ye(m,p,y,v(w));return`${w?"L":"M"}${A.toFixed(2)},${_.toFixed(2)}`}).join("")+"Z",E=t.motion.duration??900,F=Sa[t.lang],S=e.description??`${F.kind}. ${F.desc(s,a.join(", "),i.series.length)}.`;return(0,te.jsxs)(Gn,{c:t,kind:F.kind,ariaLabel:e.ariaLabel,description:S,events:P,tip:D,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(y,g,w)=>{let A=Math.atan2(y-m,-(g-p)),_=Math.round((A+Fe)%Fe/Fe*s)%s,B=Math.hypot(y-m,g-p);t.setActive(B<h+30?_:null,w.pointerType==="touch"?"touch":"pointer")},children:[(0,te.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:u},(y,g)=>(0,te.jsx)("path",{d:O(h*(g+1)/u),fill:"none",stroke:n.paint("line"),strokeWidth:1},g)),a.map((y,g)=>{let[w,A]=ye(m,p,h,v(g));return(0,te.jsx)("line",{x1:m,y1:p,x2:w,y2:A,stroke:n.paint(t.active===g?"dim":"line"),strokeWidth:1},g)}),Array.from({length:u},(y,g)=>{let w=d*(g+1)/u,[A,_]=ye(m,p,h*(g+1)/u,0);return(0,te.jsx)(zt,{x:A+4,y:_+1,size:9.5,fill:n.paint("ink"),children:t.fmt(w)},g)})]}),x.items.map(y=>{let g=y.data,w=y.v.map((B,Y)=>ye(m,p,B,v(Y))),A=w.map(([B,Y],I)=>`${I?"L":"M"}${B.toFixed(2)},${Y.toFixed(2)}`).join("")+"Z",_=g.hi?N.fill:n.paint("neutralStrong");return(0,te.jsxs)("g",{opacity:y.exiting?.4:1,pointerEvents:"none",children:[(0,te.jsx)("path",{d:A,fill:g.hi?N.fill:n.paint("neutral"),fillOpacity:g.hi?.2:.22,stroke:_,strokeWidth:g.hi?2.2:1.4,strokeLinejoin:"round"}),g.hi?w.map(([B,Y],I)=>(0,te.jsx)("circle",{cx:B,cy:Y,r:t.active===I?4.5:3,fill:_,stroke:n.paint("panel"),strokeWidth:1.5},I)):null]},y.key)}),(0,te.jsx)("g",{"aria-hidden":"true",children:a.map((y,g)=>{let w=v(g),[A,_]=ye(m,p,h+12,w),B=Math.sin(w),Y=B>.15?"start":B<-.15?"end":"middle",I=Math.cos(w)>.9?-4:Math.cos(w)<-.9?4:0,U=t.active===g;return(0,te.jsx)(zt,{x:A,y:_+I,anchor:Y,size:11.5,weight:U?800:600,fill:n.paint(U?"ink":"muted"),opacity:x.fade(E*.4,300),children:y},g)})})]})}var Aa=T(H(),1);var no=T(L(),1);function Qr(e,t){return t===!1?e.map((n,r)=>r):rr(e)}function eo(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return le(e,t,t,r,"max")}function to(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=V(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?V(e,"neutral"):Ye(e,1-a/Math.max(1,o.length-1))),r}function ro(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ae(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function oo(e,t){return Ie(e,t+1,new Set)}var Na=T(H(),1);var ao=T(L(),1);function io(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Mr.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var he=T(L(),1);function so(e,t,n){let r=st(e);return r?.type==="scatter"&&t?.size!==void 0&&!at(n)?st("bubble"):r}function Ra(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 Fa(e,t,n,r=!1){let o=so(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&Bt.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),c=u=>u.filter(f=>!l.has(f.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(d.includes(o.type)){let u=fe(i.label,"label"),f=lt(i.value,"value"),h=o.type==="waffle",m=t.map((x,N)=>({r:x,label:u(x,N),value:h?f(x,N):Jr(f(x,N))})),{kept:p,other:v}=h?{kept:m,other:null}:Yr(m,a.other,(x,N)=>({r:{},label:Xr(j(n),x),value:N})),k=le(s,p.map(x=>x.r),p.map(x=>x.label),p.map(x=>x.value),h?"first":"max"),$=v?[...p,v]:p,M=pe(x=>h?re(x,$.length,k):qr(x,$.length,k,a.colorMode)),R=h&&a.shape==="arc";return $.map((x,N)=>({label:x.label,color:M[N],...R&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Ur(Array.isArray(a.ma)?a.ma:void 0,t.length),f=Kr[j(n)];return[{label:f.up,color:a.upColor??"accent"},{label:f.down,color:a.downColor??"neutralStrong"},...u.map((h,m)=>({label:f.maLegend(h),color:en[m],shape:"line"}))]}if(o.type==="network"){let u=ro(a.groups);if(u.length<2)return[];let f=pe(h=>oo(h,u.length));return u.map((h,m)=>({label:h,color:f[m],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let u=fe(i.group,"group"),f=ae(t.map((m,p)=>u(m,p)).filter(Boolean));if(f.length<2)return[];let h=pe(m=>Ie(m,f.length,new Set));return f.map((m,p)=>({label:m,color:h[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||at(a))return[];let u=fe(i.series,"series"),f=ae(t.map((p,v)=>u(p,v)));if(f.length<2)return[];let h=Wr(s,t,f,u),m=pe(p=>Ie(p,f.length,h));return c(f.map((p,v)=>({label:p,color:m[v],shape:"circle"})))}if(o.type==="timeline"){let u=typeof i.group!="string",f=u?i.status:i.group;if(typeof f!="string")return[];let h=Dr(t,f,u),m=pe(p=>re(p,h.length,io(s,h)));return c(h.map((p,v)=>({label:p,color:m[v],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(i.y))u=i.y;else if(typeof i.series=="string"){let M=fe(i.series,"series");u=ae(t.map((R,x)=>M(R,x)))}let f=Ht(o.type,i,a);if(f.length){let M=le(s,u,u,u.map(()=>0),"none"),R=pe(N=>re(N,u.length,M)),x=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((N,P)=>({label:N,color:R[P]}));return[...c(x),...f.map((N,P)=>({label:N,color:Vr(P),shape:"line"}))]}if(u.length<2)return[];let m=o.type==="bar"&&a.layout==="diverging"&&s===void 0?nr(u.length,Array.isArray(a.negative)?a.negative.map(M=>u.indexOf(String(M))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,p=m>=0?new Set([m]):le(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((M,R)=>({label:M,color:p.has(R)?"accent":"neutralStrong",shape:"square"})));let v=a.colorMode,k=M=>re(M,u.length,p);if((o.type==="line"||o.type==="area")&&(k=M=>Gr(M,u.length,p,o.type==="area",v)),o.type==="stream"){let M=Te(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),R=Qr(M.values,a.reorder),x=eo(s,M.series,M.values);k=N=>to(N,R,x)}let $=pe(k);return c(u.map((M,R)=>({label:M,color:$[R],...o.type==="line"&&{shape:"line"}})))}return[]}function _a(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Xn.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Pa(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:i,highlight:a,syncId:s,title:l,description:c}}function lo(e,t){let{spec:n}=e,r=so(n.type,n.encoding,n.options),o=(0,Ve.useMemo)(()=>Lr(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=Un(n,e.locale),s=J(a),l=j(s),c=Tr(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),d=qn(n),u=(0,Ve.useMemo)(()=>d?_r(d,s):void 0,[d,s]),f=n.options?.hidden,h=Array.isArray(f)?f.map(String):[],m=h.join(""),[p,v]=(0,Ve.useState)(null);if(!r)return(0,he.jsx)(It,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let k=o??c.data,$=t[r.type],M={...n.options??{}},R={...Ra(r,n.encoding),...M,...u?{tooltip:u}:{},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:a},x=n.card?.legend==="toggle"&&Jn(r.type,n.encoding??{},M),N=p&&p.base===m?p.hidden:h;x&&(R.hidden=N);let P=S=>v(y=>{let g=y&&y.base===m?y.hidden:h;return{base:m,hidden:g.includes(S)?g.filter(w=>w!==S):[...g,S]}}),D=R.height??220,O=_a(n,r.type),E=i&&!k.length&&(c.loading||c.error||c.empty)?(0,he.jsx)(It,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:D,locale:a}):O?(0,he.jsx)($r,{chart:$,...Pa(r.type,O,R)}):(0,he.jsx)($,{...R});if(n.card){let S=n.card,y=S.legend==="auto"||S.legend==="toggle"?Fa(n,k,s,x):S.legend,g=y?.length?x?(0,he.jsx)(Ot,{items:y,hidden:N,onToggle:P,locale:a}):y:void 0,w=S.download?(0,he.jsx)(Fr,{data:k,columns:Zn(n),filename:S.title??r.type,formats:Array.isArray(S.download)?S.download:void 0,locale:a}):void 0;E=(0,he.jsx)(jn,{number:S.number,title:S.title??Kn(r,l),subtitle:S.subtitle,legend:g,actions:w,source:S.source||void 0,note:S.note||void 0,accent:S.accent,takeaway:S.takeaway,level:S.level,sample:S.sample,replay:S.replay!==!1,className:e.className,locale:a,children:E})}let F=e.theme??n.theme;return F&&(E=(0,he.jsx)(tt,{theme:F,children:E})),E}function Da({cfg:e,components:t}){let n=Pe();return lo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function uo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,co.hydrateRoot)(r,(0,rn.createElement)(tt,{theme:o.theme,cssVars:!0},(0,rn.createElement)(Da,{cfg:o,components:{[e]:t}})))}uo("radar",nn);})();
27
+ `}function fi(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Yt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Sr=2,xe=16;function Ar(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 Nr(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 Rr(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+xe*2,i+xe*2],c=o.cloneNode(!0),d=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((m,p)=>{let $;for(let k of Array.from(m.attributes)){if(!ui.test(k.value))continue;let v=($??($=getComputedStyle(m))).getPropertyValue(k.name);v&&d[p].setAttribute(k.name,Ar(v,u))}}),c.removeAttribute("style");for(let[m,p]of Object.entries({viewBox:`${-xe} ${-xe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(m,String(p));let f=Ar(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let m=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Nr("rect",{x:-xe,y:-xe,width:s,height:l,fill:f}),m),h&&c.insertBefore(Nr("image",{href:h.toDataURL(),width:a,height:i}),m)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:f,canvas:h}}function hi(e,t){let n=Rr(e,Sr,!1);if(!n)return;let r=Sr,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,xe*r,xe*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&&Yt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Fr(e){let t=ae(e.theme),n=j(J(e.locale))==="ko",r=fi(e.filename),o=(a,i)=>{if(a==="csv")return Yt(new Blob([di(e.data,e.columns?.length?e.columns:mi(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return hi(i,r);let s=Rr(i,1,!0);s&&Yt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Jt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:li.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Jt.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 Pr=T(L(),1);function _r(e,t=X){let n=we(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?ze(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(Ln,(d,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Pr.jsx)("div",{children:s},l)):null}}function Dr(e,t,n=!1){let r=fe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=ie(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}function Lr(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 ve(t.csv)}return null}var jr=T(H(),1);var W=T(H(),1);function Er(e,t){let n=ae(e.theme),[r,o,a]=ht(e.width),i=Pe(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,d=gt(e.reducedMotion??"auto"),u=e.animate!==!1&&!d&&ne,f=$r(r,e.animateOnView!==!1&&u),h=J(e.locale),m=j(h),p=(0,W.useMemo)(()=>we(e.format,h,t.format),[e.format,h,t.format]),$=(0,W.useCallback)(I=>Je(I,{locale:h}),[h]),k=(0,W.useMemo)(()=>qe(p,e.unit),[p,e.unit]),v=(0,W.useMemo)(()=>ct(e.data),[e.data]),[M,R]=(0,W.useState)(null),[x,N]=(0,W.useState)(null),P=(0,W.useRef)([]),D=(0,W.useRef)(e.onHover);D.current=e.onHover;let O=(0,W.useRef)(e.onClick);O.current=e.onClick;let E=(0,W.useRef)(null),F=(0,W.useRef)(null),S=(0,W.useRef)(null),y=(0,W.useCallback)((I,U="pointer")=>{if(S.current!==I){S.current=I;let me=I===null?null:P.current[I]??null;queueMicrotask(()=>D.current?.(me)),F.current?.(I)}E.current=I===null?null:U,R(I),N(E.current)},[]),g=(0,W.useCallback)(I=>{E.current!=="keyboard"&&(E.current=I===null?null:"sync",R(I),N(E.current))},[]),w=(0,W.useCallback)(I=>{let U=P.current[I];U&&O.current?.(U)},[]),A=Hn(e.replayKey),_=e.width!==void 0||(a??0)>0,B={enabled:u,active:f.visible&&_,near:f.near,replayKey:A,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Y=(0,W.useCallback)((I,U=1)=>M===null||M===I?U:U*.38,[M]);return{p:n,width:s,height:c,measured:_,responsive:e.width===void 0,pending:ne&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:B,fv:k,fmt:p,pct:$,locale:h,lang:m,t:m==="ko"?yn:bn,active:M,via:x,setActive:y,click:w,events:P,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Y,sig:v,description:e.description,reduced:d,publish:F,applySync:g}}var G=T(H(),1);function gi(e){return 1-Math.pow(1-e,3)}function pi(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function bi(e){return e==="easeInOut"?pi:e==="linear"?t=>t:gi}function yi(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 Le(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 pt(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 Or(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 Ir(e,t,n,r){if(!t||!n||t.length!==n.length)return Le(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 Le(s,n[i]))o.push(l)}return o.length===r?o:Le(e,r)}var bt=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||!pt(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),Or(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=pt(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 c=i.to.length;s.from=Ir(s.cur,s.parts,i.parts,c),s.vel=Ir(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),Or(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=pt(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=pt(c.from,c.to),this.tracks.set(i.key,c)}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=Le(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=bi(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,c=s.to.length;if(s.from.length!==c&&(s.from=Le(s.from,c)),s.vel.length!==c&&(s.vel=Le(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let u=Math.exp(-a*l),f=a*l>=8&&a*l<20,h=0;for(let m=0;m<c;m++){let p=s.from[m]-s.to[m],$=s.vel[m]+a*p;s.cur[m]=s.to[m]+(p+$*l)*u,s.curVel[m]=(s.vel[m]-a*$*l)*u,f&&h<.15&&(h=Math.max(h,Math.abs(s.cur[m]-s.to[m]),Math.abs(s.curVel[m]/a)))}d=a*l>=20||f&&h<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),f=r(u),h=yi(this.easing,u)/o;for(let m=0;m<c;m++)s.cur[m]=s.from[m]+(s.to[m]-s.from[m])*f,s.curVel[m]=(s.to[m]-s.from[m])*h;d=u>=1,s.progress=f}if(d){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Ge=new Set,yt=0;function zr(e){yt=0;let t=Array.from(Ge);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Ge.delete(n)}Ge.size&&typeof requestAnimationFrame<"u"&&(yt=requestAnimationFrame(zr))}function Br(e){return Ge.add(e),!yt&&typeof requestAnimationFrame<"u"&&(yt=requestAnimationFrame(zr)),()=>{Ge.delete(e)}}function xi(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 Hr(e,t){let n=(0,G.useMemo)(()=>xi(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:d=0}=t,u=(0,G.useRef)(null),f=(0,G.useRef)("init"),h=(0,G.useRef)(null),m=(0,G.useRef)(s),p=(0,G.useRef)(i),$=(0,G.useRef)(!1),k=(0,G.useRef)(0),[,v]=(0,G.useState)(0),M=(0,G.useRef)(null),R=(0,G.useRef)(!0);u.current||(u.current=new bt,u.current.configure(l,c),u.current.snap(n),h.current=n);let x=u.current;if(x.configure(l,c),h.current!==n){let F=f.current,S=!Object.is(m.current,s);x.sameTargets(n)?x.refreshData(n):!r||F==="init"?x.snap(n):F==="idle"?x.hold(n):F==="running"||S?x.update(n,Ue(),d):x.snap(n),h.current=n,m.current=s}let N=(0,G.useRef)(()=>!1);N.current=F=>{if(!R.current)return!1;let S=x.step(F);return!S&&f.current==="running"&&(f.current="done"),v(y=>(y+1)%1e9),S||(M.current=null),S};let P=(0,G.useCallback)(()=>{if(!ne||M.current||!x.animating)return;let F=S=>N.current(S);M.current=Br(F)},[x]);ce(()=>{let F=!Object.is(p.current,i);if(p.current=i,!r){(f.current!=="done"||x.animating)&&(x.snap(h.current??n),f.current="done",v(S=>S+1));return}f.current==="init"||F&&a?(x.hold(h.current??n),f.current="idle",$.current=!1,v(S=>S+1)):F&&($.current=!0)},[r,i]),ce(()=>{!r||!a||!$.current||($.current=!1,x.hold(h.current??n),f.current="idle",v(F=>F+1))},[a,r]),(0,G.useEffect)(()=>{r&&o&&f.current==="idle"&&(x.start(Ue()),k.current+=1,f.current="running",P(),v(F=>F+1))},[r,o,i,x,P]),(0,G.useEffect)(()=>{x.animating&&P()}),(0,G.useEffect)(()=>(R.current=!0,()=>{R.current=!1,M.current?.(),M.current=null}),[]);let D=Ue(),O=x.elapsed(D),E=r&&f.current==="idle";return{items:x.items(),get:F=>x.get(F),elapsed:E?0:O,fade:(F,S=320)=>E?0:Number.isFinite(O)?Math.max(0,Math.min(1,(O-F)/S)):1,waiting:E,animating:x.animating,generation:k.current}}var qt=T(L(),1);function Gr(e,t,n,r,o){if(r)return o==="categorical"?re(e,t,n):Cn(e,t,n);if(o==="categorical")return re(e,t,n);let a=V(e,"strong"),i=V(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var ki=T(H(),1);var Zt=T(L(),1);var Vr=e=>e?"neutralStrong":"accent";var Qt=T(L(),1);function Wr(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 wi=T(H(),1);var tn=T(L(),1),$i={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}, ${de(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Kr={en:$i,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}일 이동평균`}},en=["ink","muted","dim"];function Ur(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,en.length)}var vi=T(H(),1);var Zr=T(L(),1),Mi={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${de(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ti={en:Mi,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Xr=(e,t)=>Ti[e].other(t);function Yr(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,or(o.map(a=>a.value)))}}var Jr=e=>Number.isFinite(e)&&e>0?e:0;function qr(e,t,n,r){return r==="emphasis"?Tn(e,t,n):re(e,t,n)}var Ee=T(H(),1);var te=T(L(),1),Ci={kind:"Radar chart",desc:(e,t,n)=>`${de(e,"metric")} (${t}), ${de(n,"series","series")}`},Si={en:Ci,ko:{kind:"레이더 차트",desc:(e,t,n)=>`지표 ${e}개(${t}), 계열 ${n}개`}};function nn(e){let t=Er(e,{height:y=>Math.max(220,Math.min(300,y*.66)),duration:900,stagger:160}),{p:n,width:r,height:o}=t,a=(0,Ee.useMemo)(()=>Te(e.data,e.axis??"axis",e.value,e.series,{xType:"band",locale:t.locale}),[e.data,e.axis,e.value,e.series,t.locale]),i=a.labels,s=i.length,l=(0,Ee.useMemo)(()=>le(e.highlight,a.series,a.series,a.series.map(()=>0),"first"),[a,e.highlight]),c=Math.max(0,...a.values.flat().filter(Number.isFinite)),d=e.max??mr(0,c,e.levels??4)[1],u=e.levels??4,f=Math.max(...i.map(y=>Me(y,11.5,600)),20)+10,h=Math.max(30,Math.min(r/2-f,o/2-22)),m=r/2,p=o/2+2,$=y=>y/Math.max(1,s)*Fe,k=(0,Ee.useMemo)(()=>a.series.map((y,g)=>({s:g,name:y,r:a.values[g].map(w=>Number.isFinite(w)?Math.max(0,w)/d*h:0),hi:l.has(g)})),[a,d,h,l]),v=t.motion.stagger??160,M=(0,Ee.useMemo)(()=>[...k].sort((y,g)=>Number(y.hi)-Number(g.hi)),[k]),R=(0,Ee.useMemo)(()=>M.map((y,g)=>({key:`r:${y.name}`,to:y.r,from:y.r.map(()=>0),enter:y.r.map(()=>0),delay:g*v,data:y})),[M,v]),x=Hr(R,t.motion),N=V(n,"accent"),P=i.map((y,g)=>({datum:null,index:g,key:y,label:y,value:a.values[[...l][0]??0]?.[g]??null,formatted:a.series.map((w,A)=>`${w||t.t.value} ${t.fv(a.values[A][g])}`).join(", ")})),D=null;if(t.active!==null&&i[t.active]!==void 0){let y=t.active,g=Math.max(...k.map(_=>_.r[y]??0)),[w,A]=ye(m,p,g,$(y));D={x:w,y:A,title:i[y],rows:k.map(_=>({label:_.name||t.t.value,value:t.fv(a.values[_.s][y]),color:_.hi?N.fill:n.paint("neutralStrong"),strong:_.hi}))}}let O=y=>e.circular?`M${m-y},${p}a${y},${y} 0 1 0 ${y*2},0a${y},${y} 0 1 0 ${-y*2},0`:i.map((g,w)=>{let[A,_]=ye(m,p,y,$(w));return`${w?"L":"M"}${A.toFixed(2)},${_.toFixed(2)}`}).join("")+"Z",E=t.motion.duration??900,F=Si[t.lang],S=e.description??`${F.kind}. ${F.desc(s,i.join(", "),a.series.length)}.`;return(0,te.jsxs)(Gn,{c:t,kind:F.kind,ariaLabel:e.ariaLabel,description:S,events:P,tip:D,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(y,g,w)=>{let A=Math.atan2(y-m,-(g-p)),_=Math.round((A+Fe)%Fe/Fe*s)%s,B=Math.hypot(y-m,g-p);t.setActive(B<h+30?_:null,w.pointerType==="touch"?"touch":"pointer")},children:[(0,te.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:u},(y,g)=>(0,te.jsx)("path",{d:O(h*(g+1)/u),fill:"none",stroke:n.paint("line"),strokeWidth:1},g)),i.map((y,g)=>{let[w,A]=ye(m,p,h,$(g));return(0,te.jsx)("line",{x1:m,y1:p,x2:w,y2:A,stroke:n.paint(t.active===g?"dim":"line"),strokeWidth:1},g)}),Array.from({length:u},(y,g)=>{let w=d*(g+1)/u,[A,_]=ye(m,p,h*(g+1)/u,0);return(0,te.jsx)(zt,{x:A+4,y:_+1,size:9.5,fill:n.paint("ink"),children:t.fmt(w)},g)})]}),x.items.map(y=>{let g=y.data,w=y.v.map((B,Y)=>ye(m,p,B,$(Y))),A=w.map(([B,Y],I)=>`${I?"L":"M"}${B.toFixed(2)},${Y.toFixed(2)}`).join("")+"Z",_=g.hi?N.fill:n.paint("neutralStrong");return(0,te.jsxs)("g",{opacity:y.exiting?.4:1,pointerEvents:"none",children:[(0,te.jsx)("path",{d:A,fill:g.hi?N.fill:n.paint("neutral"),fillOpacity:g.hi?.2:.22,stroke:_,strokeWidth:g.hi?2.2:1.4,strokeLinejoin:"round"}),g.hi?w.map(([B,Y],I)=>(0,te.jsx)("circle",{cx:B,cy:Y,r:t.active===I?4.5:3,fill:_,stroke:n.paint("panel"),strokeWidth:1.5},I)):null]},y.key)}),(0,te.jsx)("g",{"aria-hidden":"true",children:i.map((y,g)=>{let w=$(g),[A,_]=ye(m,p,h+12,w),B=Math.sin(w),Y=B>.15?"start":B<-.15?"end":"middle",I=Math.cos(w)>.9?-4:Math.cos(w)<-.9?4:0,U=t.active===g;return(0,te.jsx)(zt,{x:A,y:_+I,anchor:Y,size:11.5,weight:U?800:600,fill:n.paint(U?"ink":"muted"),opacity:x.fade(E*.4,300),children:y},g)})})]})}var Ai=T(H(),1);var no=T(L(),1);function Qr(e,t){return t===!1?e.map((n,r)=>r):rr(e)}function eo(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return le(e,t,t,r,"max")}function to(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=V(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?V(e,"neutral"):Ye(e,1-i/Math.max(1,o.length-1))),r}function ro(e){return!e||typeof e!="object"||Array.isArray(e)?[]:ie(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function oo(e,t){return Ie(e,t+1,new Set)}var Ni=T(H(),1);var io=T(L(),1);var Ri=26;var fc=Ri*.62;function ao(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!Mr.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var he=T(L(),1);function so(e,t,n){let r=st(e);return r?.type==="scatter"&&t?.size!==void 0&&!it(n)?st("bubble"):r}function Fi(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 _i(e,t,n,r=!1){let o=so(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&Bt.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(f=>!l.has(f.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let u=fe(a.label,"label"),f=lt(a.value,"value"),h=o.type==="waffle",m=t.map((x,N)=>({r:x,label:u(x,N),value:h?f(x,N):Jr(f(x,N))})),{kept:p,other:$}=h?{kept:m,other:null}:Yr(m,i.other,(x,N)=>({r:{},label:Xr(j(n),x),value:N})),k=le(s,p.map(x=>x.r),p.map(x=>x.label),p.map(x=>x.value),h?"first":"max"),v=$?[...p,$]:p,M=pe(x=>h?re(x,v.length,k):qr(x,v.length,k,i.colorMode)),R=h&&i.shape==="arc";return v.map((x,N)=>({label:x.label,color:M[N],...R&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=Ur(Array.isArray(i.ma)?i.ma:void 0,t.length),f=Kr[j(n)];return[{label:f.up,color:i.upColor??"accent"},{label:f.down,color:i.downColor??"neutralStrong"},...u.map((h,m)=>({label:f.maLegend(h),color:en[m],shape:"line"}))]}if(o.type==="network"){let u=ro(i.groups);if(u.length<2)return[];let f=pe(h=>oo(h,u.length));return u.map((h,m)=>({label:h,color:f[m],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=fe(a.group,"group"),f=ie(t.map((m,p)=>u(m,p)).filter(Boolean));if(f.length<2)return[];let h=pe(m=>Ie(m,f.length,new Set));return f.map((m,p)=>({label:m,color:h[p],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||it(i))return[];let u=fe(a.series,"series"),f=ie(t.map((p,$)=>u(p,$)));if(f.length<2)return[];let h=Wr(s,t,f,u),m=pe(p=>Ie(p,f.length,h));return c(f.map((p,$)=>({label:p,color:m[$],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",f=u?a.status:a.group;if(typeof f!="string")return[];let h=Dr(t,f,u),m=pe(p=>re(p,h.length,ao(s,h)));return c(h.map((p,$)=>({label:p,color:m[$],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let M=fe(a.series,"series");u=ie(t.map((R,x)=>M(R,x)))}let f=Ht(o.type,a,i);if(f.length){let M=le(s,u,u,u.map(()=>0),"none"),R=pe(N=>re(N,u.length,M)),x=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((N,P)=>({label:N,color:R[P]}));return[...c(x),...f.map((N,P)=>({label:N,color:Vr(P),shape:"line"}))]}if(u.length<2)return[];let m=o.type==="bar"&&i.layout==="diverging"&&s===void 0?nr(u.length,Array.isArray(i.negative)?i.negative.map(M=>u.indexOf(String(M))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,p=m>=0?new Set([m]):le(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((M,R)=>({label:M,color:p.has(R)?"accent":"neutralStrong",shape:"square"})));let $=i.colorMode,k=M=>re(M,u.length,p);if((o.type==="line"||o.type==="area")&&(k=M=>Gr(M,u.length,p,o.type==="area",$)),o.type==="stream"){let M=Te(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),R=Qr(M.values,i.reorder),x=eo(s,M.series,M.values);k=N=>to(N,R,x)}let v=pe(k);return c(u.map((M,R)=>({label:M,color:v[R],...o.type==="line"&&{shape:"line"}})))}return[]}function Pi(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Xn.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Di(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function lo(e,t){let{spec:n}=e,r=so(n.type,n.encoding,n.options),o=(0,Ve.useMemo)(()=>Lr(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=Un(n,e.locale),s=J(i),l=j(s),c=Tr(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=qn(n),u=(0,Ve.useMemo)(()=>d?_r(d,s):void 0,[d,s]),f=n.options?.hidden,h=Array.isArray(f)?f.map(String):[],m=h.join(""),[p,$]=(0,Ve.useState)(null);if(!r)return(0,he.jsx)(It,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let k=o??c.data,v=t[r.type],M={...n.options??{}},R={...Fi(r,n.encoding),...M,...u?{tooltip:u}:{},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},x=n.card?.legend==="toggle"&&Jn(r.type,n.encoding??{},M),N=p&&p.base===m?p.hidden:h;x&&(R.hidden=N);let P=S=>$(y=>{let g=y&&y.base===m?y.hidden:h;return{base:m,hidden:g.includes(S)?g.filter(w=>w!==S):[...g,S]}}),D=R.height??220,O=Pi(n,r.type),E=a&&!k.length&&(c.loading||c.error||c.empty)?(0,he.jsx)(It,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:D,locale:i}):O?(0,he.jsx)(vr,{chart:v,...Di(r.type,O,R)}):(0,he.jsx)(v,{...R});if(n.card){let S=n.card,y=S.legend==="auto"||S.legend==="toggle"?_i(n,k,s,x):S.legend,g=y?.length?x?(0,he.jsx)(Ot,{items:y,hidden:N,onToggle:P,locale:i}):y:void 0,w=S.download?(0,he.jsx)(Fr,{data:k,columns:Zn(n),filename:S.title??r.type,formats:Array.isArray(S.download)?S.download:void 0,locale:i}):void 0;E=(0,he.jsx)(jn,{number:S.number,title:S.title??Kn(r,l),subtitle:S.subtitle,legend:g,actions:w,source:S.source||void 0,note:S.note||void 0,accent:S.accent,takeaway:S.takeaway,level:S.level,sample:S.sample,replay:S.replay!==!1,className:e.className,locale:i,children:E})}let F=e.theme??n.theme;return F&&(E=(0,he.jsx)(tt,{theme:F,children:E})),E}function Li({cfg:e,components:t}){let n=Pe();return lo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function uo(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,co.hydrateRoot)(r,(0,rn.createElement)(tt,{theme:o.theme,cssVars:!0},(0,rn.createElement)(Li,{cfg:o,components:{[e]:t}})))}uo("radar",nn);})();